mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-26 04:05:53 +01:00
218 lines
11 KiB
C++
218 lines
11 KiB
C++
/*
|
|
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
|
|
*/
|
|
|
|
#line 8 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
|
|
#include "StdH.h"
|
|
#include <Engine/Entities/InternalClasses.h>
|
|
#include <Engine/Base/CRC.h>
|
|
#include <Engine/Base/Stream.h>
|
|
#include <Engine/Base/Console.h>
|
|
#include <Engine/Models/ModelObject.h>
|
|
|
|
#include <Engine/Classes/MovableModelEntity.h>
|
|
#include <Engine/Classes/MovableModelEntity_tables.h>
|
|
void CMovableModelEntity::SetDefaultProperties(void) {
|
|
en_iCollisionBox = 0;
|
|
en_iWantedCollisionBox = 0;
|
|
CMovableEntity::SetDefaultProperties();
|
|
}
|
|
void CMovableModelEntity::ChecksumForSync(ULONG & ulCRC,INDEX iExtensiveSyncCheck)
|
|
#line 32 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
{
|
|
#line 33 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
CMovableEntity :: ChecksumForSync (ulCRC , iExtensiveSyncCheck );
|
|
#line 34 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
if(iExtensiveSyncCheck > 0){
|
|
#line 35 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
CRC_AddLONG (ulCRC , en_iCollisionBox );
|
|
#line 36 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
CRC_AddLONG (ulCRC , en_iWantedCollisionBox );
|
|
#line 37 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
#line 38 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
void CMovableModelEntity::DumpSync_t(CTStream & strm,INDEX iExtensiveSyncCheck)
|
|
#line 41 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
{
|
|
#line 42 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
CMovableEntity :: DumpSync_t (strm , iExtensiveSyncCheck );
|
|
#line 43 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
if(iExtensiveSyncCheck > 0){
|
|
#line 44 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
strm . FPrintF_t ("collision box: %d(%d)\n" , en_iCollisionBox , en_iWantedCollisionBox );
|
|
#line 45 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
#line 46 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
void CMovableModelEntity::PreMoving(void)
|
|
#line 50 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
{
|
|
#line 52 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
if(en_iCollisionBox != en_iWantedCollisionBox ){
|
|
#line 54 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
ChangeCollisionBoxIndexNow (en_iWantedCollisionBox );
|
|
#line 55 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
#line 57 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
CMovableEntity :: PreMoving ();
|
|
#line 58 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
void CMovableModelEntity::DoMoving(void)
|
|
#line 60 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
{
|
|
#line 61 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
CMovableEntity :: DoMoving ();
|
|
#line 62 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
INDEX CMovableModelEntity::GetCollisionBoxIndex(void)
|
|
#line 66 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
{
|
|
#line 67 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
return en_iCollisionBox ;
|
|
#line 68 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
BOOL CMovableModelEntity::CheckForCollisionNow(INDEX iNewCollisionBox,CEntity * * ppenObstacle)
|
|
#line 72 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
{
|
|
#line 74 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
extern BOOL CanEntityChangeCollisionBox (CEntity * pen , INDEX iNewCollisionBox , CEntity * * ppenObstacle );
|
|
#line 75 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
return ! CanEntityChangeCollisionBox (this , en_iCollisionBox , ppenObstacle );
|
|
#line 76 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
BOOL CMovableModelEntity::ChangeCollisionBoxIndexNow(INDEX iNewCollisionBox,CEntity * * ppenObstacle)
|
|
#line 80 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
{
|
|
#line 82 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
if(iNewCollisionBox == en_iCollisionBox ){
|
|
#line 84 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
return TRUE ;
|
|
#line 85 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
#line 89 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
extern BOOL CanEntityChangeCollisionBox (CEntity * pen , INDEX iNewCollisionBox , CEntity * * ppenObstacle );
|
|
#line 90 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
BOOL bCanChange = CanEntityChangeCollisionBox (this , iNewCollisionBox , ppenObstacle );
|
|
#line 93 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
if(! bCanChange ){
|
|
#line 96 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
return FALSE ;
|
|
#line 97 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
#line 100 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
if(en_RenderType == CEntity :: RT_SKAMODEL || en_RenderType == CEntity :: RT_SKAEDITORMODEL ){
|
|
#line 101 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
if(GetModelInstance () != NULL ){
|
|
#line 103 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
GetModelInstance () -> mi_iCurentBBox = iNewCollisionBox ;
|
|
#line 104 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
#line 105 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
#line 107 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
en_iCollisionBox = iNewCollisionBox ;
|
|
#line 108 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
en_iWantedCollisionBox = iNewCollisionBox ;
|
|
#line 111 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
ModelChangeNotify ();
|
|
#line 114 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
return TRUE ;
|
|
#line 115 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
BOOL CMovableModelEntity::ChangeCollisionBoxIndexNow(INDEX iNewCollisionBox)
|
|
#line 119 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
{
|
|
#line 120 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
CEntity * penDummy ;
|
|
#line 121 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
return ChangeCollisionBoxIndexNow (iNewCollisionBox , & penDummy );
|
|
#line 122 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
void CMovableModelEntity::ForceCollisionBoxIndexChange(INDEX iNewCollisionBox)
|
|
#line 126 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
{
|
|
#line 128 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
if(en_RenderType == CEntity :: RT_SKAMODEL || en_RenderType == CEntity :: RT_SKAEDITORMODEL ){
|
|
#line 129 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
if(GetModelInstance () != NULL ){
|
|
#line 131 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
GetModelInstance () -> mi_iCurentBBox = iNewCollisionBox ;
|
|
#line 132 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
#line 133 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
#line 135 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
en_iCollisionBox = iNewCollisionBox ;
|
|
#line 136 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
en_iWantedCollisionBox = iNewCollisionBox ;
|
|
#line 139 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
ModelChangeNotify ();
|
|
#line 140 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
void CMovableModelEntity::ChangeCollisionBoxIndexWhenPossible(INDEX iNewCollisionBox)
|
|
#line 144 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
{
|
|
#line 145 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
en_iWantedCollisionBox = iNewCollisionBox ;
|
|
#line 146 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
void CMovableModelEntity::Read_t(CTStream * istr)
|
|
#line 156 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
{
|
|
#line 157 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
CMovableEntity :: Read_t (istr );
|
|
#line 158 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
void CMovableModelEntity::Write_t(CTStream * ostr)
|
|
#line 161 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
{
|
|
#line 162 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
CMovableEntity :: Write_t (ostr );
|
|
#line 163 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
|
|
#line 166 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
SLONG CMovableModelEntity::GetUsedMemory(void)
|
|
#line 167 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
{
|
|
#line 168 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
return (sizeof (CMovableModelEntity ) - sizeof (CMovableEntity ) + CMovableEntity :: GetUsedMemory ());
|
|
#line 169 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
}
|
|
BOOL CMovableModelEntity::
|
|
#line 176 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
Dummy(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CMovableModelEntity_Dummy
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CMovableModelEntity::Dummy expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput; ASSERT(FALSE); return TRUE;};BOOL CMovableModelEntity::
|
|
#line 179 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
WaitUntilScheduledAnimStarts(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CMovableModelEntity_WaitUntilScheduledAnimStarts
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CMovableModelEntity::WaitUntilScheduledAnimStarts expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 181 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
ASSERT (en_RenderType == CEntity :: RT_MODEL || en_RenderType == CEntity :: RT_EDITORMODEL );
|
|
#line 182 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
FLOAT fToWait = GetModelObject () -> ao_tmAnimStart - _pTimer -> CurrentTick ();
|
|
#line 183 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
if(!(fToWait > 0)){ Jump(STATE_CURRENT,0x00020004, FALSE, EInternal());return TRUE;}
|
|
#line 185 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
SetTimerAfter(fToWait + _pTimer -> TickQuantum );
|
|
Jump(STATE_CURRENT, 0x00020002, FALSE, EBegin());return TRUE;}BOOL CMovableModelEntity::H0x00020002_WaitUntilScheduledAnimStarts_01(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00020002
|
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x00020003, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CMovableModelEntity::H0x00020003_WaitUntilScheduledAnimStarts_02(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00020003
|
|
;Jump(STATE_CURRENT,0x00020004, FALSE, EInternal());return TRUE;}BOOL CMovableModelEntity::H0x00020004_WaitUntilScheduledAnimStarts_03(const CEntityEvent &__eeInput){
|
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT 0x00020004
|
|
|
|
#line 187 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
Return(STATE_CURRENT,EReturn ());
|
|
#line 187 "D:/SE1_GPL/Sources/Engine/Classes/MovableModelEntity.es"
|
|
return TRUE; ASSERT(FALSE); return TRUE;}; |