diff --git a/configure.py b/configure.py index 6c3debe71..2ed4cbe62 100755 --- a/configure.py +++ b/configure.py @@ -1418,7 +1418,7 @@ config.libs = [ ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_shelf"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_shmrgrd", extra_cflags=["-sym off"]), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_swpush", extra_cflags=['-pragma "nosyminline on"']), - ActorRel(NonMatching, "d_a_obj_table"), + ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_table"), ActorRel(NonMatching, "d_a_obj_tenmado"), ActorRel(NonMatching, "d_a_obj_tide"), ActorRel(Matching, "d_a_obj_timer"), diff --git a/include/d/actor/d_a_obj_table.h b/include/d/actor/d_a_obj_table.h index 17e9a6391..87ecb2df6 100644 --- a/include/d/actor/d_a_obj_table.h +++ b/include/d/actor/d_a_obj_table.h @@ -1,15 +1,14 @@ #ifndef D_A_OBJ_TABLE_H #define D_A_OBJ_TABLE_H +#include "d/d_a_obj.h" #include "f_op/f_op_actor.h" #include "d/d_bg_s_movebg_actor.h" #include "SSystem/SComponent/c_phase.h" namespace daObjTable { class Act_c : public dBgS_MoveBgActor { - public: - void prm_get_mdl() const {} - + public: virtual BOOL CreateHeap(); virtual BOOL Create(); cPhs_State Mthd_Create(); @@ -19,7 +18,15 @@ namespace daObjTable { void init_mtx(); virtual BOOL Execute(Mtx**); virtual BOOL Draw(); - + + u8 prm_get_mdl() const { return daObj::PrmAbstract(this, PRM_MDL_W, PRM_MDL_S); } + static Mtx M_tmp_mtx; + static const char M_arcname[6]; + enum Prm_e { + PRM_MDL_W = 8, + PRM_MDL_S = 0, + }; + public: /* 0x2C8 */ request_of_phase_process_class mPhs; /* 0x2D0 */ J3DModel* mpModel; diff --git a/src/d/actor/d_a_obj_table.cpp b/src/d/actor/d_a_obj_table.cpp index 27c33d6a1..2e4f46fa2 100644 --- a/src/d/actor/d_a_obj_table.cpp +++ b/src/d/actor/d_a_obj_table.cpp @@ -4,79 +4,158 @@ // #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() { - /* Nonmatching */ + 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() { - /* Nonmatching */ + 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() { - /* Nonmatching */ + 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() { - /* Nonmatching */ + return TRUE; } /* 000003BC-00000408 .text Mthd_Delete__Q210daObjTable5Act_cFv */ BOOL daObjTable::Act_c::Mthd_Delete() { - /* Nonmatching */ + BOOL ret = MoveBGDelete(); + dComIfG_resDelete(&mPhs, M_arcname); + return ret; } /* 00000408-00000488 .text set_mtx__Q210daObjTable5Act_cFv */ void daObjTable::Act_c::set_mtx() { - /* Nonmatching */ + 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() { - /* Nonmatching */ + mpModel->setBaseScale(scale); + set_mtx(); } /* 000004C4-00000500 .text Execute__Q210daObjTable5Act_cFPPA3_A4_f */ -BOOL daObjTable::Act_c::Execute(Mtx**) { - /* Nonmatching */ +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() { - /* Nonmatching */ + 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*) { - /* Nonmatching */ +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*) { - /* Nonmatching */ +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*) { - /* Nonmatching */ +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*) { - /* Nonmatching */ +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*) { - /* Nonmatching */ +BOOL Mthd_IsDelete(void* i_this) { + return ((Act_c*) i_this)->IsDelete(); } static actor_method_class Mthd_Table = {