diff --git a/include/JAZelAudio/JAIZelBasic.h b/include/JAZelAudio/JAIZelBasic.h index 4857222c7..2a0197aed 100644 --- a/include/JAZelAudio/JAIZelBasic.h +++ b/include/JAZelAudio/JAIZelBasic.h @@ -352,7 +352,7 @@ public: /* 0x1F4C */ struct { int field_0x00; int field_0x04; - } field_0x1f4c[0x1E]; + } field_0x1f4c[0x1E]; /* 0x203C */ u8 field_0x203c; /* 0x203D */ u8 field_0x203d; /* 0x2040 */ int field_0x2040[4]; diff --git a/include/d/actor/d_a_shutter2.h b/include/d/actor/d_a_shutter2.h index 63d3ec240..1a5149a32 100644 --- a/include/d/actor/d_a_shutter2.h +++ b/include/d/actor/d_a_shutter2.h @@ -36,7 +36,7 @@ public: /* 0x2C8 */ request_of_phase_process_class mPhs; /* 0x2D0 */ J3DModel* mpModel; /* 0x2D4 */ Mtx mMtx; - /* 0x304 */ s32 mActionIndex; + /* 0x304 */ s32 mDemoState; /* 0x308 */ s32 mSwitchNo; /* 0x30C */ s32 m30C; /* 0x310 */ s32 mStaffId; diff --git a/include/d/actor/d_a_tag_island.h b/include/d/actor/d_a_tag_island.h index 0a2033eb2..7541c9354 100644 --- a/include/d/actor/d_a_tag_island.h +++ b/include/d/actor/d_a_tag_island.h @@ -7,6 +7,12 @@ class msg_class; class daTag_Island_c : public fopAc_ac_c { public: + enum { + daTagIsl_UNK_01 = 0x01, + daTagIsl_UNK_02 = 0x02, + daTagIsl_UNK_04 = 0x04, + }; + bool chkFlag(u16 flag) { return (mFlag & flag) == flag; } void clrFlag(u16 flag) { mFlag &= ~flag; } void setFlag(u16 flag) { mFlag |= flag; } @@ -14,7 +20,7 @@ public: inline s32 create(); inline BOOL draw(); inline BOOL execute(); - void setActio(u8 v) { mAction = v; } + void setActio(u8 action) { mAction = action; } u8 getEventNo(); u8 getSwbit(); diff --git a/include/d/actor/d_a_tbox.h b/include/d/actor/d_a_tbox.h index 7d959502f..1be096e9b 100644 --- a/include/d/actor/d_a_tbox.h +++ b/include/d/actor/d_a_tbox.h @@ -25,8 +25,8 @@ public: daTboxFlg_UNK_02 = 0x02, daTboxFlg_UNK_04 = 0x04, daTboxFlg_UNK_08 = 0x08, - daTboxFlg_UNK_10 = 0x10, - daTboxFlg_UNK_20 = 0x20, + daTboxFlg_OPENING_e = 0x10, + daTboxFlg_APPEARING_e = 0x20, }; typedef BOOL (daTbox_c::*ActionFunc)(); @@ -113,7 +113,7 @@ public: /* 0x3C4 */ dPa_smokeEcallBack mSmokeCB; /* 0x3E4 */ JPABaseEmitter* mSmokeEmitter; /* 0x3E8 */ f32 mAllColRatio; - /* 0x3EC */ f32 m03EC; + /* 0x3EC */ f32 mAppearingYOffset; /* 0x3F0 */ u16 mFlags; /* 0x3F2 */ u16 mOpenTimer; /* 0x3F4 */ bool mHasOpenAnmFinished; diff --git a/include/d/d_gameover.h b/include/d/d_gameover.h index 6f6165195..5dc01a484 100644 --- a/include/d/d_gameover.h +++ b/include/d/d_gameover.h @@ -5,7 +5,6 @@ #include "d/d_menu_save.h" #include "f_op/f_op_msg_mng.h" #include "JSystem/JKernel/JKRExpHeap.h" -#include "JSystem/J2DGraph/J2DPane.h" #include "JSystem/J2DGraph/J2DScreen.h" #include "SSystem/SComponent/c_phase.h" diff --git a/src/d/actor/d_a_agbsw0.cpp b/src/d/actor/d_a_agbsw0.cpp index 9dabafa10..dfb6ae648 100644 --- a/src/d/actor/d_a_agbsw0.cpp +++ b/src/d/actor/d_a_agbsw0.cpp @@ -1623,7 +1623,7 @@ BOOL daAgbsw0_c::ExeSubFA() { if(field_0x298 == 1) { if(mDoGaC_GbaLink()) { if(!mDoGac_SendStatusCheck(5)) { - return true; + return true; } @@ -1737,7 +1737,7 @@ BOOL daAgbsw0_c::MoveCheck(s16 conditionNo) { case 5: { daGhostship_c* gship = (daGhostship_c*)fopAcM_searchFromName("Ayush", 0, 0); if(gship && gship->checkInShip()) { - return FALSE; + return FALSE; } break; @@ -2206,13 +2206,13 @@ BOOL daAgbsw0_c::MoveCheck(s16 conditionNo) { break; case 0x50: if(daNpc_Md_c::isPlayerRoom()) { - return FALSE; + return FALSE; } break; case 0x51: if(!daNpc_Md_c::isPlayerRoom()) { - return FALSE; + return FALSE; } break; @@ -2230,13 +2230,13 @@ BOOL daAgbsw0_c::MoveCheck(s16 conditionNo) { break; case 0x54: if(daNpc_Cb1_c::isPlayerRoom()) { - return FALSE; + return FALSE; } break; case 0x55: if(!daNpc_Cb1_c::isPlayerRoom()) { - return FALSE; + return FALSE; } break; @@ -2448,13 +2448,13 @@ BOOL daAgbsw0_c::MoveCheck(s16 conditionNo) { break; case 0x77: if(daPy_dmEcallBack_c::checkCurse()) { - return FALSE; + return FALSE; } break; case 0x78: if(!daPy_dmEcallBack_c::checkCurse()) { - return FALSE; + return FALSE; } break; diff --git a/src/d/actor/d_a_npc_ji1.cpp b/src/d/actor/d_a_npc_ji1.cpp index a1393e993..5615230a9 100644 --- a/src/d/actor/d_a_npc_ji1.cpp +++ b/src/d/actor/d_a_npc_ji1.cpp @@ -3138,7 +3138,7 @@ s32 daNpc_Ji1_c::_create() { s32 state = dComIfG_resLoad(&field_0xC7C, "Ji"); if(state == cPhs_COMPLEATE_e) { if(!fopAcM_entrySolidHeap(this, &CheckCreateHeap, 0x16840)) { - return cPhs_ERROR_e; + return cPhs_ERROR_e; } CreateInit(); diff --git a/src/d/actor/d_a_player_particle.inc b/src/d/actor/d_a_player_particle.inc index 6149d11ee..c6387c33b 100644 --- a/src/d/actor/d_a_player_particle.inc +++ b/src/d/actor/d_a_player_particle.inc @@ -830,12 +830,12 @@ void daPy_lk_c::setFootEffectType(int param_0, cXyz* i_pos, int param_2, int par } if (param_0 == -2) { - emitter = dComIfGp_particle_setP1(0x2022, &footEffect->getPos(), &footEffect->getAngle(), (cXyz*)&smoke_scale, (u8)daPy_HIO_basic_c0::m.field_0x2, footEffect->getSmokeCallBack(), fopAcM_GetRoomNo(this)); + emitter = dComIfGp_particle_setP1(0x2022, &footEffect->getPos(), &footEffect->getAngle(), (cXyz*)&smoke_scale, (u8)daPy_HIO_basic_c0::m.field_0x2, footEffect->getSmokeCallBack(), fopAcM_GetRoomNo(this)); } else if (param_0 == 0x2022 || param_0 == 0x2027) { - emitter = dComIfGp_particle_setToonP1((u16)param_0, &footEffect->getPos(), &footEffect->getAngle(), (cXyz*)&smoke_scale, (u8)daPy_HIO_basic_c0::m.field_0x2, footEffect->getSmokeCallBack(), fopAcM_GetRoomNo(this)); + emitter = dComIfGp_particle_setToonP1((u16)param_0, &footEffect->getPos(), &footEffect->getAngle(), (cXyz*)&smoke_scale, (u8)daPy_HIO_basic_c0::m.field_0x2, footEffect->getSmokeCallBack(), fopAcM_GetRoomNo(this)); } else if (param_0 == 0x24) { - GXColor color = {tevStr.mColorC0.r, tevStr.mColorC0.g, tevStr.mColorC0.b, tevStr.mColorC0.a}; - emitter = dComIfGp_particle_setP1((u16)param_0, &footEffect->getPos(), &footEffect->getAngle(), (cXyz*)&grass_scale, 0xFF, footEffect->getOtherCallBack(), -1, &color, &tevStr.mColorK0); + GXColor color = {tevStr.mColorC0.r, tevStr.mColorC0.g, tevStr.mColorC0.b, tevStr.mColorC0.a}; + emitter = dComIfGp_particle_setP1((u16)param_0, &footEffect->getPos(), &footEffect->getAngle(), (cXyz*)&grass_scale, 0xFF, footEffect->getOtherCallBack(), -1, &color, &tevStr.mColorK0); } else { GXColor amb, dif; dKy_get_seacolor(&amb, &dif); diff --git a/src/d/actor/d_a_shutter.cpp b/src/d/actor/d_a_shutter.cpp index 321cba9b4..d823202a8 100644 --- a/src/d/actor/d_a_shutter.cpp +++ b/src/d/actor/d_a_shutter.cpp @@ -53,7 +53,7 @@ BOOL daShutter_c::CreateHeap() { mdBgW[i] = new dBgW(); if (mdBgW[i]) { cBgD_t* pData = (cBgD_t *)dComIfG_getObjectRes(m_arcname[mType], m_dzbidx[mType]); - if (mdBgW[i]->Set(pData, 0x1, &mMtx[i]) == 1) { + if (mdBgW[i]->Set(pData, cBgW::MOVE_BG_e, &mMtx[i]) == true) { return FALSE; } } @@ -172,7 +172,7 @@ void daShutter_c::shutter_move() { } case ACT_WAIT02: { - if (!cLib_calcTimer(&mTimer)) { + if (cLib_calcTimer(&mTimer) == 0) { field_0x339 = 0; dComIfGp_evmng_cutEnd(mStaffId); } diff --git a/src/d/actor/d_a_shutter2.cpp b/src/d/actor/d_a_shutter2.cpp index 5b711eec7..d25ec3c8d 100644 --- a/src/d/actor/d_a_shutter2.cpp +++ b/src/d/actor/d_a_shutter2.cpp @@ -163,32 +163,32 @@ void daShutter2_c::shutter_move() { void daShutter2_c::demo() { u8 isSwitch = fopAcM_isSwitch(this, mSwitchNo); u8 isNearEnemy = fopAcM_myRoomSearchEnemy(fopAcM_GetRoomNo(this)) == NULL; - if (mActionIndex == 0) { + if (mDemoState == 0) { if (mSwitchNo != 0xFF) { - if (isSwitch != (u8)mbIsSwitch) { + if (isSwitch != mbIsSwitch) { if (!isSwitch) { - mActionIndex = 2; + mDemoState = 2; } else { - mActionIndex = 1; + mDemoState = 1; } } } else if (isNearEnemy != mbIsNearEnemy) { if (!isNearEnemy) { - mActionIndex = 2; + mDemoState = 2; } else { - mActionIndex = 1; + mDemoState = 1; } } } if (eventInfo.checkCommandDemoAccrpt()) { - if (dComIfGp_evmng_startCheck(mOpenEventIdx) && (mActionIndex == 1)) { - mActionIndex = 0; + if (dComIfGp_evmng_startCheck(mOpenEventIdx) && (mDemoState == 1)) { + mDemoState = 0; } - if (dComIfGp_evmng_startCheck(mCloseEventIdx) && (mActionIndex == 2)) { - mActionIndex = 0; + if (dComIfGp_evmng_startCheck(mCloseEventIdx) && (mDemoState == 2)) { + mDemoState = 0; } if (dComIfGp_evmng_endCheck(mOpenEventIdx) || dComIfGp_evmng_endCheck(mCloseEventIdx)) { dComIfGp_event_reset(); @@ -196,11 +196,11 @@ void daShutter2_c::demo() { mStaffId = dComIfGp_evmng_getMyStaffId(m_staff_name[mType], NULL, 0); shutter_move(); } - else if ((mActionIndex == 1) && (mOpenEventIdx != 0)) { + else if ((mDemoState == 1) && (mOpenEventIdx != 0)) { fopAcM_orderOtherEventId(this, mOpenEventIdx); eventInfo.onCondition(dEvtCnd_UNK2_e); } - else if ((mActionIndex == 2) && (mCloseEventIdx != 0)) { + else if ((mDemoState == 2) && (mCloseEventIdx != 0)) { fopAcM_orderOtherEventId(this, mCloseEventIdx); eventInfo.onCondition(dEvtCnd_UNK2_e); } diff --git a/src/d/actor/d_a_steam_tag.cpp b/src/d/actor/d_a_steam_tag.cpp index 9da4a0603..6567ec5b8 100644 --- a/src/d/actor/d_a_steam_tag.cpp +++ b/src/d/actor/d_a_steam_tag.cpp @@ -4,7 +4,6 @@ // #include "d/actor/d_a_steam_tag.h" -#include "JSystem/J3DGraphBase/J3DSys.h" #include "JSystem/JParticle/JPAEmitter.h" #include "d/d_cc_d.h" #include "d/d_com_inf_game.h" @@ -190,8 +189,8 @@ static BOOL daSteamTag_Delete(daSteamTag_c* i_this) { daSteamTag_c::~daSteamTag_c() { if (mpEmitter != NULL) { - mpEmitter->becomeInvalidEmitter(); - mpEmitter = NULL; + mpEmitter->becomeInvalidEmitter(); + mpEmitter = NULL; } mPointWind.set_pwind_delete(); return; diff --git a/src/d/actor/d_a_swtdoor.cpp b/src/d/actor/d_a_swtdoor.cpp index 067cc5c44..05b7e2fa7 100644 --- a/src/d/actor/d_a_swtdoor.cpp +++ b/src/d/actor/d_a_swtdoor.cpp @@ -8,11 +8,9 @@ #include "f_op/f_op_actor_mng.h" #include "d/d_com_inf_game.h" #include "d/d_procname.h" -#include "d/actor/d_a_player.h" #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_mtx.h" #include "SSystem/SComponent/c_lib.h" -#include "JSystem/JUtility/JUTAssert.h" /* 00000078-000000C4 .text daSwtdoor_Draw__FP13swtdoor_class */ static BOOL daSwtdoor_Draw(swtdoor_class* i_this) { diff --git a/src/d/actor/d_a_tag_island.cpp b/src/d/actor/d_a_tag_island.cpp index 4a388cccb..83d4f0193 100644 --- a/src/d/actor/d_a_tag_island.cpp +++ b/src/d/actor/d_a_tag_island.cpp @@ -217,18 +217,18 @@ void daTag_Island_c::demoInitTact_Af() { l_msg->mStatus = fopMsgStts_MSG_ENDS_e; fopMsgM_messageSendOn(); if (player->getTactTimerCancel() > 0) - setFlag(0x04); + setFlag(daTagIsl_UNK_04); else - clrFlag(0x04); + clrFlag(daTagIsl_UNK_04); } /* 00000854-00000A00 .text demoProcTact_Af__14daTag_Island_cFv */ BOOL daTag_Island_c::demoProcTact_Af() { u16 rt = talk(); if (rt == fopMsgStts_BOX_CLOSED_e || rt == 0xFE) { - if (chkFlag(0x01)) { - clrFlag(0x01); - if (chkFlag(0x04)) { + if (chkFlag(daTagIsl_UNK_01)) { + clrFlag(daTagIsl_UNK_01); + if (chkFlag(daTagIsl_UNK_04)) { if (m2A0 == 1) { mEventId = dComIfGp_evmng_getEventIdx("TACT_TEARCH4"); } else { @@ -244,7 +244,7 @@ BOOL daTag_Island_c::demoProcTact_Af() { mEventId = dComIfGp_evmng_getEventIdx("TACT_TEARCH3"); } } - setFlag(0x02); + setFlag(daTagIsl_UNK_02); fopAcM_orderChangeEventId(this, daPy_getPlayerLinkActorClass(), mEventId, 0, 0xFFFF); } else { JUT_ASSERT(0x1b3, FALSE); @@ -300,7 +300,7 @@ BOOL daTag_Island_c::demoProcWait() { /* 00000BD4-00000BE4 .text demoInitCom__14daTag_Island_cFv */ void daTag_Island_c::demoInitCom() { - setFlag(0x01); + setFlag(daTagIsl_UNK_01); } /* 00000BE4-00000BE8 .text demoProcCom__14daTag_Island_cFv */ @@ -337,9 +337,9 @@ int daTag_Island_c::getNowEventAction() { BOOL daTag_Island_c::demoProc() { BOOL ret = FALSE; - if (chkFlag(0x02)) { + if (chkFlag(daTagIsl_UNK_02)) { mStaffId = dComIfGp_evmng_getMyStaffId("TagIsl"); - clrFlag(0x02); + clrFlag(daTagIsl_UNK_02); dComIfGp_event_setTalkPartner(dComIfGp_getShipActor()); } @@ -381,7 +381,7 @@ BOOL daTag_Island_c::actionTact() { BOOL daTag_Island_c::actionEvent() { if (dComIfGp_evmng_endCheck(mEventId)) { if (getType() == 1) { - setFlag(0x02); + setFlag(daTagIsl_UNK_02); setActio(ACT_TACT); mEventId = dComIfGp_evmng_getEventIdx("TACT_TEARCH0"); fopAcM_orderChangeEventId(this, daPy_getPlayerLinkActorClass(), mEventId, 0, 0xFFFF); diff --git a/src/d/actor/d_a_tbox.cpp b/src/d/actor/d_a_tbox.cpp index 94a6b6b49..00f98dc9d 100644 --- a/src/d/actor/d_a_tbox.cpp +++ b/src/d/actor/d_a_tbox.cpp @@ -371,16 +371,16 @@ void daTbox_c::setDzb() { /* 00000ECC-00000F8C .text surfaceProc__8daTbox_cFv */ void daTbox_c::surfaceProc() { - if (mpBgWCurrent != NULL && flagCheck(daTboxFlg_UNK_20)) { - if (m03EC < -1.0f) { - m03EC += 1.0f; + if (mpBgWCurrent != NULL && flagCheck(daTboxFlg_APPEARING_e)) { + if (mAppearingYOffset < -1.0f) { + mAppearingYOffset += 1.0f; } else { - flagOff(daTboxFlg_UNK_20); - m03EC = 0.0f; + flagOff(daTboxFlg_APPEARING_e); + mAppearingYOffset = 0.0f; } - mDoMtx_stack_c::transS(current.pos.x, current.pos.y + m03EC, current.pos.z); + mDoMtx_stack_c::transS(current.pos.x, current.pos.y + mAppearingYOffset, current.pos.z); mDoMtx_stack_c::YrotM(current.angle.y); mDoMtx_copy(mDoMtx_stack_c::get(), mMtx); @@ -425,7 +425,11 @@ BOOL daTbox_c::checkNormal() { return FALSE; } - return dComIfGs_isSwitch(swNo, mRoomNo) ? TRUE : FALSE; + if (dComIfGs_isSwitch(swNo, mRoomNo)) { + return TRUE; + } + + return FALSE; } /* 0000108C-000010AC .text CheckCreateHeap__FP10fopAc_ac_c */ @@ -491,7 +495,7 @@ void daTbox_c::CreateInit() { frameCtrl->setFrame(frameCtrl->getEnd()); } else { - flagOn(daTboxFlg_UNK_04); + flagOn(daTboxFlg_UNK_04); switch (funcType) { case FUNC_TYPE_ENEMIES: @@ -783,8 +787,8 @@ s32 daTbox_c::demoProc() { mEfLight.mPower = 0.0f; break; case ACT_APPEAR: - flagOn(daTboxFlg_UNK_20); - m03EC = -130.0f; + flagOn(daTboxFlg_APPEARING_e); + mAppearingYOffset = -130.0f; setDzb(); @@ -844,7 +848,7 @@ s32 daTbox_c::demoProc() { break; } - if (flagCheck(daTboxFlg_UNK_10)) { + if (flagCheck(daTboxFlg_OPENING_e)) { demoProcOpen(); } @@ -890,7 +894,7 @@ void daTbox_c::OpenInit() { mIsFlashPlaying = TRUE; mOpenTimer = 0; - flagOn(daTboxFlg_UNK_10); + flagOn(daTboxFlg_OPENING_e); dComIfGp_particle_set(0x01F1, ¤t.pos, ¤t.angle); dComIfGp_particle_set(0x01F2, ¤t.pos, ¤t.angle); @@ -931,7 +935,7 @@ BOOL daTbox_c::actionDemo() { dKy_set_allcol_ratio(1.0f); - flagOff(daTboxFlg_UNK_08 | daTboxFlg_UNK_10); + flagOff(daTboxFlg_UNK_08 | daTboxFlg_OPENING_e); dComIfGp_event_setItemPartner(NULL); if (mSmokeEmitter != NULL) { diff --git a/src/d/actor/d_a_tori_flag.cpp b/src/d/actor/d_a_tori_flag.cpp index f8edb05e6..841cc1287 100644 --- a/src/d/actor/d_a_tori_flag.cpp +++ b/src/d/actor/d_a_tori_flag.cpp @@ -4,7 +4,6 @@ // #include "d/actor/d_a_tori_flag.h" -#include "dolphin/mtx/mtx.h" #include "d/d_procname.h" #include "d/d_kankyo_wether.h" #include "m_Do/m_Do_mtx.h" @@ -14,7 +13,6 @@ #include "d/res/res_cloth.h" #include "f_op/f_op_actor_mng.h" #include "d/d_a_obj.h" -#include "SSystem/SComponent/c_math.h" #include "weak_bss_936_to_1036.h" // IWYU pragma: keep