Files
dusklight/src/d/actor/d_a_obj_sekizo.cpp
T
Huitzi 56890c32e8 Actor status consolidation & process profile definition editing (#3117)
* Consolidate fopAcM_STATUS into fopAc_Status_e

* Add _e suffix to fopAcStts enums

* Prepare for profile enumeration
* Correct typo in scene_process_profile_definition
* Manually handle g_profile_Obj_DamCps (inline preprocessing)
* Correct g_profile_TAG_LV5SOUP procname to enum
* Create d_priority.h

* Update process profile definitions
* Moved inline comments to the left
* Add missing fopAcStts enums
* Add d_priority.h include in f_pc_leaf.h
* Manually update d_a_obj_damCps profile

* Replace fopAcStts enums replacing and anticipatory profile size correction
* Changed profile size from literal to sizeof() in anticipation of PR #3116
* Provided putative names to staff-related status enums
* Replaced appropriate literals with fopAcStts enums

* Fix borked merge

* Rename item number enums and move to d_item_data.h

* Rename process profile name & draw priority enums

* Move process profile name & draw priority enums to appropriate files
* Moved fpcNm_ enums from d/d_procname.h to f_pc/f_pc_name.h
* Moved fpcDwPi_ enums from d/d_priority.h to f_pc/f_pc_draw_priority.h

* ACTUALLY (whoops) stage merge

* Correct item mistranslation

Co-authored-by: LagoLunatic <LagoLunatic@users.noreply.github.com>

---------

Co-authored-by: LagoLunatic <LagoLunatic@users.noreply.github.com>
2026-03-09 18:33:31 -07:00

173 lines
4.5 KiB
C++

/**
* d_a_obj_sekizo.cpp
*
*/
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_obj_sekizo.h"
#include "d/d_bg_w.h"
#include "d/d_com_inf_game.h"
static struct {
u32 bmdIdx;
u32 resIdx;
} l_bmdData[1] = {4, 1};
static struct {
u32 dzbIdx;
u32 resIdx;
} l_dzbData[1] = {7, 1};
static char* l_resNameList[2] = {"", "Sekizo"};
static u8 lit_3800[12];
daObj_Sekizo_HIOParam const daObj_Sekizo_Param_c::m = {};
static OBJ_SEKIZO_HIO_CLASS l_HIO;
#if DEBUG
daObj_Sekizo_HIO_c::daObj_Sekizo_HIO_c() {
m = daObj_Sekizo_Param_c::m;
}
void daObj_Sekizo_HIO_c::listenPropertyEvent(const JORPropertyEvent* event) {
// NONMATCHING
}
void daObj_Sekizo_HIO_c::genMessage(JORMContext* ctx) {
// NONMATCHING
}
#endif
cPhs_Step daObj_Sekizo_c::create() {
fopAcM_ct(this, daObj_Sekizo_c);
field_0x5b0 = 0;
cPhs_Step step =
dComIfG_resLoad(&mPhaseReq, l_resNameList[l_bmdData[field_0x5b0].resIdx]);
if (step == cPhs_COMPLEATE_e) {
step = MoveBGCreate(l_resNameList[l_dzbData[field_0x5b0].resIdx],
l_dzbData[field_0x5b0].dzbIdx, dBgS_MoveBGProc_TypicalRotY,
0x4000, NULL);
if (step == cPhs_ERROR_e) {
return step;
}
}
return step;
}
int daObj_Sekizo_c::CreateHeap() {
J3DModelData* model_data = (J3DModelData*)dComIfG_getObjectRes(
l_resNameList[l_bmdData[field_0x5b0].resIdx], l_bmdData[field_0x5b0].bmdIdx);
mpModel = mDoExt_J3DModel__create(model_data, 0x80000, 0x11000084);
if (mpModel == NULL) {
return false;
}
return true;
}
int daObj_Sekizo_c::Create() {
initBaseMtx();
fopAcM_SetMtx(this, mpModel->getBaseTRMtx());
fopAcM_setCullSizeBox2(this, mpModel->getModelData());
field_0x5b2 = false;
field_0x5b1 = true;
return 1;
}
int daObj_Sekizo_c::Delete() {
#if DEBUG
if (mpHIO != NULL) {
mpHIO->removeHIO();
}
#endif
dComIfG_resDelete(&mPhaseReq, l_resNameList[l_bmdData[field_0x5b0].resIdx]);
return 1;
}
int daObj_Sekizo_c::Execute(Mtx** i_mtx) {
if (home.roomNo == dComIfGp_roomControl_getStayNo()) {
*i_mtx = &mBgMtx;
setBaseMtx();
if (field_0x5b2) {
if (field_0x5b1) {
dComIfG_Bgsp().Release(mpBgW);
field_0x5b1 = false;
}
} else if (!field_0x5b1) {
dComIfG_Bgsp().Regist(mpBgW, this);
field_0x5b1 = true;
}
}
return 1;
}
int daObj_Sekizo_c::Draw() {
if (!field_0x5b2) {
g_env_light.settingTevStruct(0x10, &current.pos, &tevStr);
g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr);
dComIfGd_setListBG();
mDoExt_modelUpdateDL(mpModel);
dComIfGd_setList();
}
return 1;
}
void daObj_Sekizo_c::initBaseMtx() {
mpModel->setBaseScale(scale);
setBaseMtx();
}
void daObj_Sekizo_c::setBaseMtx() {
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::YrotM(shape_angle.y);
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
cMtx_copy(mDoMtx_stack_c::get(), mBgMtx);
}
static int daObj_Sekizo_Create(void* i_this) {
return static_cast<daObj_Sekizo_c*>(i_this)->create();
}
static int daObj_Sekizo_Delete(void* i_this) {
return static_cast<daObj_Sekizo_c*>(i_this)->MoveBGDelete();
}
static int daObj_Sekizo_Execute(void* i_this) {
return static_cast<daObj_Sekizo_c*>(i_this)->MoveBGExecute();
}
static int daObj_Sekizo_Draw(void* i_this) {
return static_cast<daObj_Sekizo_c*>(i_this)->MoveBGDraw();
}
static int daObj_Sekizo_IsDelete(void* i_this) {
return 1;
}
static actor_method_class daObj_Sekizo_MethodTable = {
(process_method_func)daObj_Sekizo_Create, (process_method_func)daObj_Sekizo_Delete,
(process_method_func)daObj_Sekizo_Execute, (process_method_func)daObj_Sekizo_IsDelete,
(process_method_func)daObj_Sekizo_Draw};
actor_process_profile_definition g_profile_OBJ_SEKIZO = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 7,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_OBJ_SEKIZO_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(daObj_Sekizo_c),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Draw Prio */ fpcDwPi_OBJ_SEKIZO_e,
/* Actor SubMtd */ &daObj_Sekizo_MethodTable,
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_UNK_0x4000_e,
/* Group */ fopAc_ACTOR_e,
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
};