diff --git a/include/JSystem/J3DGraphBase/J3DMatBlock.h b/include/JSystem/J3DGraphBase/J3DMatBlock.h index 019609e47..808c8b5c6 100644 --- a/include/JSystem/J3DGraphBase/J3DMatBlock.h +++ b/include/JSystem/J3DGraphBase/J3DMatBlock.h @@ -626,6 +626,7 @@ struct J3DFog : public J3DFogInfo { // J3DFog() { *getFogInfo() = j3dDefaultFogInfo; } // Produces the wrong codegen for mDoExt_backupMatBlock_c's constructor J3DFog() { J3DFogInfo::operator=(j3dDefaultFogInfo); } explicit J3DFog(const J3DFogInfo& info) { J3DFogInfo::operator=(info); } + ~J3DFog() {} J3DFogInfo* getFogInfo() { return (J3DFogInfo*)this; } void load() const { diff --git a/include/d/actor/d_a_tbox.h b/include/d/actor/d_a_tbox.h index 353a8441f..400115ebf 100644 --- a/include/d/actor/d_a_tbox.h +++ b/include/d/actor/d_a_tbox.h @@ -2,6 +2,7 @@ #define D_A_TBOX_H #include "f_op/f_op_actor.h" +#include "d/d_com_inf_game.h" #include "d/d_cc_d.h" #include "SSystem/SComponent/c_phase.h" #include "d/d_bg_w.h" @@ -41,7 +42,12 @@ public: request_of_phase_process_class* getPhase() { return &mPhase; } bool action() { return (this->*mActionFunc)(); } void setAction(ActionFunc func) { mActionFunc = func; } - void deleteProc() {} // Maybe only used in the demo + void deleteProc() { + if (mpBgWCurrent != NULL) { + dComIfG_Bgsp()->Release(mpBgWCurrent); + } + mSmokeCB.remove(); + } inline BOOL draw(); BOOL execute(); diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h index 56a5bb268..2ac32e5b6 100644 --- a/include/d/d_drawlist.h +++ b/include/d/d_drawlist.h @@ -238,7 +238,7 @@ public: void setScissor(f32, f32, f32, f32); view_port_class* getViewPort() { return &mViewport; } - s8 getCameraID() { return mCameraID; } + int getCameraID() { return mCameraID; } void setCameraID(int id) { mCameraID = id; } void setMode(int mode) { mMode = mode; } diff --git a/src/d/actor/d_a_fganon.cpp b/src/d/actor/d_a_fganon.cpp index 325269c39..57c6bfe92 100644 --- a/src/d/actor/d_a_fganon.cpp +++ b/src/d/actor/d_a_fganon.cpp @@ -1924,7 +1924,7 @@ void demo_camera(fganon_class* i_this) { player->changeOriginalDemo(); - camera2 = g_dComIfG_gameInfo.play.mCameraInfo[0].mpCamera; + camera2 = dComIfGp_getCamera(0); i_this->mB5C = camera2->mLookat.mEye; i_this->mB68 = camera2->mLookat.mCenter; @@ -2497,7 +2497,7 @@ static BOOL daFganon_Execute(fganon_class* i_this) { i_this->m684 = 0; i_this->mWeponSph.SetC(local_84); } - g_dComIfG_gameInfo.play.mCcS.Set(&i_this->mWeponSph); + dComIfG_Ccsp()->Set(&i_this->mWeponSph); i_this->m686 = 0; mant_class* cape = (mant_class*)fopAcM_SearchByID(i_this->mCapeID); if (cape != NULL) { diff --git a/src/d/actor/d_a_ship.cpp b/src/d/actor/d_a_ship.cpp index c0f04ab45..669d20bcb 100644 --- a/src/d/actor/d_a_ship.cpp +++ b/src/d/actor/d_a_ship.cpp @@ -1849,7 +1849,6 @@ BOOL daShip_c::procCrane() { return TRUE; } setControllAngle(0); - dComIfG_play_c* play = &g_dComIfG_gameInfo.play; if (!dComIfGp_event_runCheck() && !daPy_getPlayerLinkActorClass()->checkNoControll()) { if (m0398 == m039A) { if(std::fabsf(speedF) < 3.0f && @@ -1867,8 +1866,7 @@ BOOL daShip_c::procCrane() { setControllAngle(-0xA00); } if (m0353 && (sVar1 != mCurrentRopeSegmentIndex)) { - //dComIfGp_getVibration().StartShock(5, -0x31, cXyz(0.0f, 1.0f, 0.0f)); - play->getVibration().StartShock(5, -0x31, cXyz(0.0f, 1.0f, 0.0f)); //Fakematch + dComIfGp_getVibration().StartShock(5, -0x31, cXyz(0.0f, 1.0f, 0.0f)); } } else if (m039A > 0) { diff --git a/src/d/actor/d_a_tbox.cpp b/src/d/actor/d_a_tbox.cpp index f3724727f..437f97be1 100644 --- a/src/d/actor/d_a_tbox.cpp +++ b/src/d/actor/d_a_tbox.cpp @@ -1233,11 +1233,7 @@ static s32 daTbox_IsDelete(daTbox_c*) { /* 00002FD8-00003070 .text daTbox_Delete__FP8daTbox_c */ static s32 daTbox_Delete(daTbox_c* i_tbox) { - if (i_tbox->mpBgWCurrent != NULL) { - dComIfG_Bgsp()->Release(i_tbox->mpBgWCurrent); - } - - i_tbox->mSmokeCB.end(); + i_tbox->deleteProc(); dComIfG_resDelete(i_tbox->getPhase(), "Dalways"); if (l_HIO.mNo >= 0) { @@ -1265,11 +1261,10 @@ static cPhs_State daTbox_Create(fopAc_ac_c* i_actor) { }; daTbox_c* tbox = static_cast(i_actor); - s32 result; fopAcM_SetupActor(tbox, daTbox_c); - result = dComIfG_resLoad(tbox->getPhase(), "Dalways"); + cPhs_State result = dComIfG_resLoad(tbox->getPhase(), "Dalways"); if (result == cPhs_COMPLEATE_e) { tbox->mRoomNo = tbox->home.angle.x & 0x3F;