mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-17 22:12:43 -04:00
56890c32e8
* 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>
131 lines
3.9 KiB
C++
131 lines
3.9 KiB
C++
/**
|
|
* d_a_obj_kjgjs.cpp
|
|
* Object - Kjgjs
|
|
*/
|
|
|
|
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
|
|
|
#include "d/actor/d_a_obj_kjgjs.h"
|
|
#include "d/d_bg_w.h"
|
|
#include "f_pc/f_pc_name.h"
|
|
|
|
static const u32 l_dzbidx[2] = {8, 9};
|
|
static const char* l_arcName = "K_jgjs";
|
|
|
|
int daObjKJgjs_c::create1st() {
|
|
int phase = dComIfG_resLoad(this, l_arcName);
|
|
if (phase == cPhs_COMPLEATE_e) {
|
|
setMtx();
|
|
field_0x60c = getType();
|
|
if (field_0x60c < 0) {
|
|
field_0x60c = 0;
|
|
} else if (field_0x60c > 2) {
|
|
field_0x60c = 1;
|
|
}
|
|
phase = MoveBGCreate(l_arcName, l_dzbidx[field_0x60c], dBgS_MoveBGProc_TypicalRotY, 0x47f0,
|
|
&mMtx[0]);
|
|
|
|
if (phase == cPhs_ERROR_e) {
|
|
return phase;
|
|
}
|
|
}
|
|
return phase;
|
|
}
|
|
|
|
void daObjKJgjs_c::setMtx() {
|
|
mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
|
|
mDoMtx_stack_c::XYZrotM(current.angle.x, current.angle.y, current.angle.z);
|
|
MTXCopy(mDoMtx_stack_c::now, mMtx[1]);
|
|
MTXCopy(mDoMtx_stack_c::now, mMtx[0]);
|
|
}
|
|
|
|
static const u32 l_bmdidx[2] = {4, 5};
|
|
|
|
int daObjKJgjs_c::CreateHeap() {
|
|
mpModel = mDoExt_J3DModel__create(
|
|
(J3DModelData*)dComIfG_getObjectRes(l_arcName, l_bmdidx[field_0x60c]), 0x80000, 0x11000084);
|
|
return mpModel != NULL ? 1 : 0;
|
|
}
|
|
|
|
static const cull_box l_cull_box[2] = {
|
|
{{-1260.0f, -3050.0f, -1260.0f},
|
|
{1260.0f, 2800.0f, 1260.0f}},
|
|
{{-76.37f, -10.83f, -78.51},
|
|
{75.52f, 10.95f, 78.06f}},
|
|
};
|
|
|
|
int daObjKJgjs_c::Create() {
|
|
fopAcM_SetMtx(this, mMtx[1]);
|
|
MTXCopy(mMtx[1], mpModel->mBaseTransformMtx);
|
|
mpBgW->OffRoofRegist();
|
|
if (!field_0x60c) {
|
|
fopAcM_setCullSizeBox(this, l_cull_box[0].min.x, l_cull_box[0].min.y, l_cull_box[0].min.z,
|
|
l_cull_box[0].max.x, l_cull_box[0].max.y, l_cull_box[0].max.z);
|
|
} else {
|
|
fopAcM_setCullSizeBox(this, l_cull_box[1].min.x, l_cull_box[1].min.y, l_cull_box[1].min.z,
|
|
l_cull_box[1].max.x, l_cull_box[1].max.y, l_cull_box[1].max.z);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
int daObjKJgjs_c::Execute(f32 (**i_mtx)[3][4]) {
|
|
*i_mtx = mMtx;
|
|
return 1;
|
|
}
|
|
|
|
int daObjKJgjs_c::Draw() {
|
|
g_env_light.settingTevStruct(0x10, ¤t.pos, &tevStr);
|
|
g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr);
|
|
dComIfGd_setListBG();
|
|
mDoExt_modelUpdateDL(mpModel);
|
|
dComIfGd_setList();
|
|
return 1;
|
|
}
|
|
|
|
int daObjKJgjs_c::Delete() {
|
|
dComIfG_resDelete(this, l_arcName);
|
|
return 1;
|
|
}
|
|
|
|
static int daObjKJgjs_create1st(daObjKJgjs_c* i_this) {
|
|
fopAcM_ct(i_this, daObjKJgjs_c);
|
|
return i_this->create1st();
|
|
}
|
|
|
|
static int daObjKJgjs_MoveBGDelete(daObjKJgjs_c* i_this) {
|
|
return static_cast<dBgS_MoveBgActor*>(i_this)->MoveBGDelete();
|
|
}
|
|
|
|
static int daObjKJgjs_MoveBGExecute(daObjKJgjs_c* i_this) {
|
|
return static_cast<dBgS_MoveBgActor*>(i_this)->MoveBGExecute();
|
|
}
|
|
|
|
static int daObjKJgjs_MoveBGDraw(daObjKJgjs_c* i_this) {
|
|
return static_cast<dBgS_MoveBgActor*>(i_this)->MoveBGDraw();
|
|
}
|
|
|
|
daObjKJgjs_c::~daObjKJgjs_c() {}
|
|
|
|
static actor_method_class daObjKJgjs_METHODS = {
|
|
(process_method_func)daObjKJgjs_create1st, (process_method_func)daObjKJgjs_MoveBGDelete,
|
|
(process_method_func)daObjKJgjs_MoveBGExecute, (process_method_func)NULL,
|
|
(process_method_func)daObjKJgjs_MoveBGDraw,
|
|
};
|
|
|
|
actor_process_profile_definition g_profile_Obj_KJgjs = {
|
|
/* Layer ID */ fpcLy_CURRENT_e,
|
|
/* List ID */ 3,
|
|
/* List Prio */ fpcPi_CURRENT_e,
|
|
/* Proc Name */ fpcNm_Obj_KJgjs_e,
|
|
/* Proc SubMtd */ &g_fpcLf_Method.base,
|
|
/* Size */ sizeof(daObjKJgjs_c),
|
|
/* Size Other */ 0,
|
|
/* Parameters */ 0,
|
|
/* Leaf SubMtd */ &g_fopAc_Method.base,
|
|
/* Draw Prio */ fpcDwPi_Obj_KJgjs_e,
|
|
/* Actor SubMtd */ &daObjKJgjs_METHODS,
|
|
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_CULL_e,
|
|
/* Group */ fopAc_ACTOR_e,
|
|
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
|
|
};
|