diff options
| author | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-03-17 19:49:14 -0400 |
|---|---|---|
| committer | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-03-17 19:49:14 -0400 |
| commit | 455ff4a5717c39b8d2fae08528eace46b7dc6d38 (patch) | |
| tree | 701dcdfbfd99c4d61187f4470cc90ebea21ccd53 /src/d | |
| parent | 20317a1942556e72670fff9a25dab64fc51f3ecc (diff) | |
akabe/swheavy create_heap: Found a slightly cleaner fakematch
Diffstat (limited to 'src/d')
| -rw-r--r-- | src/d/actor/d_a_obj_akabe.cpp | 25 | ||||
| -rw-r--r-- | src/d/actor/d_a_obj_swheavy.cpp | 6 |
2 files changed, 16 insertions, 15 deletions
diff --git a/src/d/actor/d_a_obj_akabe.cpp b/src/d/actor/d_a_obj_akabe.cpp index 61cd2031..a5a63ec9 100644 --- a/src/d/actor/d_a_obj_akabe.cpp +++ b/src/d/actor/d_a_obj_akabe.cpp @@ -8,9 +8,6 @@ #include "d/res/res_akabed.h" #include "d/res/res_akabek.h" #include "d/res/res_nbox.h" -#include "d/d_item.h" -#include "d/d_item_data.h" -#include "d/d_cc_d.h" #include "d/d_procname.h" #include "d/d_com_inf_game.h" #include "m_Do/m_Do_mtx.h" @@ -25,12 +22,12 @@ namespace daObjAkabe { /* 00000078-0000009C .text solidHeapCB__Q210daObjAkabe5Act_cFP10fopAc_ac_c */ BOOL Act_c::solidHeapCB(fopAc_ac_c* i_this) { - return ((Act_c*)i_this)->create_heap() & 0xFF; // Fakematch (see comment in create_heap) + return ((Act_c*)i_this)->create_heap(); } /* 0000009C-000001A4 .text create_heap__Q210daObjAkabe5Act_cFv */ - BOOL Act_c::create_heap() { - bool rt = false; + u8 Act_c::create_heap() { + bool ret = false; mpBgW = new dBgW(); if (mpBgW != NULL) { @@ -38,15 +35,16 @@ namespace daObjAkabe { cBgD_t * bgw_data = (cBgD_t*)dComIfG_getObjectRes(M_arcname[mType], dzb[mType]); JUT_ASSERT(0x82, bgw_data != NULL); if (!mpBgW->Set(bgw_data, cBgW::MOVE_BG_e, &mMtx)) - rt = true; + ret = true; } - // Fakematch: create_heap should have return type bool based on the clrlwi in solidHeapCB, - // but this part doesn't match unless the return variable and the return type are both BOOL. - BOOL ret = rt; - if (!rt) + if (!ret) { mpBgW = NULL; + return ret; + } + // Fakematch? This function should probably have return type bool, but the codegen towards the + // end here doesn't work unless the return type is u8. return ret; } @@ -96,8 +94,9 @@ namespace daObjAkabe { /* 00000360-000003F8 .text _delete__Q210daObjAkabe5Act_cFv */ bool Act_c::_delete() { if (mbAppear) { - if (mpBgW != NULL && mpBgW->ChkUsed()) - dComIfG_Bgsp()->Release(mpBgW); + if (mpBgW != NULL && mpBgW->ChkUsed()) { + dComIfG_Bgsp()->Release(mpBgW); + } dComIfG_resDelete(&mPhs, M_arcname[mType]); } diff --git a/src/d/actor/d_a_obj_swheavy.cpp b/src/d/actor/d_a_obj_swheavy.cpp index 7b776e7b..06c0ea9f 100644 --- a/src/d/actor/d_a_obj_swheavy.cpp +++ b/src/d/actor/d_a_obj_swheavy.cpp @@ -57,11 +57,11 @@ const daObjSwheavy::Attr_c daObjSwheavy::Act_c::M_attr[4] = { /* 00000078-0000009C .text solidHeapCB__Q212daObjSwheavy5Act_cFP10fopAc_ac_c */ BOOL daObjSwheavy::Act_c::solidHeapCB(fopAc_ac_c* i_this) { - return static_cast<daObjSwheavy::Act_c*>(i_this)->create_heap() & 0xFF; // Fakematch? + return static_cast<daObjSwheavy::Act_c*>(i_this)->create_heap(); } /* 0000009C-0000032C .text create_heap__Q212daObjSwheavy5Act_cFv */ -BOOL daObjSwheavy::Act_c::create_heap() { +u8 daObjSwheavy::Act_c::create_heap() { J3DModelData* mdl_1_data = (J3DModelData*) dComIfG_getObjectRes(M_arcname, HHBOT_BDL_HHBOT1); JUT_ASSERT(0x116, mdl_1_data != NULL); mpModel1 = mDoExt_J3DModel__create(mdl_1_data, 0x80000, 0x11000022); @@ -99,6 +99,8 @@ BOOL daObjSwheavy::Act_c::create_heap() { mpBgW1 = NULL; mpBgW2 = NULL; } + // Fakematch? This function should probably have return type bool, but the codegen towards the + // end here doesn't work unless the return type is u8. return success; } |
