From 6c3bb08b774aa3c830aad59d430da2d99bc97a13 Mon Sep 17 00:00:00 2001 From: Kit <129910473+Eclipse32767@users.noreply.github.com> Date: Thu, 8 Feb 2024 03:10:43 +0000 Subject: [PATCH] Documentation, field naming throughout d_a_bomb_static.cpp (#597) * change field 0x6F2 of daBomb_c to mBombFire * add comments to functions involving mBombTimer, rename field 0x738 to mBombTimer * fixes suggested by crain-32 --- include/d/actor/d_a_bomb.h | 2 +- include/d/actor/d_a_bomb2.h | 2 +- src/d/actor/d_a_bomb2.cpp | 16 ++++++++-------- src/d/actor/d_a_bomb3.inc | 4 ++-- src/d/d_a_bomb_static.cpp | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/d/actor/d_a_bomb.h b/include/d/actor/d_a_bomb.h index c41829548..ac4fea914 100644 --- a/include/d/actor/d_a_bomb.h +++ b/include/d/actor/d_a_bomb.h @@ -188,7 +188,7 @@ private: /* 0x6E4 */ daBomb_fuseSparksEcallBack mSparks; /* 0x6F0 */ u8 field_0x6F0; /* 0x6F1 */ u8 field_0x6F1; - /* 0x6F2 */ u8 field_0x6F2; + /* 0x6F2 */ u8 mBombFire; /* 0x6F3 */ u8 field_0x6F3; /* 0x6F4 */ u8 field_0x6F4; /* 0x6F5 */ u8 field_0x6F5; diff --git a/include/d/actor/d_a_bomb2.h b/include/d/actor/d_a_bomb2.h index 625e37b02..097ae7d26 100644 --- a/include/d/actor/d_a_bomb2.h +++ b/include/d/actor/d_a_bomb2.h @@ -197,7 +197,7 @@ namespace daBomb2 { /* 0x6CC */ cXyz field_0x6CC; /* 0x6D8 */ cXyz field_0x6D8; /* 0x6E4 */ Env_c mEnv; - /* 0x738 */ int field_0x738; + /* 0x738 */ int mBombTimer; /* 0x73C */ int field_0x73C; /* 0x740 */ u8 field_0x740; /* 0x741 */ u8 field_0x741; diff --git a/src/d/actor/d_a_bomb2.cpp b/src/d/actor/d_a_bomb2.cpp index f2699cb58..7d5321459 100644 --- a/src/d/actor/d_a_bomb2.cpp +++ b/src/d/actor/d_a_bomb2.cpp @@ -24,7 +24,7 @@ namespace daBomb2 { /* 0x00 */ const char* resName; /* 0x04 */ u32 heapSize; /* 0x08 */ s16 field_0x8; - /* 0x0A */ s16 field_0xA; + /* 0x0A */ s16 field_0xA; // Appears to be the bomb timer cap /* 0x0C */ f32 gravity; /* 0x10 */ f32 maxFallSpeed; /* 0x14 */ f32 field_0x14; @@ -396,7 +396,7 @@ namespace daBomb2 { current.pos = home.pos; init_mtx(); - field_0x738 = attr().field_0x8; + mBombTimer = attr().field_0x8; field_0x740 = 0; field_0x741 = 0; field_0x742 = 0; @@ -618,8 +618,8 @@ namespace daBomb2 { } void Act_c::set_nut_exp_interval() { - if(field_0x738 > attr().field_0xA) { - field_0x738 = attr().field_0xA; + if(mBombTimer > attr().field_0xA) { + mBombTimer = attr().field_0xA; f32 frame = 0x87 - attr().field_0xA; mBck0.getFrameCtrl()->setFrame(frame); @@ -628,7 +628,7 @@ namespace daBomb2 { } void Act_c::anm_play() { - if(field_0x738 + 1 <= 0x87) { + if(mBombTimer + 1 <= 0x87) { mBck0.play(); mBrk0.play(); } @@ -844,7 +844,7 @@ namespace daBomb2 { } bool Act_c::chk_exp_cc() { - if(field_0x738 > 0) { + if(mBombTimer > 0) { return chk_exp_cc_nut(); } @@ -885,7 +885,7 @@ namespace daBomb2 { bool Act_c::chk_exp_timer() { bool ret = false; - if(field_0x738 > 0 && --field_0x738 == 0) { + if(mBombTimer > 0 && --mBombTimer == 0) { eff_explode(); ret = true; } @@ -1066,7 +1066,7 @@ namespace daBomb2 { mSph.OffCoSPrmBit(CO_SPRM_SET); mSph.OnAtSPrmBit(AT_SPRM_SET); fopAcM_cancelCarryNow(this); - field_0x738 = 0; + mBombTimer = 0; field_0x73C = 4; dComIfGp_getVibration().StartShock(7, -0x21, cXyz(0.0f, 1.0f, 0.0f)); } diff --git a/src/d/actor/d_a_bomb3.inc b/src/d/actor/d_a_bomb3.inc index 403d90b68..a83527b4a 100644 --- a/src/d/actor/d_a_bomb3.inc +++ b/src/d/actor/d_a_bomb3.inc @@ -1026,9 +1026,9 @@ void daBomb_c::waitState_bomtyu() { cLib_chaseF(&mScale.x, 1.0f, 0.05f); cLib_chaseF(&mScale.y, 1.0f, 0.05f); cLib_chaseF(&mScale.z, 1.0f, 0.05f); - if(field_0x6F2) { + if(mBombFire) { setFuseEffect(); - field_0x6F2 = 0; + mBombFire = 0; field_0x6F4 = 1; change_state(STATE_1); } diff --git a/src/d/d_a_bomb_static.cpp b/src/d/d_a_bomb_static.cpp index 8681af84a..724290ea9 100644 --- a/src/d/d_a_bomb_static.cpp +++ b/src/d/d_a_bomb_static.cpp @@ -34,7 +34,7 @@ void daBomb_c::setBombCheck_Flag() { void daBomb_c::setBombFire_ON() { _prm_chk_version(); - field_0x6F2 = true; + mBombFire = true; } /* 80068068-800680CC .text setBombNoHit__8daBomb_cFv */ @@ -158,12 +158,12 @@ void daBomb2::Act_c::remove_fuse_effect() { /* 80068488-80068490 .text set_time__Q27daBomb25Act_cFi */ void daBomb2::Act_c::set_time(int time) { - field_0x738 = time; + mBombTimer = time; } /* 80068490-80068498 .text get_time__Q27daBomb25Act_cCFv */ int daBomb2::Act_c::get_time() const { - return field_0x738; + return mBombTimer; } /* 80068498-800684A0 .text chk_eat__Q27daBomb25Act_cCFv */