mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-08 11:47:03 -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>
113 lines
3.3 KiB
C++
113 lines
3.3 KiB
C++
/**
|
|
* d_a_obj_hsTarget.cpp
|
|
* Object - Hookshot Target
|
|
*/
|
|
|
|
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
|
|
|
#include "d/actor/d_a_obj_hsTarget.h"
|
|
#include "d/d_com_inf_game.h"
|
|
#include "f_pc/f_pc_name.h"
|
|
|
|
static const char* l_resNameIdx[2] = {"hsMato", "L7HsMato"};
|
|
|
|
daHsTarget_HIO_c::daHsTarget_HIO_c() {}
|
|
|
|
void daHsTarget_c::setBaseMtx() {
|
|
mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
|
|
mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z);
|
|
mpModel->setBaseScale(scale);
|
|
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
|
|
}
|
|
|
|
static const u32 l_bmdIdx[2] = {4, 4};
|
|
|
|
int daHsTarget_c::CreateHeap() {
|
|
mpModel = mDoExt_J3DModel__create(
|
|
(J3DModelData*)dComIfG_getObjectRes(l_resNameIdx[mIndex], l_bmdIdx[mIndex]),
|
|
0x80000, 0x11000084);
|
|
return mpModel != NULL ? 1 : 0;
|
|
}
|
|
|
|
static const u32 l_dzbIdx[2] = {7, 7};
|
|
|
|
int daHsTarget_c::create() {
|
|
fopAcM_ct(this, daHsTarget_c);
|
|
|
|
mIndex = getModelType();
|
|
if (mIndex == 0x0f) {
|
|
mIndex = 0;
|
|
}
|
|
int phase = dComIfG_resLoad(&mPhaseReq, l_resNameIdx[mIndex]);
|
|
if (phase == cPhs_COMPLEATE_e) {
|
|
if (MoveBGCreate(l_resNameIdx[mIndex], l_dzbIdx[mIndex],
|
|
dBgS_MoveBGProc_TypicalRotY, 0xac0, NULL) == cPhs_ERROR_e)
|
|
{
|
|
return cPhs_ERROR_e;
|
|
} else {
|
|
fopAcM_SetMtx(this, mpModel->mBaseTransformMtx);
|
|
fopAcM_setCullSizeBox2(this, mpModel->getModelData());
|
|
setBaseMtx();
|
|
}
|
|
}
|
|
return phase;
|
|
}
|
|
|
|
int daHsTarget_c::Execute(Mtx** param_0) {
|
|
*param_0 = &mpModel->getBaseTRMtx();
|
|
return 1;
|
|
}
|
|
|
|
int daHsTarget_c::Draw() {
|
|
g_env_light.settingTevStruct(0x40, ¤t.pos, &tevStr);
|
|
g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr);
|
|
mDoExt_modelUpdateDL(mpModel);
|
|
return 1;
|
|
}
|
|
|
|
int daHsTarget_c::Delete() {
|
|
dComIfG_resDelete(&mPhaseReq, l_resNameIdx[mIndex]);
|
|
return 1;
|
|
}
|
|
|
|
static int daHsTarget_Draw(daHsTarget_c* i_this) {
|
|
return static_cast<dBgS_MoveBgActor*>(i_this)->MoveBGDraw();
|
|
}
|
|
|
|
static int daHsTarget_Execute(daHsTarget_c* i_this) {
|
|
return static_cast<dBgS_MoveBgActor*>(i_this)->MoveBGExecute();
|
|
}
|
|
|
|
static int daHsTarget_Delete(daHsTarget_c* i_this) {
|
|
return static_cast<dBgS_MoveBgActor*>(i_this)->MoveBGDelete();
|
|
}
|
|
|
|
static int daHsTarget_Create(fopAc_ac_c* i_this) {
|
|
return static_cast<daHsTarget_c*>(i_this)->create();
|
|
}
|
|
|
|
static daHsTarget_HIO_c l_HIO;
|
|
|
|
static actor_method_class l_daHsTarget_Method = {
|
|
(process_method_func)daHsTarget_Create, (process_method_func)daHsTarget_Delete,
|
|
(process_method_func)daHsTarget_Execute, (process_method_func)NULL,
|
|
(process_method_func)daHsTarget_Draw,
|
|
};
|
|
|
|
actor_process_profile_definition g_profile_Obj_HsTarget = {
|
|
/* Layer ID */ fpcLy_CURRENT_e,
|
|
/* List ID */ 3,
|
|
/* List Prio */ fpcPi_CURRENT_e,
|
|
/* Proc Name */ fpcNm_Obj_HsTarget_e,
|
|
/* Proc SubMtd */ &g_fpcLf_Method.base,
|
|
/* Size */ sizeof(daHsTarget_c),
|
|
/* Size Other */ 0,
|
|
/* Parameters */ 0,
|
|
/* Leaf SubMtd */ &g_fopAc_Method.base,
|
|
/* Draw Prio */ fpcDwPi_Obj_HsTarget_e,
|
|
/* Actor SubMtd */ &l_daHsTarget_Method,
|
|
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_CULL_e,
|
|
/* Group */ fopAc_ACTOR_e,
|
|
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
|
|
};
|