mirror of
https://github.com/zeldaret/tww.git
synced 2026-05-23 06:54:16 -04:00
136 lines
3.9 KiB
C++
136 lines
3.9 KiB
C++
//
|
|
// Generated by dtk
|
|
// Translation Unit: d_throwstone.cpp
|
|
//
|
|
|
|
#include "d/d_throwstone.h"
|
|
#include "d/res/res_aisi.h"
|
|
#include "f_op/f_op_actor.h"
|
|
#include "f_op/f_op_actor_mng.h"
|
|
#include "d/d_com_inf_game.h"
|
|
#include "d/d_demo.h"
|
|
#include "d/d_procname.h"
|
|
#include "m_Do/m_Do_mtx.h"
|
|
|
|
const char daThrowstone_c::M_arcname[] = "Aisi";
|
|
|
|
/* 8023B544-8023B564 .text CheckCreateHeap__FP10fopAc_ac_c */
|
|
static BOOL CheckCreateHeap(fopAc_ac_c* i_actor) {
|
|
daThrowstone_c* i_this = (daThrowstone_c*)i_actor;
|
|
return i_this->CreateHeap();
|
|
}
|
|
|
|
/* 8023B564-8023B5DC .text CreateHeap__14daThrowstone_cFv */
|
|
BOOL daThrowstone_c::CreateHeap() {
|
|
J3DModelData* pModelData = (J3DModelData*)dComIfG_getObjectRes(M_arcname, AISI_INDEX_BDL_AISI);
|
|
if (pModelData == NULL)
|
|
return FALSE;
|
|
|
|
mpModel = mDoExt_J3DModel__create(pModelData, 0x80000, 0x11000002);
|
|
return (mpModel != NULL) ? TRUE : FALSE;
|
|
}
|
|
|
|
cPhs_State daThrowstone_c::_create() {
|
|
cPhs_State result = dComIfG_resLoad(&mPhs, M_arcname);
|
|
|
|
if (result == cPhs_COMPLEATE_e) {
|
|
fopAcM_SetupActor(this, daThrowstone_c);
|
|
|
|
if (!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0x4C0)) {
|
|
result = cPhs_ERROR_e;
|
|
} else {
|
|
mDoMtx_stack_c::transS(current.pos);
|
|
mDoMtx_stack_c::YrotM(shape_angle.y);
|
|
mDoMtx_stack_c::scaleM(scale);
|
|
|
|
mDoMtx_copy(mDoMtx_stack_c::get(), mMtx);
|
|
fopAcM_SetMtx(this, mpModel->getBaseTRMtx());
|
|
|
|
mDoMtx_copy(mpModel->getBaseTRMtx(), mMtx);
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/* 8023B5DC-8023B6DC .text daThrowstoneCreate__FPv */
|
|
static s32 daThrowstoneCreate(void* ptr) {
|
|
return ((daThrowstone_c*)ptr)->_create();
|
|
}
|
|
|
|
bool daThrowstone_c::_delete() {
|
|
dComIfG_resDelete(&mPhs, M_arcname);
|
|
return TRUE;
|
|
}
|
|
|
|
/* 8023B6DC-8023B708 .text daThrowstoneDelete__FPv */
|
|
static BOOL daThrowstoneDelete(void* ptr) {
|
|
return ((daThrowstone_c*)ptr)->_delete();
|
|
}
|
|
|
|
bool daThrowstone_c::_execute() {
|
|
dDemo_setDemoData(this, 0x6a, NULL, NULL, 0, NULL, 0, 0);
|
|
|
|
mpModel->setBaseScale(scale);
|
|
f32 pos_x = current.pos.x;
|
|
mDoMtx_stack_c::transS(pos_x, current.pos.y, current.pos.z);
|
|
s16 rot_x = shape_angle.x;
|
|
mDoMtx_stack_c::ZXYrotM(rot_x, shape_angle.y, shape_angle.z);
|
|
|
|
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
|
|
mDoMtx_copy(mDoMtx_stack_c::get(), mMtx);
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
/* 8023B708-8023B7C4 .text daThrowstoneExecute__FPv */
|
|
static BOOL daThrowstoneExecute(void* ptr) {
|
|
return ((daThrowstone_c*)ptr)->_execute();
|
|
}
|
|
|
|
bool daThrowstone_c::_draw() {
|
|
if (!dComIfGs_isEventBit(0x0310))
|
|
return TRUE;
|
|
|
|
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, ¤t.pos, &tevStr);
|
|
g_env_light.setLightTevColorType(mpModel, &tevStr);
|
|
mDoExt_modelUpdateDL(mpModel);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
/* 8023B7C4-8023B858 .text daThrowstoneDraw__FPv */
|
|
static BOOL daThrowstoneDraw(void* ptr) {
|
|
return ((daThrowstone_c*)ptr)->_draw();
|
|
}
|
|
|
|
/* 8023B858-8023B860 .text daThrowstoneIsDelete__FPv */
|
|
static BOOL daThrowstoneIsDelete(void*) {
|
|
return TRUE;
|
|
}
|
|
|
|
static actor_method_class daThrowstoneMethodTable = {
|
|
(process_method_func)daThrowstoneCreate,
|
|
(process_method_func)daThrowstoneDelete,
|
|
(process_method_func)daThrowstoneExecute,
|
|
(process_method_func)daThrowstoneIsDelete,
|
|
(process_method_func)daThrowstoneDraw,
|
|
};
|
|
|
|
actor_process_profile_definition g_profile_THROWSTONE = {
|
|
/* LayerID */ fpcLy_CURRENT_e,
|
|
/* ListID */ 0x0002,
|
|
/* ListPrio */ fpcPi_CURRENT_e,
|
|
/* ProcName */ PROC_THROWSTONE,
|
|
/* Proc SubMtd */ &g_fpcLf_Method.base,
|
|
/* Size */ sizeof(daThrowstone_c),
|
|
/* SizeOther */ 0,
|
|
/* Parameters */ 0,
|
|
/* Leaf SubMtd */ &g_fopAc_Method.base,
|
|
/* Priority */ 0x01CE,
|
|
/* Actor SubMtd */ &daThrowstoneMethodTable,
|
|
/* Status */ fopAcStts_CULL_e | fopAcStts_UNK40000_e,
|
|
/* Group */ fopAc_ACTOR_e,
|
|
/* CullType */ fopAc_CULLBOX_0_e,
|
|
};
|