From e6a84f7143968ac4a8ffa5fa8405d8d986a63951 Mon Sep 17 00:00:00 2001 From: Treeki Date: Wed, 21 Sep 2011 17:17:10 +0200 Subject: renamed state classes, added dEn_c state references --- include/game.h | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) (limited to 'include/game.h') diff --git a/include/game.h b/include/game.h index d16a09f..f7728db 100755 --- a/include/game.h +++ b/include/game.h @@ -1099,7 +1099,7 @@ public: dActorMultiState_c *owner; u32 unkZero; - StateMgr manager; + dStateMgr_c manager; // All these are passed straight through to the manager virtual void _vfC(); @@ -1128,11 +1128,11 @@ public: virtual void _vfC(); // calls vfC on ptrToStateMgr virtual void execute(); // calls vf10 on ptrToStateMgr virtual void _vf14(); // if (isSecondStateMgr()) { disableSecond(); } else { ptrToStateMgr->_vf14(); } - virtual void setState(StateBase *state); // calls vf18 on ptrToStateMgr + virtual void setState(dStateBase_c *state); // calls vf18 on ptrToStateMgr virtual void _vf1C(); // calls vf1C on ptrToStateMgr virtual void _vf20(); // calls vf20 on ptrToStateMgr virtual void _vf24(); // calls vf24 on ptrToStateMgr - virtual StateBase *getCurrentState(); // calls vf28 on ptrToStateMgr + virtual dStateBase_c *getCurrentState(); // calls vf28 on ptrToStateMgr virtual void _vf2C(); // calls vf2C on ptrToStateMgr virtual void enableSecond(); // sets ptrToStateMgr to s2, calls vf18 on it virtual void disableSecond(); // if (isSecondStateMgr()) { ptrToStateMgr->vf14(); ptrToStateMgr = &s1; } @@ -1146,6 +1146,8 @@ public: ~MultiStateMgr(); }; +#define REF_NINTENDO_STATE(NAME) \ + static State StateID_##NAME; #define DECLARE_STATE(NAME) \ static State StateID_##NAME; \ @@ -1161,7 +1163,7 @@ public: &CLASS::endState_##NAME); #define USING_STATES(CLASS) \ - typedef State State; + typedef dState_c State; struct LinkListEntry { @@ -1467,7 +1469,7 @@ public: MultiStateMgr acState; - virtual void doStateChange(StateBase *state); // might return bool? overridden by dEn_c + virtual void doStateChange(dStateBase_c *state); // might return bool? overridden by dEn_c virtual void _vfD8(); // nullsub ?? virtual void _vfDC(); // nullsub ?? virtual void _vfE0(); // nullsub ?? @@ -1519,7 +1521,7 @@ public: void _vfCC(Vec2 *p); void _vfD0(Vec2 *p); - void doStateChange(StateBase *state); // might return bool, dunno + void doStateChange(dStateBase_c *state); // might return bool, dunno // Now here's where the fun starts. @@ -1639,6 +1641,17 @@ public: static void collisionCallback(ActivePhysics::Info *one, ActivePhysics::Info *two); + + // States + USING_STATES(dEn_c); + REF_NINTENDO_STATE(DieFumi); + REF_NINTENDO_STATE(DieFall); + REF_NINTENDO_STATE(DieBigFall); + REF_NINTENDO_STATE(DieSmoke); + REF_NINTENDO_STATE(DieIceVanish); + REF_NINTENDO_STATE(DieYoshiFumi); + REF_NINTENDO_STATE(DieGoal); + REF_NINTENDO_STATE(DieOther); }; @@ -1708,12 +1721,13 @@ public: static void *OPhysicsCallback2; static void *OPhysicsCallback3; - static State StateID_UpMove; - static State StateID_DownMove; - static State StateID_DownMoveEnd; - static State StateID_UpMove_Diff; - static State StateID_DownMove_Diff; - static State StateID_DownMove_DiffEnd; + USING_STATES(daEnBlockMain_c); + REF_NINTENDO_STATE(UpMove); + REF_NINTENDO_STATE(DownMove); + REF_NINTENDO_STATE(DownMoveEnd); + REF_NINTENDO_STATE(UpMove_Diff); + REF_NINTENDO_STATE(DownMove_Diff); + REF_NINTENDO_STATE(DownMove_DiffEnd); ~daEnBlockMain_c(); }; -- cgit v1.2.3