diff options
| author | elijah-thomas774 <elijahthomas774@gmail.com> | 2024-06-09 22:47:44 -0400 |
|---|---|---|
| committer | elijah-thomas774 <elijahthomas774@gmail.com> | 2024-06-09 22:47:44 -0400 |
| commit | 70dbbb1cb11cb9018b2823d7083c9db942ee7725 (patch) | |
| tree | 6101d2f0622fa89d0485e01616ad950339a136ea /include | |
| parent | 5d9ca41e213c91629ebd6ffa9f748d81aac97489 (diff) | |
added macro for declaring state manager (used for annoying dummy funcs)
Diffstat (limited to 'include')
| -rw-r--r-- | include/d/tg/d_t_rock_boat.h | 7 | ||||
| -rw-r--r-- | include/d/tg/d_t_tumble_weed.h | 5 | ||||
| -rw-r--r-- | include/s/s_State.hpp | 16 |
3 files changed, 12 insertions, 16 deletions
diff --git a/include/d/tg/d_t_rock_boat.h b/include/d/tg/d_t_rock_boat.h index 378593b4..28d0d669 100644 --- a/include/d/tg/d_t_rock_boat.h +++ b/include/d/tg/d_t_rock_boat.h @@ -23,14 +23,9 @@ public: STATE_FUNC_DECLARE(dTgRockBoat_c, Wait); private: - - sFStateMgr_c<dTgRockBoat_c, sStateMethodUsr_FI_c> mStateMgr; + STATE_MGR_DECLARE(dTgRockBoat_c); int cooldown; int boatNum; - - void dummy() { - mStateMgr.getStateID(); - } }; #endif diff --git a/include/d/tg/d_t_tumble_weed.h b/include/d/tg/d_t_tumble_weed.h index e3a80dd4..5f8f9ecd 100644 --- a/include/d/tg/d_t_tumble_weed.h +++ b/include/d/tg/d_t_tumble_weed.h @@ -30,11 +30,8 @@ private: bool shouldDoWind(); void doSpawnTumbleweed(); void getWind(mVec3_c *); - void unused() { - mStateMgr.getStateID(); - } - sFStateMgr_c<dTgTumbleWeed_c, sStateMethodUsr_FI_c> mStateMgr; + STATE_MGR_DECLARE(dTgTumbleWeed_c); u16 tumbleweedTimer; u16 padding; u16 windTimer; diff --git a/include/s/s_State.hpp b/include/s/s_State.hpp index 97a5847e..9ec6614a 100644 --- a/include/s/s_State.hpp +++ b/include/s/s_State.hpp @@ -7,15 +7,19 @@ // Note: Ported from https://github.com/NSMBW-Community/NSMBW-Decomp/tree/master/include/dol/sLib // See include/s/README.txt for changes made -#define STATE_FUNC_DECLARE(class, name) void initializeState_##name(); \ +#define STATE_FUNC_DECLARE(class, name) \ + void initializeState_##name(); \ void executeState_##name(); \ void finalizeState_##name(); \ static sFStateID_c<class> StateID_##name -#define STATE_DEFINE(class, name) sFStateID_c<class> class::StateID_##name( \ - #class "::StateID_" #name, \ - &class::initializeState_##name, \ - &class::executeState_##name, \ - &class::finalizeState_##name) +#define STATE_DEFINE(class, name) \ + sFStateID_c<class> class ::StateID_##name(#class "::StateID_" #name, &class ::initializeState_##name, \ + &class ::executeState_##name, &class ::finalizeState_##name) +#define STATE_MGR_DECLARE(class_name) \ + sFStateMgr_c<class_name, sStateMethodUsr_FI_c> mStateMgr; \ + void dummy_GetStateID() { \ + mStateMgr.getStateID(); \ + } #endif |
