mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 10:20:26 +01:00
206 lines
9.1 KiB
C++
206 lines
9.1 KiB
C++
/*
|
|
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
|
|
*/
|
|
|
|
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
|
|
#include "StdH.h"
|
|
#include <EntitiesMP/AnimationHub.h>
|
|
|
|
#include <EntitiesMP/AnimationChanger.h>
|
|
#include <EntitiesMP/AnimationChanger_tables.h>
|
|
CEntityEvent *EChangeAnim::MakeCopy(void) { CEntityEvent *peeCopy = new EChangeAnim(*this); return peeCopy;}
|
|
EChangeAnim::EChangeAnim() : CEntityEvent(EVENTCODE_EChangeAnim) {;
|
|
ClearToDefault(iModelAnim);
|
|
ClearToDefault(bModelLoop);
|
|
ClearToDefault(iTextureAnim);
|
|
ClearToDefault(bTextureLoop);
|
|
ClearToDefault(iLightAnim);
|
|
ClearToDefault(iAmbientLightAnim);
|
|
ClearToDefault(bLightLoop);
|
|
ClearToDefault(bAmbientLightLoop);
|
|
ClearToDefault(colAmbient);
|
|
ClearToDefault(colDiffuse);
|
|
};
|
|
void CAnimationChanger::SetDefaultProperties(void) {
|
|
m_strName = "Animation changer";
|
|
m_strDescription = "";
|
|
m_penTarget = NULL;
|
|
m_iModelAnim = 0;
|
|
m_bModelLoop = FALSE ;
|
|
m_iTextureAnim = 0;
|
|
m_bTextureLoop = FALSE ;
|
|
m_iLightAnim = 0;
|
|
m_bLightLoop = FALSE ;
|
|
m_iAmbientLightAnim = 0;
|
|
m_bAmbientLightLoop = FALSE ;
|
|
m_colAmbient = C_dBLUE ;
|
|
m_colDiffuse = C_GRAY ;
|
|
CRationalEntity::SetDefaultProperties();
|
|
}
|
|
|
|
#line 51 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
const CTString & CAnimationChanger::GetDescription(void)const {
|
|
#line 52 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
((CTString &) m_strDescription ) . PrintF ("-><none>");
|
|
#line 53 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
if(m_penTarget != NULL ){
|
|
#line 54 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
((CTString &) m_strDescription ) . PrintF ("->%s" , m_penTarget -> GetName ());
|
|
#line 55 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}
|
|
#line 56 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
return m_strDescription ;
|
|
#line 57 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}
|
|
|
|
#line 60 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
CAnimData * CAnimationChanger::GetAnimData(SLONG slPropertyOffset)
|
|
#line 61 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
{
|
|
#line 62 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
CEntity * penTarget = m_penTarget ;
|
|
#line 64 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
if(penTarget == NULL ){
|
|
#line 65 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
return NULL ;
|
|
#line 66 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}
|
|
#line 68 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
if(IsOfClass (penTarget , "AnimationHub")){
|
|
#line 69 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
penTarget = ((CAnimationHub *) penTarget ) -> m_penTarget0 ;
|
|
#line 70 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}
|
|
#line 72 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
if(penTarget == NULL ){
|
|
#line 73 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
return NULL ;
|
|
#line 74 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}
|
|
#line 77 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
if(IsOfClass (penTarget , "ModelHolder2")){
|
|
#line 78 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
CModelHolder2 * penModel = (CModelHolder2 *) & * penTarget ;
|
|
#line 79 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
if(slPropertyOffset == offsetof (CAnimationChanger , m_iModelAnim )){
|
|
#line 80 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
return penModel -> GetModelObject () -> GetData ();
|
|
#line 81 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}else if(slPropertyOffset == offsetof (CAnimationChanger , m_iTextureAnim )){
|
|
#line 82 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
return penModel -> GetModelObject () -> mo_toTexture . GetData ();
|
|
#line 83 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}else if(slPropertyOffset == offsetof (CAnimationChanger , m_iLightAnim )){
|
|
#line 84 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
return penModel -> m_aoLightAnimation . GetData ();
|
|
#line 85 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}
|
|
#line 88 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}else if(IsOfClass (penTarget , "Light")){
|
|
#line 89 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
CLight * penLight = (CLight *) & * penTarget ;
|
|
#line 91 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
if(slPropertyOffset == offsetof (CAnimationChanger , m_iLightAnim ))
|
|
#line 92 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
{
|
|
#line 93 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
return penLight -> m_aoLightAnimation . GetData ();
|
|
#line 94 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}
|
|
#line 95 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
else if(slPropertyOffset == offsetof (CAnimationChanger , m_iAmbientLightAnim ))
|
|
#line 96 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
{
|
|
#line 97 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
return penLight -> m_aoAmbientLightAnimation . GetData ();
|
|
#line 98 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}
|
|
#line 99 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}
|
|
#line 101 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
return CEntity :: GetAnimData (slPropertyOffset );
|
|
#line 102 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}
|
|
BOOL CAnimationChanger::
|
|
#line 105 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
Main(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CAnimationChanger_Main
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CAnimationChanger::Main expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 107 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
InitAsEditorModel ();
|
|
#line 108 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
SetPhysicsFlags (EPF_MODEL_IMMATERIAL );
|
|
#line 109 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
SetCollisionFlags (ECF_IMMATERIAL );
|
|
#line 112 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
SetModel (MODEL_CHANGER );
|
|
#line 113 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
SetModelMainTexture (TEXTURE_CHANGER );
|
|
#line 116 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
if(m_penTarget != NULL &&
|
|
#line 117 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
! IsOfClass (m_penTarget , "AnimationHub") &&
|
|
#line 118 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
! IsOfClass (m_penTarget , "ModelHolder2") &&
|
|
#line 119 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
! IsOfClass (m_penTarget , "Light")){
|
|
#line 120 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
WarningMessage ("Target must be AnimationHub ModelHolder2 or Light!");
|
|
#line 121 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
m_penTarget = NULL ;
|
|
#line 122 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}
|
|
#line 123 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
if(m_penTarget == NULL ){
|
|
#line 124 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
Return(STATE_CURRENT,EVoid());
|
|
#line 124 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
return TRUE;
|
|
#line 125 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}
|
|
#line 128 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
SetTimerAt(THINKTIME_NEVER);
|
|
Jump(STATE_CURRENT, 0x00da0001, FALSE, EBegin());return TRUE;}BOOL CAnimationChanger::H0x00da0001_Main_01(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00da0001
|
|
switch(__eeInput.ee_slEvent){case(EVENTCODE_EBegin):{const EBegin&e= (EBegin&)__eeInput;
|
|
return TRUE;}ASSERT(FALSE);break;case(EVENTCODE_EStart):{const EStart&e= (EStart&)__eeInput;
|
|
|
|
#line 131 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
EChangeAnim eChange ;
|
|
#line 132 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
eChange . iModelAnim = m_iModelAnim ;
|
|
#line 133 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
eChange . iTextureAnim = m_iTextureAnim ;
|
|
#line 134 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
eChange . iLightAnim = m_iLightAnim ;
|
|
#line 135 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
eChange . iAmbientLightAnim = m_iAmbientLightAnim ;
|
|
#line 136 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
eChange . bModelLoop = m_bModelLoop ;
|
|
#line 137 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
eChange . bTextureLoop = m_bTextureLoop ;
|
|
#line 138 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
eChange . bLightLoop = m_bLightLoop ;
|
|
#line 139 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
eChange . colAmbient = m_colAmbient ;
|
|
#line 140 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
eChange . colDiffuse = m_colDiffuse ;
|
|
#line 141 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
m_penTarget -> SendEvent (eChange );
|
|
#line 142 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
return TRUE;
|
|
#line 143 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}ASSERT(FALSE);break;default: return FALSE; break;
|
|
#line 144 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
}return TRUE;}BOOL CAnimationChanger::H0x00da0002_Main_02(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00da0002
|
|
|
|
#line 145 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
Return(STATE_CURRENT,EVoid());
|
|
#line 145 "D:/SE1_GPL/Sources/EntitiesMP/AnimationChanger.es"
|
|
return TRUE; ASSERT(FALSE); return TRUE;}; |