From 8aac44688b6aaae64ba2b83d227f438b4159a97d Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Mon, 28 Jul 2025 23:48:27 -0400 Subject: [PATCH] Cleanup some actors --- include/d/actor/d_a_coming2.h | 2 ++ src/d/actor/d_a_bb.cpp | 11 ++++++----- src/d/actor/d_a_boko.cpp | 1 - src/d/actor/d_a_coming2.cpp | 10 ++++++---- src/d/actor/d_a_door10.cpp | 6 +++--- src/d/actor/d_a_ki.cpp | 17 ++++++----------- 6 files changed, 23 insertions(+), 24 deletions(-) diff --git a/include/d/actor/d_a_coming2.h b/include/d/actor/d_a_coming2.h index e4462a367..affce4363 100644 --- a/include/d/actor/d_a_coming2.h +++ b/include/d/actor/d_a_coming2.h @@ -11,6 +11,8 @@ namespace daComing2 { static BOOL position_is_none_obj(cXyz*); static BOOL checkLineCrossXZ(cXyz*, cXyz*, cXyz*, cXyz*); + extern s32 coming_make_item_no_table[]; + class _barrel_info_ { public: /* 0x00 */ fpc_ProcID unk_00; diff --git a/src/d/actor/d_a_bb.cpp b/src/d/actor/d_a_bb.cpp index 1ec57906b..da5f4d6e9 100644 --- a/src/d/actor/d_a_bb.cpp +++ b/src/d/actor/d_a_bb.cpp @@ -1323,8 +1323,8 @@ void bb_kamome_attack(bb_class* i_this) { /* 000044EC-00005534 .text bb_atack_move__FP8bb_class */ void bb_atack_move(bb_class* i_this) { - fopAc_ac_c* a_this = static_cast(&i_this->actor); - daPy_py_c* player = daPy_getPlayerActorClass(); + fopAc_ac_c* a_this = &i_this->actor; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); s8 r29 = 0; s8 r28 = 0; f32 x; @@ -1347,10 +1347,11 @@ void bb_atack_move(bb_class* i_this) { } #if VERSION == VERSION_DEMO - if (&player->base == fpcM_Search(pl_name_check, i_this) || l_bbHIO.unk_10 != 0) { + if (&player->base == fpcM_Search(pl_name_check, i_this) || l_bbHIO.unk_10 != 0) #else - if (&player->base == fpcM_Search(pl_name_check, i_this)) { + if (&player->base == fpcM_Search(pl_name_check, i_this)) #endif + { bb_kamome_attack(i_this); return; } @@ -1524,7 +1525,7 @@ void bb_atack_move(bb_class* i_this) { cXyz scale; scale.x = scale.y = scale.z = 4.0f; - dComIfGp_particle_set(dPa_name::ID_COMMON_PURPLE_HIT, &i_this->actor.eyePos, NULL, &scale); + dComIfGp_particle_set(dPa_name::ID_COMMON_PURPLE_HIT, &a_this->eyePos, NULL, &scale); i_this->unk_2F1 = 10; i_this->unk_318[0] = l_bbHIO.unk_30; diff --git a/src/d/actor/d_a_boko.cpp b/src/d/actor/d_a_boko.cpp index 80c544eee..b0f0bc94f 100644 --- a/src/d/actor/d_a_boko.cpp +++ b/src/d/actor/d_a_boko.cpp @@ -10,7 +10,6 @@ #include "d/d_bg_s_lin_chk.h" #include "weak_bss_936_to_1036.h" // IWYU pragma: keep -#include "weak_data_2100_2080.h" // IWYU pragma: keep #include "weak_data_1811.h" // IWYU pragma: keep u32 daBoko_c::m_bound_se[6] = { diff --git a/src/d/actor/d_a_coming2.cpp b/src/d/actor/d_a_coming2.cpp index 810ba333d..6373ceae5 100644 --- a/src/d/actor/d_a_coming2.cpp +++ b/src/d/actor/d_a_coming2.cpp @@ -13,18 +13,20 @@ #include "d/actor/d_a_ship.h" #include "d/actor/d_a_sea.h" #include "d/actor/d_a_obj_barrel2.h" -#include "d/actor/d_a_obj_doguu.h" #include "weak_bss_936_to_1036.h" // IWYU pragma: keep -#include "weak_data_2100_2080.h" // IWYU pragma: keep #include "weak_data_1811.h" // IWYU pragma: keep -static s32 coming_make_item_no_table[] = { +s32 daComing2::coming_make_item_no_table[] = { dItem_GREEN_RUPEE_e, dItem_GREEN_RUPEE_e, dItem_GREEN_RUPEE_e, dItem_GREEN_RUPEE_e, dItem_GREEN_RUPEE_e, dItem_BLUE_RUPEE_e, dItem_BLUE_RUPEE_e, dItem_BLUE_RUPEE_e, dItem_BLUE_RUPEE_e, dItem_BLUE_RUPEE_e, dItem_YELLOW_RUPEE_e, dItem_YELLOW_RUPEE_e, dItem_YELLOW_RUPEE_e, dItem_YELLOW_RUPEE_e, dItem_YELLOW_RUPEE_e }; -static GXColor colorR = {255, 100, 100, 255}; + +static void dummy() { + // This may have been used in some debug drawing function. + static GXColor colorR = {255, 100, 100, 255}; +} namespace daComing2 { namespace { diff --git a/src/d/actor/d_a_door10.cpp b/src/d/actor/d_a_door10.cpp index aa5c3dbb3..6cc5de19e 100644 --- a/src/d/actor/d_a_door10.cpp +++ b/src/d/actor/d_a_door10.cpp @@ -132,7 +132,7 @@ BOOL daDoor10_c::chkStopOpen() { if ((mFrontCheck == 0 && cVar3 == 2) || (mFrontCheck == 1 && cVar3 == 5)) { #if VERSION == VERSION_DEMO - if (!dComIfGp_event_runCheck() != FALSE) { + if (dComIfGp_event_runCheck() == FALSE) { if (dComIfGp_roomControl_checkRoomDisp(roomNo)) { if (fopAcM_myRoomSearchEnemy(roomNo) == NULL) { if (m2A1 != 0) { @@ -154,7 +154,7 @@ BOOL daDoor10_c::chkStopOpen() { m2A1 = 0x41; } #else - if (!dComIfGp_event_runCheck() != FALSE || m2A1 == 0) { + if (dComIfGp_event_runCheck() == FALSE || m2A1 == 0) { if (dComIfGp_roomControl_checkRoomDisp(roomNo)) { if (fopAcM_myRoomSearchEnemy(roomNo) == NULL) { if (m2A1 != 0) { @@ -258,7 +258,7 @@ f32 daDoor10_c::getSize2X() { return 110.0f * 110.0f; } -static const char daDoor10_c::M_arcname[] = "door10"; +const char daDoor10_c::M_arcname[] = "door10"; /* 000007CC-000007EC .text CheckCreateHeap__FP10fopAc_ac_c */ static BOOL CheckCreateHeap(fopAc_ac_c* a_this) { diff --git a/src/d/actor/d_a_ki.cpp b/src/d/actor/d_a_ki.cpp index 48696bd7f..e1caf46ba 100644 --- a/src/d/actor/d_a_ki.cpp +++ b/src/d/actor/d_a_ki.cpp @@ -21,6 +21,9 @@ #include "d/d_bg_s_lin_chk.h" #include "JSystem/JUtility/JUTReport.h" +#include "weak_bss_936_to_1036.h" // IWYU pragma: keep +#include "weak_data_1811.h" // IWYU pragma: keep + class kiHIO_c : public JORReflexible { public: kiHIO_c() { @@ -84,17 +87,11 @@ public: /* 0x58 */ f32 m58; }; // size = 0x5C -#include "weak_bss_3569.h" -#include "weak_bss_936_to_1036.h" - static bool hio_set; static kiHIO_c l_kiHIO; static s32 ki_all_count; static s32 ki_fight_count; -#include "weak_data_2100_2080.h" -#include "weak_data_1811.h" - static u16 ki_tex_anm_idx[] = {KI_BTP_AKE1, KI_BTP_TOJI1, KI_BTP_METOJI1, KI_BTP_GURU1}; static u16 ki_tex_max_frame[] = { 2, 2, 3, 2 }; static u8 ki_tex_loop[] = { 0, 0, 0, 0 }; @@ -202,7 +199,6 @@ BOOL ki_player_bg_check(ki_class* i_this) { /* 00000C58-00000F04 .text daKi_Draw__FP8ki_class */ static BOOL daKi_Draw(ki_class* i_this) { fopEn_enemy_c* a_this = (fopEn_enemy_c*)&i_this->actor; - cXyz sp08; if (i_this->m2D4 != 0) { return TRUE; @@ -712,7 +708,6 @@ s16 wall_angle_get(ki_class* i_this) { cXyz sp2C[2]; cXyz sp20; cXyz sp14; - cXyz sp08; cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); sp20.x = 0.0f; @@ -906,7 +901,7 @@ void ki_path_move(ki_class* i_this) { i_this->m2D6 = 1; } - case -1: + case -1: { i_this->mBehaviorType = 1; dPnt* point = &i_this->ppd->m_points[0]; point += i_this->m2D6; @@ -918,7 +913,7 @@ void ki_path_move(ki_class* i_this) { i_this->mPosMove.y = point->m_position.y + cM_rndFX(150.0f); i_this->mPosMove.z = point->m_position.z + cM_rndFX(150.0f); break; - + } case 1: f32 x = i_this->mPosMove.x - i_this->actor.current.pos.x; f32 y = i_this->mPosMove.y - i_this->actor.current.pos.y; @@ -1006,7 +1001,7 @@ static BOOL daKi_Execute(ki_class* i_this) { i_this->mDamageSphere.SetR(40.0f); i_this->m6AC.SetR(l_kiHIO.m58); - if (!l_kiHIO.m06 != 0) { + if (l_kiHIO.m06 == 0) { i_this->m540 = 0; for (i = 0; i < 4; i++) {