mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
fopAcM_Register cleanup (#3047)
* use macro `fopAcM_Register` more consistently * replace fopAcM_RegisterCreateID with version that doesn't create `a_this`
This commit is contained in:
@@ -19,19 +19,16 @@
|
||||
}
|
||||
|
||||
#define fopAcM_RegisterDeleteID(i_this, actor_name_str) \
|
||||
const fpc_ProcID procID = fopAcM_GetID(i_this); \
|
||||
"Delete -> " actor_name_str "(id=%d)\n"
|
||||
("Delete -> " actor_name_str "(id=%d)\n", fopAcM_GetID(i_this))
|
||||
|
||||
#define fopAcM_RegisterCreateID(actor_class, i_this, actor_name_str) \
|
||||
actor_class* a_this = static_cast<actor_class*>(i_this); \
|
||||
const fpc_ProcID procID = fopAcM_GetID(i_this); \
|
||||
"Create -> " actor_name_str "(id=%d)\n"
|
||||
#define fopAcM_RegisterCreateID(i_this, actor_name_str) \
|
||||
("Create -> " actor_name_str "(id=%d)\n", fopAcM_GetID(i_this))
|
||||
|
||||
#define fopAcM_RegisterDelete(i_this, actor_name_str) "Delete -> " actor_name_str "\n"
|
||||
#define fopAcM_RegisterDelete(i_this, actor_name_str) \
|
||||
("Delete -> " actor_name_str "\n")
|
||||
|
||||
#define fopAcM_RegisterCreate(actor_class, i_this, actor_name_str) \
|
||||
static_cast<actor_class*>(i_this); \
|
||||
"Create -> " actor_name_str "\n"
|
||||
#define fopAcM_RegisterCreate(i_this, actor_name_str) \
|
||||
("Create -> " actor_name_str "\n")
|
||||
|
||||
class J3DModelData; // placeholder
|
||||
class JKRHeap;
|
||||
|
||||
@@ -289,7 +289,7 @@ static int daDr_IsDelete(daDr_c* i_this) {
|
||||
}
|
||||
|
||||
int daDr_c::_delete() {
|
||||
fpc_ProcID id = fopAcM_GetID(this);
|
||||
fopAcM_RegisterDeleteID(this, "DR");
|
||||
|
||||
if (heap != NULL) {
|
||||
mpModelMorf->stopZelAnime();
|
||||
|
||||
@@ -99,7 +99,8 @@ static int daAndsw_Delete(daAndsw_c* i_this) {
|
||||
}
|
||||
|
||||
static int daAndsw_Create(fopAc_ac_c* i_this) {
|
||||
fopAcM_RegisterCreateID(daAndsw_c, i_this, "Andsw");
|
||||
daAndsw_c* a_this = (daAndsw_c*)i_this;
|
||||
fopAcM_RegisterCreateID(i_this, "Andsw");
|
||||
return a_this->create();
|
||||
}
|
||||
|
||||
|
||||
@@ -1409,7 +1409,7 @@ static int daB_BH_IsDelete(b_bh_class* i_this) {
|
||||
|
||||
static int daB_BH_Delete(b_bh_class* i_this) {
|
||||
fopAc_ac_c* a_this = (fopAc_ac_c*)i_this;
|
||||
fpc_ProcID id = fopAcM_GetID(a_this);
|
||||
fopAcM_RegisterDeleteID(a_this, "B_BH");
|
||||
|
||||
dComIfG_resDelete(&i_this->mPhase, "B_BH");
|
||||
if (i_this->mInitHIO) {
|
||||
|
||||
@@ -3379,14 +3379,10 @@ int daB_MGN_c::_delete() {
|
||||
}
|
||||
|
||||
static int daB_MGN_Delete(daB_MGN_c* i_this) {
|
||||
fpc_ProcID id = fopAcM_GetID(i_this);
|
||||
fopAcM_RegisterDeleteID(i_this, "B_MGN");
|
||||
return i_this->_delete();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
char* const unused = "Delete -> B_MGN(id=%d)\n";
|
||||
#endif
|
||||
|
||||
int daB_MGN_c::CreateHeap() {
|
||||
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("B_mgn", BMDR_MGN);
|
||||
JUT_ASSERT(4010, modelData != NULL);
|
||||
|
||||
@@ -1341,6 +1341,7 @@ daBoomerang_c::~daBoomerang_c() {
|
||||
}
|
||||
|
||||
static int daBoomerang_Delete(daBoomerang_c* i_this) {
|
||||
fopAcM_RegisterDeleteID(i_this, "Boomerang");
|
||||
i_this->~daBoomerang_c();
|
||||
return 1;
|
||||
}
|
||||
@@ -1419,7 +1420,7 @@ static dCcD_SrcCyl l_windAtCylSrc = {
|
||||
};
|
||||
|
||||
int daBoomerang_c::create() {
|
||||
fpc_ProcID id = fopAcM_GetID(this);
|
||||
fopAcM_RegisterCreateID(this, "Boomerang");
|
||||
fopAcM_ct(this, daBoomerang_c);
|
||||
|
||||
if (!fopAcM_entrySolidHeap(this, daBoomerang_createHeap, 0xC0D0)) {
|
||||
|
||||
@@ -168,7 +168,7 @@ int daCanoe_c::create() {
|
||||
|
||||
static int daCanoe_Create(fopAc_ac_c* i_this) {
|
||||
daCanoe_c* a_this = (daCanoe_c*)i_this;
|
||||
fpc_ProcID id = fopAcM_GetID(i_this);
|
||||
fopAcM_RegisterCreateID(i_this, "Canoe");
|
||||
return a_this->create();
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ daCanoe_c::~daCanoe_c() {
|
||||
}
|
||||
|
||||
static int daCanoe_Delete(daCanoe_c* i_this) {
|
||||
fpc_ProcID id = fopAcM_GetID(i_this);
|
||||
fopAcM_RegisterDeleteID(i_this, "Canoe");
|
||||
i_this->~daCanoe_c();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -3265,7 +3265,7 @@ static int daCow_Draw(void* actor) {
|
||||
}
|
||||
|
||||
int daCow_c::Delete() {
|
||||
fpc_ProcID id = fopAcM_GetID(this);
|
||||
fopAcM_RegisterDeleteID(this, "COW");
|
||||
dComIfG_resDelete(&mPhase, "Cow");
|
||||
|
||||
if (heap != NULL) {
|
||||
|
||||
@@ -1837,7 +1837,8 @@ static int daDemo00_Delete(daDemo00_c* i_this) {
|
||||
}
|
||||
|
||||
static int daDemo00_Create(fopAc_ac_c* i_this) {
|
||||
fopAcM_RegisterCreateID(daDemo00_c, i_this, "Demo00");
|
||||
daDemo00_c* a_this = (daDemo00_c*)i_this;
|
||||
fopAcM_RegisterCreateID(i_this, "Demo00");
|
||||
fopAcM_ct(a_this, daDemo00_c);
|
||||
|
||||
a_this->field_0x6a2 = 0;
|
||||
|
||||
@@ -2342,7 +2342,7 @@ static int daDo_IsDelete(do_class* i_this) {
|
||||
}
|
||||
|
||||
static int daDo_Delete(do_class* i_this) {
|
||||
u32 actor_id = fopAcM_GetID(i_this);
|
||||
fopAcM_RegisterDeleteID(i_this, "Do");
|
||||
dComIfG_resDelete(&i_this->mPhase, "Do");
|
||||
if (i_this->mHIOInit) {
|
||||
hio_set = false;
|
||||
|
||||
@@ -1173,7 +1173,8 @@ int daSpiral_Delete(daSpiral_c* i_this) {
|
||||
}
|
||||
|
||||
int daSpiral_Create(fopAc_ac_c* i_this) {
|
||||
fopAcM_RegisterCreateID(daSpiral_c, i_this, "Door10");
|
||||
daSpiral_c* a_this = (daSpiral_c*)i_this;
|
||||
fopAcM_RegisterCreateID(i_this, "Door10");
|
||||
fopAcM_ct(a_this, daSpiral_c);
|
||||
return a_this->create();
|
||||
}
|
||||
|
||||
@@ -1283,7 +1283,7 @@ int daE_BG_c::_delete() {
|
||||
}
|
||||
|
||||
static int daE_BG_Delete(daE_BG_c* i_this) {
|
||||
fpc_ProcID id = fopAcM_GetID(i_this);
|
||||
fopAcM_RegisterDeleteID(i_this, "E_BG");
|
||||
return i_this->_delete();
|
||||
}
|
||||
|
||||
|
||||
@@ -779,7 +779,7 @@ static int daE_BS_IsDelete(e_bs_class* i_this) {
|
||||
|
||||
static int daE_BS_Delete(e_bs_class* i_this) {
|
||||
fopAc_ac_c* actor = &i_this->enemy;
|
||||
fpc_ProcID id = fopAcM_GetID(i_this);
|
||||
fopAcM_RegisterDeleteID(i_this, "E_BS");
|
||||
dComIfG_resDelete(&i_this->phase, "E_BS");
|
||||
|
||||
if (i_this->HIOInit) {
|
||||
|
||||
@@ -990,7 +990,7 @@ static int daE_BU_IsDelete(e_bu_class* i_this) {
|
||||
|
||||
static int daE_BU_Delete(e_bu_class* i_this) {
|
||||
fopAc_ac_c* actor = &i_this->enemy;
|
||||
fpc_ProcID id = fopAcM_GetID(actor);
|
||||
fopAcM_RegisterDeleteID(actor, "E_BU");
|
||||
dComIfG_resDelete(&i_this->phase, "E_BU");
|
||||
|
||||
if (i_this->HIOInit != 0) {
|
||||
|
||||
@@ -443,7 +443,7 @@ static int daE_CR_IsDelete(e_cr_class* a_this) {
|
||||
|
||||
static int daE_CR_Delete(e_cr_class* a_this) {
|
||||
fopEn_enemy_c* actor = &a_this->enemy;
|
||||
fpc_ProcID id = fopAcM_GetID(a_this);
|
||||
fopAcM_RegisterDeleteID(a_this, "E_CR");
|
||||
dComIfG_resDelete(&a_this->phase, "E_CR");
|
||||
|
||||
if (a_this->HIOInit) {
|
||||
|
||||
@@ -140,7 +140,7 @@ static int daE_CR_EGG_IsDelete(e_cr_egg_class* a_this) {
|
||||
static int daE_CR_EGG_Delete(e_cr_egg_class* a_this) {
|
||||
fopAc_ac_c* actor = &a_this->enemy;
|
||||
|
||||
fpc_ProcID id = fopAcM_GetID(actor);
|
||||
fopAcM_RegisterDeleteID(actor, "E_CR_EGG");
|
||||
dComIfG_resDelete(&a_this->phase, "E_CR");
|
||||
a_this->sound.stopAnime();
|
||||
return 1;
|
||||
@@ -162,7 +162,7 @@ static int useHeapInit(fopAc_ac_c* i_this) {
|
||||
|
||||
static int daE_CR_EGG_Create(fopAc_ac_c* i_this) {
|
||||
e_cr_egg_class* a_this = (e_cr_egg_class*)i_this;
|
||||
fopAcM_ct(i_this, e_cr_egg_class);
|
||||
fopAcM_ct(&a_this->enemy, e_cr_egg_class);
|
||||
|
||||
int phase_state = dComIfG_resLoad(&a_this->phase, "E_CR");
|
||||
if (phase_state == cPhs_COMPLEATE_e) {
|
||||
|
||||
@@ -2015,7 +2015,7 @@ static int daE_DB_IsDelete(e_db_class* i_this) {
|
||||
|
||||
static int daE_DB_Delete(e_db_class* i_this) {
|
||||
fopAc_ac_c* actor = &i_this->enemy;
|
||||
fpc_ProcID id = fopAcM_GetID(i_this);
|
||||
fopAcM_RegisterDeleteID(i_this, "E_DB");
|
||||
dComIfG_resDelete(&i_this->phase, "E_db");
|
||||
|
||||
if (i_this->HIOInit) {
|
||||
|
||||
@@ -642,7 +642,7 @@ static int daE_DF_IsDelete(daE_DF_c* i_this) {
|
||||
}
|
||||
|
||||
static int daE_DF_Delete(daE_DF_c* i_this) {
|
||||
fpc_ProcID proc_id = fopAcM_GetID(i_this);
|
||||
fopAcM_RegisterDeleteID(i_this, "E_DF");
|
||||
return i_this->Delete();
|
||||
}
|
||||
|
||||
@@ -655,7 +655,7 @@ int daE_DF_c::Create() {
|
||||
mArg0 = (u8)fopAcM_GetParam(this);
|
||||
|
||||
if (mArg0 != 0xff && dComIfGs_isSwitch(mArg0, fopAcM_GetRoomNo(this))) {
|
||||
OS_REPORT("E_WS やられ後なので再セットしません");
|
||||
OS_REPORT("E_WS やられ後なので再セットしません\n");
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
|
||||
@@ -706,7 +706,7 @@ int daE_DF_c::Create() {
|
||||
|
||||
static int daE_DF_Create(fopAc_ac_c* i_this) {
|
||||
daE_DF_c* a_this = (daE_DF_c*)i_this;
|
||||
fpc_ProcID proc_id = fopAcM_GetID(i_this);
|
||||
fopAcM_RegisterCreateID(i_this, "E_DF");
|
||||
return a_this->Create();
|
||||
}
|
||||
|
||||
|
||||
@@ -932,7 +932,7 @@ int daE_DK_c::_delete() {
|
||||
}
|
||||
|
||||
static int daE_DK_Delete(daE_DK_c* i_this) {
|
||||
fpc_ProcID unusedId = fopAcM_GetID(i_this); // debug match
|
||||
fopAcM_RegisterDeleteID(i_this, "E_DK");
|
||||
return i_this->_delete();
|
||||
}
|
||||
|
||||
|
||||
@@ -3282,7 +3282,7 @@ static int daE_DN_IsDelete(e_dn_class* i_this) {
|
||||
|
||||
static int daE_DN_Delete(e_dn_class* i_this) {
|
||||
fopEn_enemy_c* actor = (fopEn_enemy_c*)&i_this->actor;
|
||||
fpc_ProcID no = fopAcM_GetID(i_this);
|
||||
fopAcM_RegisterDeleteID(i_this, "E_DN");
|
||||
|
||||
dComIfG_resDelete(&i_this->phase, "E_dn");
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user