summaryrefslogtreecommitdiff
path: root/src/d/actor
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2024-01-08 17:25:17 -0500
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2024-01-08 17:25:17 -0500
commit6f2587f2eebbf623d2d2c2465fcabaa0fa84bd16 (patch)
tree9df43d776f89269b81b009193a39f9185e7aaa7e /src/d/actor
parent43f89340b2d4617ee4632d0420c97518406b7707 (diff)
misc actor cleanup
Diffstat (limited to 'src/d/actor')
-rw-r--r--src/d/actor/d_a_obj_pbka.cpp95
-rw-r--r--src/d/actor/d_a_rectangle.cpp50
-rw-r--r--src/d/actor/d_a_swtact.cpp30
-rw-r--r--src/d/actor/d_a_tag_msg.cpp50
4 files changed, 115 insertions, 110 deletions
diff --git a/src/d/actor/d_a_obj_pbka.cpp b/src/d/actor/d_a_obj_pbka.cpp
index af98037a..80651884 100644
--- a/src/d/actor/d_a_obj_pbka.cpp
+++ b/src/d/actor/d_a_obj_pbka.cpp
@@ -8,16 +8,6 @@
#include "m_Do/m_Do_mtx.h"
#include "d/d_procname.h"
-BOOL daObjPbka_c::_draw() {
- dKy_tevstr_c * pTevStr;
- g_env_light.settingTevStruct(TEV_TYPE_BG0, &current.pos, pTevStr = &mTevStr);
- g_env_light.setLightTevColorType(mpModel, pTevStr);
- dComIfGd_setListBG();
- mDoExt_modelUpdateDL(mpModel);
- dComIfGd_setList();
- return true;
-}
-
static int CheckCreateHeap(fopAc_ac_c* i_this) {
daObjPbka_c* a_this = (daObjPbka_c*)i_this;
return a_this->CreateHeap();
@@ -29,7 +19,7 @@ BOOL daObjPbka_c::CreateHeap() {
JUT_ASSERT(0x51, modelData != 0);
mpModel = mDoExt_J3DModel__create(modelData,0,0x11020203);
if(mpModel == NULL) {
- return false;
+ return FALSE;
}
return TRUE;
}
@@ -52,25 +42,41 @@ void daObjPbka_c::set_mtx() {
mDoMtx_copy(mDoMtx_stack_c::get(), mpModel->mBaseTransformMtx);
}
-static cPhs__Step daObjPbka_Create(void* i_this) {
- int cPhsStep;
- daObjPbka_c* a_this = (daObjPbka_c*)i_this;
- fopAcM_SetupActor(a_this, daObjPbka_c);
+s32 daObjPbka_c::_create() {
+ fopAcM_SetupActor(this, daObjPbka_c);
- cPhsStep = dComIfG_resLoad(&a_this->mPhase, "Pbka");
- if (cPhsStep == cPhs_COMPLEATE_e) {
- if (fopAcM_entrySolidHeap(a_this, CheckCreateHeap, 0x680) == 0) {
- cPhsStep = cPhs_ERROR_e;
+ int phase_state = dComIfG_resLoad(&mPhase, "Pbka");
+ if (phase_state == cPhs_COMPLEATE_e) {
+ if (fopAcM_entrySolidHeap(this, CheckCreateHeap, 0x680) == 0) {
+ phase_state = cPhs_ERROR_e;
} else {
- a_this->CreateInit();
+ CreateInit();
}
}
- return (cPhs__Step)cPhsStep;
+ return phase_state;
+}
+
+static int daObjPbka_Create(void* i_this) {
+ return static_cast<daObjPbka_c*>(i_this)->_create();
+}
+
+BOOL daObjPbka_c::_delete() {
+ dComIfG_resDelete(&mPhase,"Pbka");
+ return TRUE;
}
static BOOL daObjPbka_Delete(void* i_this) {
- daObjPbka_c* a_this = (daObjPbka_c*)i_this;
- dComIfG_resDelete(&a_this->mPhase,"Pbka");
+ static_cast<daObjPbka_c*>(i_this)->_delete();
+ return TRUE;
+}
+
+BOOL daObjPbka_c::_draw() {
+ dKy_tevstr_c * pTevStr;
+ g_env_light.settingTevStruct(TEV_TYPE_BG0, &current.pos, pTevStr = &mTevStr);
+ g_env_light.setLightTevColorType(mpModel, pTevStr);
+ dComIfGd_setListBG();
+ mDoExt_modelUpdateDL(mpModel);
+ dComIfGd_setList();
return TRUE;
}
@@ -79,15 +85,18 @@ static BOOL daObjPbka_Draw(void* i_this) {
return a_this->_draw();
}
-static BOOL daObjPbka_Execute(void* i_this) {
- daObjPbka_c* a_this = (daObjPbka_c*)i_this;
- a_this->current.angle.y += 0x500;
- a_this->shape_angle.y = a_this->current.angle.y;
- fopAcM_seStartCurrent(a_this, JA_SE_OBJ_BOMB_SHOP_FAN, 0);
- a_this->set_mtx();
+BOOL daObjPbka_c::_execute() {
+ current.angle.y += 0x500;
+ shape_angle.y = current.angle.y;
+ fopAcM_seStartCurrent(this, JA_SE_OBJ_BOMB_SHOP_FAN, 0);
+ set_mtx();
return TRUE;
}
+static BOOL daObjPbka_Execute(void* i_this) {
+ return static_cast<daObjPbka_c*>(i_this)->_execute();
+}
+
static BOOL daObjPbka_IsDelete(void*) {
return TRUE;
}
@@ -101,18 +110,18 @@ static actor_method_class daObj_PbkaMethodTable = {
};
actor_process_profile_definition g_profile_Obj_Pbka = {
- fpcLy_CURRENT_e,
- 7,
- fpcLy_CURRENT_e,
- PROC_Obj_Pbka,
- &g_fpcLf_Method.mBase,
- sizeof(daObjPbka_c),
- 0,
- 0,
- &g_fopAc_Method.base,
- 0x70,
- &daObj_PbkaMethodTable,
- fopAcStts_UNK40000_e | fopAcStts_CULL_e,
- fopAc_ACTOR_e,
- fopAc_CULLBOX_CUSTOM_e,
+ /* LayerID */ fpcLy_CURRENT_e,
+ /* ListID */ 7,
+ /* ListPrio */ fpcLy_CURRENT_e,
+ /* ProcName */ PROC_Obj_Pbka,
+ /* Proc SubMtd */ &g_fpcLf_Method.mBase,
+ /* Size */ sizeof(daObjPbka_c),
+ /* SizeOther */ 0,
+ /* Parameters */ 0,
+ /* Leaf SubMtd */ &g_fopAc_Method.base,
+ /* Priority */ 0x70,
+ /* Actor SubMtd */ &daObj_PbkaMethodTable,
+ /* Status */ fopAcStts_UNK40000_e | fopAcStts_CULL_e,
+ /* Group */ fopAc_ACTOR_e,
+ /* CullType */ fopAc_CULLBOX_CUSTOM_e,
};
diff --git a/src/d/actor/d_a_rectangle.cpp b/src/d/actor/d_a_rectangle.cpp
index 0a0f0466..6333be7b 100644
--- a/src/d/actor/d_a_rectangle.cpp
+++ b/src/d/actor/d_a_rectangle.cpp
@@ -2,31 +2,31 @@
#include "d/actor/d_a_rectangle.h"
#include "f_op/f_op_actor.h"
#include "d/d_procname.h"
-#include "dolphin/types.h"
+#include "SSystem/SComponent/c_phase.h"
/* 00000078-00000080 .text daRct_Draw__FP15RECTANGLE_class */
-static BOOL daRct_Draw(RECTANGLE_class*) {
- return true;
+static BOOL daRct_Draw(RECTANGLE_class* i_this) {
+ return TRUE;
}
/* 00000080-00000088 .text daRct_Execute__FP15RECTANGLE_class */
-static BOOL daRct_Execute(RECTANGLE_class*) {
- return true;
+static BOOL daRct_Execute(RECTANGLE_class* i_this) {
+ return TRUE;
}
/* 00000088-00000090 .text daRct_IsDelete__FP15RECTANGLE_class */
-static BOOL daRct_IsDelete(RECTANGLE_class*) {
- return true;
+static BOOL daRct_IsDelete(RECTANGLE_class* i_this) {
+ return TRUE;
}
/* 00000090-00000098 .text daRct_Delete__FP15RECTANGLE_class */
-static BOOL daRct_Delete(RECTANGLE_class*) {
- return true;
+static BOOL daRct_Delete(RECTANGLE_class* i_this) {
+ return TRUE;
}
/* 00000098-000000A0 .text daRct_Create__FP10fopAc_ac_c */
-static int daRct_Create(fopAc_ac_c*) {
- return 0x4;
+static int daRct_Create(fopAc_ac_c* i_this) {
+ return cPhs_COMPLEATE_e;
}
static actor_method_class l_daRct_Method = {
@@ -38,18 +38,18 @@ static actor_method_class l_daRct_Method = {
};
actor_process_profile_definition g_profile_RECTANGLE = {
- fpcLy_CURRENT_e,
- 7,
- fpcLy_CURRENT_e,
- PROC_RECTANGLE,
- &g_fpcLf_Method.mBase,
- sizeof(RECTANGLE_class),
- 0,
- 0,
- &g_fopAc_Method.base,
- 0x9F,
- &l_daRct_Method,
- fopAcStts_UNK40000_e,
- fopAc_ACTOR_e,
- fopAc_CULLBOX_0_e,
+ /* LayerID */ fpcLy_CURRENT_e,
+ /* ListID */ 7,
+ /* ListPrio */ fpcLy_CURRENT_e,
+ /* ProcName */ PROC_RECTANGLE,
+ /* Proc SubMtd */ &g_fpcLf_Method.mBase,
+ /* Size */ sizeof(RECTANGLE_class),
+ /* SizeOther */ 0,
+ /* Parameters */ 0,
+ /* Leaf SubMtd */ &g_fopAc_Method.base,
+ /* Priority */ 0x9F,
+ /* Actor SubMtd */ &l_daRct_Method,
+ /* Status */ fopAcStts_UNK40000_e,
+ /* Group */ fopAc_ACTOR_e,
+ /* CullType */ fopAc_CULLBOX_0_e,
};
diff --git a/src/d/actor/d_a_swtact.cpp b/src/d/actor/d_a_swtact.cpp
index 7b337fbc..bc4cfd8b 100644
--- a/src/d/actor/d_a_swtact.cpp
+++ b/src/d/actor/d_a_swtact.cpp
@@ -73,7 +73,7 @@ s32 daSwTact_c::_create() {
s32 result = cPhs_COMPLEATE_e;
if (daSwTact_prm::getModel(this) == 1) {
- result = dComIfG_resLoad(&this->mPhs, m_arcname);
+ result = dComIfG_resLoad(&mPhs, m_arcname);
if (result == cPhs_COMPLEATE_e) {
if (!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0x3000)) {
@@ -212,18 +212,18 @@ actor_method_class daSwTactMethodTable = {
};
actor_process_profile_definition g_profile_SW_TACT = {
- fpcLy_CURRENT_e,
- 7,
- fpcPi_CURRENT_e,
- PROC_SW_TACT,
- &g_fpcLf_Method.mBase,
- sizeof(daSwTact_c),
- 0,
- 0,
- &g_fopAc_Method.base,
- 0x013B,
- &daSwTactMethodTable,
- fopAcStts_CULL_e | fopAcStts_UNK4000_e | fopAcStts_UNK40000_e,
- fopAc_ACTOR_e,
- fopAc_CULLBOX_CUSTOM_e,
+ /* LayerID */ fpcLy_CURRENT_e,
+ /* ListID */ 7,
+ /* ListPrio */ fpcPi_CURRENT_e,
+ /* ProcName */ PROC_SW_TACT,
+ /* Proc SubMtd */ &g_fpcLf_Method.mBase,
+ /* Size */ sizeof(daSwTact_c),
+ /* SizeOther */ 0,
+ /* Parameters */ 0,
+ /* Leaf SubMtd */ &g_fopAc_Method.base,
+ /* Priority */ 0x013B,
+ /* Actor SubMtd */ &daSwTactMethodTable,
+ /* Status */ fopAcStts_CULL_e | fopAcStts_UNK4000_e | fopAcStts_UNK40000_e,
+ /* Group */ fopAc_ACTOR_e,
+ /* CullType */ fopAc_CULLBOX_CUSTOM_e,
};
diff --git a/src/d/actor/d_a_tag_msg.cpp b/src/d/actor/d_a_tag_msg.cpp
index e436c1bb..87a7024f 100644
--- a/src/d/actor/d_a_tag_msg.cpp
+++ b/src/d/actor/d_a_tag_msg.cpp
@@ -106,18 +106,14 @@ BOOL daTag_Msg_c::rangeCheck() {
}
BOOL daTag_Msg_c::otherCheck() {
- daPy_lk_c *player;
- short diff;
- short actorAngle;
-
- actorAngle = fopAcM_searchActorAngleY(this, daPy_getPlayerActorClass());
- player = daPy_getPlayerLinkActorClass();
- if ((getType2() & 1) != 0) {
+ s16 targetAngle = fopAcM_searchPlayerAngleY(this);
+ daPy_lk_c* player = daPy_getPlayerLinkActorClass();
+ if (getType2() & 1) {
return TRUE;
}
JUT_ASSERT(0xC8, player);
if (getMessage() == 0x1902) {
- diff = (short)(actorAngle - this->orig.angle.y);
+ s16 diff = targetAngle - orig.angle.y;
if (diff < 0) {
diff = -diff;
}
@@ -125,11 +121,11 @@ BOOL daTag_Msg_c::otherCheck() {
return FALSE;
}
}
- actorAngle = (short)(actorAngle + 0x7fff) - player->current.angle.y;
- if (actorAngle < 0) {
- actorAngle = (short)-actorAngle;
+ targetAngle = (s16)(targetAngle + 0x7FFF) - player->current.angle.y;
+ if (targetAngle < 0) {
+ targetAngle = -targetAngle;
}
- if (actorAngle > 0x1000) {
+ if (targetAngle > 0x1000) {
return FALSE;
}
@@ -201,7 +197,7 @@ static BOOL daTag_Msg_actionHunt(daTag_Msg_c* a_this) {
daPy_getPlayerLinkActorClass()->onPlayerNoDraw();
}
} else if (a_this->rangeCheck() != 0 && a_this->otherCheck() != 0) {
- if ((a_this->getType2() & 1) != 0) {
+ if (a_this->getType2() & 1) {
fopAcM_orderSpeakEvent(a_this);
}
a_this->mEvtInfo.mCondition |= dEvtCnd_CANTALK_e;
@@ -291,18 +287,18 @@ static actor_method_class l_daTag_Msg_Method = {
};
actor_process_profile_definition g_profile_TAG_MSG = {
- fpcLy_CURRENT_e,
- 7,
- fpcPi_CURRENT_e,
- PROC_TAG_MSG,
- &g_fpcLf_Method.mBase,
- sizeof(daTag_Msg_c),
- 0,
- 0,
- &g_fopAc_Method.base,
- 0x0121,
- &l_daTag_Msg_Method,
- fopAcStts_UNK4000_e | fopAcStts_UNK40000_e,
- fopAc_ACTOR_e,
- fopAc_CULLBOX_6_e,
+ /* LayerID */ fpcLy_CURRENT_e,
+ /* ListID */ 7,
+ /* ListPrio */ fpcPi_CURRENT_e,
+ /* ProcName */ PROC_TAG_MSG,
+ /* Proc SubMtd */ &g_fpcLf_Method.mBase,
+ /* Size */ sizeof(daTag_Msg_c),
+ /* SizeOther */ 0,
+ /* Parameters */ 0,
+ /* Leaf SubMtd */ &g_fopAc_Method.base,
+ /* Priority */ 0x0121,
+ /* Actor SubMtd */ &l_daTag_Msg_Method,
+ /* Status */ fopAcStts_UNK4000_e | fopAcStts_UNK40000_e,
+ /* Group */ fopAc_ACTOR_e,
+ /* CullType */ fopAc_CULLBOX_6_e,
};