Skip to content

Commit

Permalink
Addressed fakematch
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
marwernerh committed Jan 3, 2025
1 parent cb06efe commit e97902a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
5 changes: 2 additions & 3 deletions include/d/actor/d_a_obj_waterPillar.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 1 addition & 5 deletions include/d/d_bg_s_acch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 4 additions & 5 deletions src/d/actor/d_a_obj_syRock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -541,4 +540,4 @@ extern actor_process_profile_definition g_profile_Obj_SyRock = {
0x00040100, // mStatus
fopAc_ACTOR_e, // mActorType
fopAc_CULLBOX_CUSTOM_e, // cullType
};
};
6 changes: 3 additions & 3 deletions src/d/actor/d_a_obj_waterPillar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -610,4 +610,4 @@ extern actor_process_profile_definition g_profile_Obj_WaterPillar = {
0x00040000, // mStatus
fopAc_ACTOR_e, // mActorType
fopAc_CULLBOX_CUSTOM_e, // cullType
};
};

0 comments on commit e97902a

Please sign in to comment.