mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-23 02:40:26 +01:00
211 lines
12 KiB
C++
211 lines
12 KiB
C++
|
/*
|
||
|
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
|
||
|
*/
|
||
|
|
||
|
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
|
||
|
#include "StdH.h"
|
||
|
|
||
|
#include <EntitiesMP/TimeController.h>
|
||
|
#include <EntitiesMP/TimeController_tables.h>
|
||
|
void CTimeController::SetDefaultProperties(void) {
|
||
|
m_fTimeStretch = 1.0f;
|
||
|
m_tmFadeIn = 0.25f;
|
||
|
m_tmInterval = -1.0f;
|
||
|
m_bAbsolute = TRUE ;
|
||
|
m_fMyTimer = 0.0f;
|
||
|
m_tmStretchChangeStart = 0.0f;
|
||
|
m_strName = "Time controller";
|
||
|
m_fOldTimeStretch = 0.0f;
|
||
|
m_fNewTimeStretch = 0.0f;
|
||
|
CRationalEntity::SetDefaultProperties();
|
||
|
}
|
||
|
BOOL CTimeController::
|
||
|
#line 32 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
ChangeTimeStretch(const CEntityEvent &__eeInput) {
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT STATE_CTimeController_ChangeTimeStretch
|
||
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CTimeController::ChangeTimeStretch expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
||
|
#line 34 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
m_fMyTimer = 0.0f;
|
||
|
#line 35 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
Jump(STATE_CURRENT,0x02650003, FALSE, EInternal());return TRUE;}BOOL CTimeController::H0x02650003_ChangeTimeStretch_03(const CEntityEvent &__eeInput)
|
||
|
#line 36 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
{
|
||
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x02650003
|
||
|
if(!(m_fMyTimer < m_tmFadeIn - _pTimer -> TickQuantum / 2.0f)){ Jump(STATE_CURRENT,0x02650004, FALSE, EInternal());return TRUE;}
|
||
|
#line 37 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
SetTimerAfter(_pTimer -> TickQuantum );
|
||
|
Jump(STATE_CURRENT, 0x02650001, FALSE, EBegin());return TRUE;}BOOL CTimeController::H0x02650001_ChangeTimeStretch_01(const CEntityEvent &__eeInput) {
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x02650001
|
||
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x02650002, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CTimeController::H0x02650002_ChangeTimeStretch_02(const CEntityEvent &__eeInput){
|
||
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x02650002
|
||
|
;
|
||
|
#line 38 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
m_fMyTimer += _pTimer -> TickQuantum / _pNetwork -> GetRealTimeFactor ();
|
||
|
#line 39 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
FLOAT fNewStretch = Lerp (m_fOldTimeStretch , m_fNewTimeStretch , Clamp (m_fMyTimer / m_tmFadeIn , 0.0f , 1.0f));
|
||
|
#line 40 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
_pNetwork -> SetRealTimeFactor (fNewStretch );Jump(STATE_CURRENT,0x02650003, FALSE, EInternal());return TRUE;
|
||
|
#line 41 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
}BOOL CTimeController::H0x02650004_ChangeTimeStretch_04(const CEntityEvent &__eeInput) {
|
||
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x02650004
|
||
|
|
||
|
#line 42 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
_pNetwork -> SetRealTimeFactor (m_fNewTimeStretch );
|
||
|
#line 43 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
Return(STATE_CURRENT,EReturn ());
|
||
|
#line 43 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
return TRUE; ASSERT(FALSE); return TRUE;};BOOL CTimeController::
|
||
|
#line 46 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
ApplyTimeStretch(const CEntityEvent &__eeInput) {
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT STATE_CTimeController_ApplyTimeStretch
|
||
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CTimeController::ApplyTimeStretch expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
||
|
#line 48 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
STATE_CTimeController_ChangeTimeStretch, TRUE;
|
||
|
Jump(STATE_CURRENT, 0x02650006, FALSE, EBegin());return TRUE;}BOOL CTimeController::H0x02650006_ApplyTimeStretch_01(const CEntityEvent &__eeInput) {
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x02650006
|
||
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: Call(STATE_CURRENT, STATE_CTimeController_ChangeTimeStretch, TRUE, EVoid());return TRUE;case EVENTCODE_EReturn: Jump(STATE_CURRENT,0x02650007, FALSE, __eeInput); return TRUE;default: return FALSE; }}BOOL CTimeController::H0x02650007_ApplyTimeStretch_02(const CEntityEvent &__eeInput){
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x02650007
|
||
|
const EReturn&__e= (EReturn&)__eeInput;
|
||
|
;
|
||
|
#line 49 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
if(!(m_tmInterval > 0)){ Jump(STATE_CURRENT,0x0265000c, FALSE, EInternal());return TRUE;}
|
||
|
#line 51 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
SetTimerAfter(m_tmInterval );
|
||
|
Jump(STATE_CURRENT, 0x02650008, FALSE, EBegin());return TRUE;}BOOL CTimeController::H0x02650008_ApplyTimeStretch_03(const CEntityEvent &__eeInput) {
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x02650008
|
||
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x02650009, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CTimeController::H0x02650009_ApplyTimeStretch_04(const CEntityEvent &__eeInput){
|
||
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x02650009
|
||
|
;
|
||
|
#line 52 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
STATE_CTimeController_ResetTimeStretch, TRUE;
|
||
|
Jump(STATE_CURRENT, 0x0265000a, FALSE, EBegin());return TRUE;}BOOL CTimeController::H0x0265000a_ApplyTimeStretch_05(const CEntityEvent &__eeInput) {
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x0265000a
|
||
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: Call(STATE_CURRENT, STATE_CTimeController_ResetTimeStretch, TRUE, EVoid());return TRUE;case EVENTCODE_EReturn: Jump(STATE_CURRENT,0x0265000b, FALSE, __eeInput); return TRUE;default: return FALSE; }}BOOL CTimeController::H0x0265000b_ApplyTimeStretch_06(const CEntityEvent &__eeInput){
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x0265000b
|
||
|
const EReturn&__e= (EReturn&)__eeInput;
|
||
|
;Jump(STATE_CURRENT,0x0265000c, FALSE, EInternal());return TRUE;}BOOL CTimeController::H0x0265000c_ApplyTimeStretch_07(const CEntityEvent &__eeInput){
|
||
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x0265000c
|
||
|
|
||
|
#line 54 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
Return(STATE_CURRENT,EReturn ());
|
||
|
#line 54 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
return TRUE; ASSERT(FALSE); return TRUE;};BOOL CTimeController::
|
||
|
#line 57 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
ResetTimeStretch(const CEntityEvent &__eeInput) {
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT STATE_CTimeController_ResetTimeStretch
|
||
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CTimeController::ResetTimeStretch expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
||
|
#line 59 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
if(_pNetwork -> GetRealTimeFactor () == 1){Return(STATE_CURRENT,EReturn ());return TRUE;};
|
||
|
#line 60 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
m_fOldTimeStretch = _pNetwork -> GetRealTimeFactor ();
|
||
|
#line 61 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
m_fNewTimeStretch = 1.0f;
|
||
|
#line 62 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
STATE_CTimeController_ChangeTimeStretch, TRUE;
|
||
|
Jump(STATE_CURRENT, 0x0265000e, FALSE, EBegin());return TRUE;}BOOL CTimeController::H0x0265000e_ResetTimeStretch_01(const CEntityEvent &__eeInput) {
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x0265000e
|
||
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: Call(STATE_CURRENT, STATE_CTimeController_ChangeTimeStretch, TRUE, EVoid ());return TRUE;case EVENTCODE_EReturn: Jump(STATE_CURRENT,0x0265000f, FALSE, __eeInput); return TRUE;default: return FALSE; }}BOOL CTimeController::H0x0265000f_ResetTimeStretch_02(const CEntityEvent &__eeInput){
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x0265000f
|
||
|
const EReturn&__e= (EReturn&)__eeInput;
|
||
|
;
|
||
|
#line 63 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
Return(STATE_CURRENT,EReturn ());
|
||
|
#line 63 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
return TRUE; ASSERT(FALSE); return TRUE;};BOOL CTimeController::
|
||
|
#line 66 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
Main(const CEntityEvent &__eeInput) {
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT STATE_CTimeController_Main
|
||
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CTimeController::Main expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
||
|
#line 69 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
InitAsEditorModel ();
|
||
|
#line 70 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
SetPhysicsFlags (EPF_MODEL_IMMATERIAL );
|
||
|
#line 71 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
SetCollisionFlags (ECF_IMMATERIAL );
|
||
|
#line 74 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
SetModel (MODEL_TIME_CONTROLLER );
|
||
|
#line 75 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
SetModelMainTexture (TEXTURE_TIME_CONTROLLER );
|
||
|
#line 78 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
SetTimerAfter(0.1f);
|
||
|
Jump(STATE_CURRENT, 0x02650010, FALSE, EBegin());return TRUE;}BOOL CTimeController::H0x02650010_Main_01(const CEntityEvent &__eeInput) {
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x02650010
|
||
|
switch(__eeInput.ee_slEvent) {case EVENTCODE_EBegin: return TRUE;case EVENTCODE_ETimer: Jump(STATE_CURRENT,0x02650011, FALSE, EInternal()); return TRUE;default: return FALSE; }}BOOL CTimeController::H0x02650011_Main_02(const CEntityEvent &__eeInput){
|
||
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x02650011
|
||
|
;
|
||
|
#line 80 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
SetTimerAt(THINKTIME_NEVER);
|
||
|
Jump(STATE_CURRENT, 0x02650012, FALSE, EBegin());return TRUE;}BOOL CTimeController::H0x02650012_Main_03(const CEntityEvent &__eeInput) {
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x02650012
|
||
|
switch(__eeInput.ee_slEvent)
|
||
|
#line 81 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
{case(EVENTCODE_EBegin):
|
||
|
#line 83 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
{const EBegin&e= (EBegin&)__eeInput;
|
||
|
|
||
|
#line 84 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
return TRUE;
|
||
|
#line 85 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
}ASSERT(FALSE);break;case(EVENTCODE_EStart):
|
||
|
#line 88 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
{const EStart&eStart= (EStart&)__eeInput;
|
||
|
|
||
|
#line 89 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
m_fOldTimeStretch = _pNetwork -> GetRealTimeFactor ();
|
||
|
#line 90 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
m_fNewTimeStretch = m_fTimeStretch ;
|
||
|
#line 91 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
Call(STATE_CURRENT, STATE_CTimeController_ApplyTimeStretch, TRUE, EVoid());return TRUE;
|
||
|
#line 92 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
return TRUE;
|
||
|
#line 93 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
}ASSERT(FALSE);break;case(EVENTCODE_EStop):
|
||
|
#line 95 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
{const EStop&e= (EStop&)__eeInput;
|
||
|
|
||
|
#line 96 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
_pNetwork -> SetRealTimeFactor (1.0f);
|
||
|
#line 97 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
return TRUE;
|
||
|
#line 98 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
}ASSERT(FALSE);break;case(EVENTCODE_EReturn):
|
||
|
#line 100 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
{const EReturn&e= (EReturn&)__eeInput;
|
||
|
|
||
|
#line 101 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
return TRUE;
|
||
|
#line 102 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
}ASSERT(FALSE);break;default: return FALSE; break;
|
||
|
#line 103 "D:/SE1_GPL/Sources/EntitiesMP/TimeController.es"
|
||
|
}return TRUE;}BOOL CTimeController::H0x02650013_Main_04(const CEntityEvent &__eeInput){
|
||
|
ASSERT(__eeInput.ee_slEvent==EVENTCODE_EInternal);
|
||
|
#undef STATE_CURRENT
|
||
|
#define STATE_CURRENT 0x02650013
|
||
|
ASSERT(FALSE); return TRUE;};
|