From e97902a5595f2a2f40145916ac42501828e96633 Mon Sep 17 00:00:00 2001 From: marwernerh Date: Fri, 3 Jan 2025 13:05:06 -0500 Subject: [PATCH] Addressed fakematch * Deleted fake Chk inlines from dBgS_Acch * Removed duplicated, but commented, static check for struct size * Renamed two d_a_obj_waterPillar fields according to comments --- include/d/actor/d_a_obj_waterPillar.h | 5 ++--- include/d/d_bg_s_acch.h | 6 +----- src/d/actor/d_a_obj_syRock.cpp | 9 ++++----- src/d/actor/d_a_obj_waterPillar.cpp | 6 +++--- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/include/d/actor/d_a_obj_waterPillar.h b/include/d/actor/d_a_obj_waterPillar.h index 5c5e56063bc..af54ca5c797 100644 --- a/include/d/actor/d_a_obj_waterPillar.h +++ b/include/d/actor/d_a_obj_waterPillar.h @@ -89,9 +89,9 @@ class daWtPillar_c : public fopAc_ac_c, public fakeWtPillarPadding, public dEvLi /* 0x818 */ dCcD_Cps mCapsuleCollider; /* 0x95C */ dCcD_Cyl mCylinderCollider; /* 0xA98 */ u8 pad0[0x3C]; - /* 0xAD4 */ f32 field_0xAD4; // mScaleX (Modified but never read; unused?) + /* 0xAD4 */ f32 mScaleX; // Modified but never read; unused? /* 0xAD8 */ u8 pad1[0x4]; - /* 0xADC */ f32 field_0xADC; // mScaleZ (Modified but never read; unused?) + /* 0xADC */ f32 mScaleZ; // Modified but never read; unused? /* 0xAE0 */ f32 mCurrentHeight; /* 0xAE4 */ cM3dGCpsS mCapsuleSource; /* 0xB00 */ u8 mAction; @@ -145,7 +145,6 @@ class daWtPillar_c : public fopAc_ac_c, public fakeWtPillarPadding, public dEvLi }; -//STATIC_ASSERT(sizeof(daWtPillar_c) == 0xb7c); STATIC_ASSERT(sizeof(daWtPillar_c) == 0xb7c); struct daWtPillar_HIO_c : public mDoHIO_entry_c { diff --git a/include/d/d_bg_s_acch.h b/include/d/d_bg_s_acch.h index dc0f2ca8314..512a3c9b629 100644 --- a/include/d/d_bg_s_acch.h +++ b/include/d/d_bg_s_acch.h @@ -194,11 +194,7 @@ class dBgS_Acch : public cBgS_Chk, public dBgS_Chk { // inline dupe void i_ClrGroundHit() { m_flags &= ~GROUND_HIT; } u32 i_ChkGroundHit() const { return m_flags & GROUND_HIT; } - - // fake inlines - const u32 i_ChkGroundHit_fake() const { return i_ChkGroundHit() ? TRUE : FALSE; } - const u32 i_ChkWaterHit_fake() { return MaskWaterHit() ? TRUE : FALSE; } - const u32 i_ChkWaterIn_fake() { return MaskWaterIn() ? TRUE : FALSE; } + public: /* 0x02C */ u32 m_flags; /* 0x030 */ cXyz* pm_pos; diff --git a/src/d/actor/d_a_obj_syRock.cpp b/src/d/actor/d_a_obj_syRock.cpp index a707999c1f9..d5eaa3b3015 100644 --- a/src/d/actor/d_a_obj_syRock.cpp +++ b/src/d/actor/d_a_obj_syRock.cpp @@ -401,10 +401,9 @@ BOOL daSyRock_c::chkWaterLineIn() { /* 80D036DC-80D03984 00151C 02A8+00 2/2 0/0 0/0 .text bgCheck__10daSyRock_cFv */ void daSyRock_c::bgCheck() { // Note stack ordering issues arise if fopAcM_seStartCurrent() is used instead of mDoAud_seStart() - // TODO: Fakematch, fake inlines are used to make check functions return u32 - const u32 hitGround = mAcch.i_ChkGroundHit_fake(); - const u32 hitWater = mAcch.i_ChkWaterHit_fake(); - const u32 inWater = mAcch.i_ChkWaterIn_fake(); + const u32 hitGround = mAcch.ChkGroundHit() ? TRUE : FALSE; + const u32 hitWater = mAcch.ChkWaterHit() ? TRUE : FALSE; + const u32 inWater = mAcch.ChkWaterIn() ? TRUE : FALSE; bool inWaterPillar = false; if(mMode == MODE_DROP) { @@ -541,4 +540,4 @@ extern actor_process_profile_definition g_profile_Obj_SyRock = { 0x00040100, // mStatus fopAc_ACTOR_e, // mActorType fopAc_CULLBOX_CUSTOM_e, // cullType -}; \ No newline at end of file +}; diff --git a/src/d/actor/d_a_obj_waterPillar.cpp b/src/d/actor/d_a_obj_waterPillar.cpp index 4217e5e5900..da7598471ea 100644 --- a/src/d/actor/d_a_obj_waterPillar.cpp +++ b/src/d/actor/d_a_obj_waterPillar.cpp @@ -201,8 +201,8 @@ int daWtPillar_c::execute() { effectSet(); effectSet2(); - field_0xAD4 = scale.x; - field_0xADC = scale.z; + mScaleX = scale.x; + mScaleZ = scale.z; cXyz currentHeightVector(0.0f, 1.0f, 0.0f); currentHeightVector.y *= mCurrentHeight; @@ -610,4 +610,4 @@ extern actor_process_profile_definition g_profile_Obj_WaterPillar = { 0x00040000, // mStatus fopAc_ACTOR_e, // mActorType fopAc_CULLBOX_CUSTOM_e, // cullType -}; \ No newline at end of file +};