mirror of
https://github.com/zeldaret/tww.git
synced 2026-07-09 22:11:35 -04:00
8733e64147
* implement daObjTable functions * matches now in build, 100% * use inlines and make it cleaner * inlines * add only retail match --------- Co-authored-by: Onni <mail@onnileivo.com>
187 lines
5.6 KiB
C++
187 lines
5.6 KiB
C++
//
|
|
// Generated by dtk
|
|
// Translation Unit: d_a_obj_table.cpp
|
|
//
|
|
|
|
#include "d/actor/d_a_obj_table.h"
|
|
#include "JSystem/J3DGraphAnimator/J3DModel.h"
|
|
#include "SSystem/SComponent/c_phase.h"
|
|
#include "d/d_bg_w.h"
|
|
#include "d/d_com_inf_game.h"
|
|
#include "d/d_procname.h"
|
|
#include "d/d_priority.h"
|
|
#include "dolphin/types.h"
|
|
#include "f_op/f_op_actor_mng.h"
|
|
#include "m_Do/m_Do_mtx.h"
|
|
#include "d/res/res_table.h"
|
|
|
|
Mtx daObjTable::Act_c::M_tmp_mtx;
|
|
const char daObjTable::Act_c::M_arcname[6] = "Table";
|
|
|
|
/* 00000078-000001B8 .text CreateHeap__Q210daObjTable5Act_cFv */
|
|
BOOL daObjTable::Act_c::CreateHeap() {
|
|
J3DModelData *model_data;
|
|
J3DModel *model;
|
|
|
|
if (prm_get_mdl() == 0) {
|
|
model_data = (J3DModelData*) dComIfG_getObjectRes(M_arcname, TABLE_BDL_YTBLE);
|
|
JUT_ASSERT(0x51, model_data != NULL);
|
|
|
|
model = mDoExt_J3DModel__create(model_data, 0, 0x11020203);
|
|
mpModel = model;
|
|
} else {
|
|
model_data = (J3DModelData *) dComIfG_getObjectRes(M_arcname, TABLE_BDL_QCFIS);
|
|
|
|
JUT_ASSERT(0x57, model_data != NULL);
|
|
|
|
model = mDoExt_J3DModel__create(model_data, 0, 0x11020203);
|
|
mpModel = model;
|
|
}
|
|
return this->mpModel != NULL;
|
|
}
|
|
|
|
/* 000001B8-00000284 .text Create__Q210daObjTable5Act_cFv */
|
|
BOOL daObjTable::Act_c::Create() {
|
|
fopAcM_SetMtx(this, mpModel->getBaseTRMtx());
|
|
init_mtx();
|
|
fopAcM_setCullSizeBox(this, -80.0f, -1.0f, -80.0f, 80.0f, 205.0f, 80.0f);
|
|
if (prm_get_mdl() == 2 && mpBgW != NULL) {
|
|
if (mpBgW->ChkUsed()) {
|
|
dComIfG_Bgsp()->Release(mpBgW);
|
|
}
|
|
}
|
|
return TRUE;
|
|
}
|
|
|
|
/* 00000284-000003B4 .text Mthd_Create__Q210daObjTable5Act_cFv */
|
|
cPhs_State daObjTable::Act_c::Mthd_Create() {
|
|
cPhs_State phase_state;
|
|
fopAcM_SetupActor(this, Act_c);
|
|
|
|
phase_state = dComIfG_resLoad(&mPhs, M_arcname);
|
|
if (phase_state == cPhs_COMPLEATE_e) {
|
|
if (prm_get_mdl() == 0) {
|
|
phase_state = MoveBGCreate(M_arcname, TABLE_DZB_YTBLE, NULL, -1);
|
|
} else {
|
|
phase_state = MoveBGCreate(M_arcname, TABLE_DZB_QCFIS, NULL, -1);
|
|
}
|
|
|
|
JUT_ASSERT(0x8c, (phase_state == cPhs_COMPLEATE_e) || (phase_state == cPhs_ERROR_e));
|
|
}
|
|
|
|
return phase_state;
|
|
}
|
|
|
|
/* 000003B4-000003BC .text Delete__Q210daObjTable5Act_cFv */
|
|
BOOL daObjTable::Act_c::Delete() {
|
|
return TRUE;
|
|
}
|
|
|
|
/* 000003BC-00000408 .text Mthd_Delete__Q210daObjTable5Act_cFv */
|
|
BOOL daObjTable::Act_c::Mthd_Delete() {
|
|
BOOL ret = MoveBGDelete();
|
|
dComIfG_resDelete(&mPhs, M_arcname);
|
|
return ret;
|
|
}
|
|
|
|
/* 00000408-00000488 .text set_mtx__Q210daObjTable5Act_cFv */
|
|
void daObjTable::Act_c::set_mtx() {
|
|
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->setBaseTRMtx(mDoMtx_stack_c::get());
|
|
cMtx_copy(mDoMtx_stack_c::get(), M_tmp_mtx);
|
|
}
|
|
|
|
/* 00000488-000004C4 .text init_mtx__Q210daObjTable5Act_cFv */
|
|
void daObjTable::Act_c::init_mtx() {
|
|
mpModel->setBaseScale(scale);
|
|
set_mtx();
|
|
}
|
|
|
|
/* 000004C4-00000500 .text Execute__Q210daObjTable5Act_cFPPA3_A4_f */
|
|
BOOL daObjTable::Act_c::Execute(Mtx** matrix) {
|
|
set_mtx();
|
|
*matrix = &M_tmp_mtx;
|
|
return TRUE;
|
|
}
|
|
|
|
/* 00000500-00000608 .text Draw__Q210daObjTable5Act_cFv */
|
|
BOOL daObjTable::Act_c::Draw() {
|
|
f32 fVar;
|
|
cXyz pos[2];
|
|
|
|
g_env_light.settingTevStruct(TEV_TYPE_BG0, ¤t.pos, &tevStr);
|
|
g_env_light.setLightTevColorType(mpModel, &tevStr);
|
|
|
|
dComIfGd_setListBG();
|
|
mDoExt_modelUpdateDL(mpModel);
|
|
dComIfGd_setList();
|
|
|
|
if (prm_get_mdl() == 0) {
|
|
fVar = 120.0;
|
|
} else {
|
|
fVar = 30.0;
|
|
}
|
|
|
|
pos[0].x = 0.0;
|
|
pos[0].y = 1.0;
|
|
pos[0].z = 0.0;
|
|
|
|
dComIfGd_setSimpleShadow(¤t.pos, current.pos.y, fVar, pos, 0, 1.0);
|
|
return TRUE;
|
|
}
|
|
|
|
namespace daObjTable {
|
|
namespace {
|
|
/* 00000608-00000628 .text Mthd_Create__Q210daObjTable27@unnamed@d_a_obj_table_cpp@FPv */
|
|
cPhs_State Mthd_Create(void* i_this) {
|
|
return ((Act_c*) i_this)->Mthd_Create();
|
|
}
|
|
|
|
/* 00000628-00000648 .text Mthd_Delete__Q210daObjTable27@unnamed@d_a_obj_table_cpp@FPv */
|
|
BOOL Mthd_Delete(void* i_this) {
|
|
return ((Act_c*) i_this)->Mthd_Delete();
|
|
}
|
|
|
|
/* 00000648-00000668 .text Mthd_Execute__Q210daObjTable27@unnamed@d_a_obj_table_cpp@FPv */
|
|
BOOL Mthd_Execute(void* i_this) {
|
|
return ((Act_c*) i_this)->MoveBGExecute();
|
|
}
|
|
|
|
/* 00000668-00000694 .text Mthd_Draw__Q210daObjTable27@unnamed@d_a_obj_table_cpp@FPv */
|
|
BOOL Mthd_Draw(void* i_this) {
|
|
return ((Act_c*) i_this)->Draw();
|
|
}
|
|
|
|
/* 00000694-000006C0 .text Mthd_IsDelete__Q210daObjTable27@unnamed@d_a_obj_table_cpp@FPv */
|
|
BOOL Mthd_IsDelete(void* i_this) {
|
|
return ((Act_c*) i_this)->IsDelete();
|
|
}
|
|
|
|
static actor_method_class Mthd_Table = {
|
|
(process_method_func)Mthd_Create,
|
|
(process_method_func)Mthd_Delete,
|
|
(process_method_func)Mthd_Execute,
|
|
(process_method_func)Mthd_IsDelete,
|
|
(process_method_func)Mthd_Draw,
|
|
};
|
|
}; // namespace
|
|
}; // namespace daObjTable
|
|
|
|
actor_process_profile_definition g_profile_Obj_Table = {
|
|
/* LayerID */ fpcLy_CURRENT_e,
|
|
/* ListID */ 0x0007,
|
|
/* ListPrio */ fpcPi_CURRENT_e,
|
|
/* ProcName */ PROC_Obj_Table,
|
|
/* Proc SubMtd */ &g_fpcLf_Method.base,
|
|
/* Size */ sizeof(daObjTable::Act_c),
|
|
/* SizeOther */ 0,
|
|
/* Parameters */ 0,
|
|
/* Leaf SubMtd */ &g_fopAc_Method.base,
|
|
/* Priority */ PRIO_Obj_Table,
|
|
/* Actor SubMtd */ &daObjTable::Mthd_Table,
|
|
/* Status */ fopAcStts_NOCULLEXEC_e | fopAcStts_CULL_e | fopAcStts_UNK40000_e,
|
|
/* Group */ fopAc_ACTOR_e,
|
|
/* CullType */ fopAc_CULLBOX_CUSTOM_e,
|
|
};
|