diff --git a/include/d/actor/d_a_obj_akabe.h b/include/d/actor/d_a_obj_akabe.h index 73a234a97..dd3c0948c 100644 --- a/include/d/actor/d_a_obj_akabe.h +++ b/include/d/actor/d_a_obj_akabe.h @@ -29,7 +29,7 @@ namespace daObjAkabe { s32 prm_get_arg0() const { return daObj::PrmAbstract(this, PRM_ARG0_W, PRM_ARG0_S); } s32 _create(); - BOOL create_heap(); + u8 create_heap(); bool _delete(); void init_scale(); void init_mtx(); diff --git a/include/d/actor/d_a_obj_swheavy.h b/include/d/actor/d_a_obj_swheavy.h index 04e5ee21d..c96a9a51b 100644 --- a/include/d/actor/d_a_obj_swheavy.h +++ b/include/d/actor/d_a_obj_swheavy.h @@ -43,7 +43,7 @@ namespace daObjSwheavy { void rev_switch() const { fopAcM_revSwitch(const_cast(this), prm_get_swSave()); } static BOOL solidHeapCB(fopAc_ac_c*); - BOOL create_heap(); + u8 create_heap(); s32 _create(); bool _delete(); void set_mtx(); diff --git a/src/d/actor/d_a_obj_akabe.cpp b/src/d/actor/d_a_obj_akabe.cpp index 61cd20316..a5a63ec92 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 7b776e7be..06c0ea9ff 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(i_this)->create_heap() & 0xFF; // Fakematch? + return static_cast(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; }