Skip to content

Commit

Permalink
d_a_obj_usovmc
Browse files Browse the repository at this point in the history
fixes #445
  • Loading branch information
magcius committed Sep 2, 2024
1 parent 00eb28e commit e6a4022
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 35 deletions.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,7 @@ def JSystemLib(lib_name, objects):
ActorRel(NonMatching, "d_a_obj_trap"),
ActorRel(NonMatching, "d_a_obj_tribox"),
ActorRel(NonMatching, "d_a_obj_try"),
ActorRel(NonMatching, "d_a_obj_usovmc"),
ActorRel(Matching, "d_a_obj_usovmc"),
ActorRel(Matching, "d_a_obj_vfan", extra_cflags=[ '-pragma "nosyminline on"']),
ActorRel(NonMatching, "d_a_obj_vgnfd"),
ActorRel(Matching, "d_a_obj_vmc", extra_cflags=["-sym off"]),
Expand Down
27 changes: 17 additions & 10 deletions include/d/actor/d_a_obj_usovmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,29 @@
#define D_A_OBJ_USOVMC_H

#include "f_op/f_op_actor.h"
#include "d/d_bg_s_movebg_actor.h"

namespace daObjUsovmc {
class Act_c : public fopAc_ac_c {
class Act_c : public dBgS_MoveBgActor {
public:
void CreateHeap();
s32 Create();
void Mthd_Create();
BOOL Delete();
void Mthd_Delete();
virtual int CreateHeap() /* override */;
virtual int Create() /* override */;
virtual int Delete() /* override */;
virtual int Execute(Mtx**) /* override */;
virtual int Draw() /* override */;

s32 Mthd_Create();
BOOL Mthd_Delete();
void set_mtx();
void init_mtx();
void Execute(float(**)[3][4]);
BOOL Draw();


public:
static const char M_arcname[];
static Mtx M_tmp_mtx;

public:
/* Place member variables here */
/* 0x2C8 */ request_of_phase_process_class mPhs;
/* 0x2D0 */ J3DModel* mModel;
};
};

Expand Down
80 changes: 56 additions & 24 deletions src/d/actor/d_a_obj_usovmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,110 @@
//

#include "d/actor/d_a_obj_usovmc.h"
#include "d/d_com_inf_game.h"
#include "d/d_procname.h"
#include "d/res/res_usovmc.h"

const char daObjUsovmc::Act_c::M_arcname[7] = "Usovmc";
Mtx daObjUsovmc::Act_c::M_tmp_mtx;

/* 00000078-0000012C .text CreateHeap__Q211daObjUsovmc5Act_cFv */
void daObjUsovmc::Act_c::CreateHeap() {
/* Nonmatching */
int daObjUsovmc::Act_c::CreateHeap() {
J3DModelData* model_data = (J3DModelData*)dComIfG_getObjectRes(M_arcname, USOVMC_BDL_VMCBX);
JUT_ASSERT(0x4a, model_data != NULL);
mModel = mDoExt_J3DModel__create(model_data, 0, 0x11020203);
return mModel != NULL;
}

/* 0000012C-00000198 .text Create__Q211daObjUsovmc5Act_cFv */
s32 daObjUsovmc::Act_c::Create() {
/* Nonmatching */
int daObjUsovmc::Act_c::Create() {
fopAcM_SetMtx(this, mModel->getBaseTRMtx());
init_mtx();
fopAcM_setCullSizeBox(this, -80.0f, -1.0f, -80.0f, 80.0f, 205.0f, 80.0f);
return TRUE;
}

/* 00000198-00000290 .text Mthd_Create__Q211daObjUsovmc5Act_cFv */
void daObjUsovmc::Act_c::Mthd_Create() {
/* Nonmatching */
s32 daObjUsovmc::Act_c::Mthd_Create() {
fopAcM_SetupActor(this, Act_c);

s32 phase_state = dComIfG_resLoad(&mPhs, M_arcname);
if (phase_state == cPhs_COMPLEATE_e) {
phase_state = MoveBGCreate(M_arcname, USOVMC_DZB_VMCBS, NULL, 0);
JUT_ASSERT(0x74, (phase_state == cPhs_COMPLEATE_e) || (phase_state == cPhs_ERROR_e));
}

return phase_state;
}

/* 00000290-00000298 .text Delete__Q211daObjUsovmc5Act_cFv */
BOOL daObjUsovmc::Act_c::Delete() {
/* Nonmatching */
return TRUE;
}

/* 00000298-000002E4 .text Mthd_Delete__Q211daObjUsovmc5Act_cFv */
void daObjUsovmc::Act_c::Mthd_Delete() {
/* Nonmatching */
BOOL daObjUsovmc::Act_c::Mthd_Delete() {
s32 ret = MoveBGDelete();
dComIfG_resDelete(&mPhs, M_arcname);
return ret;
}

/* 000002E4-00000364 .text set_mtx__Q211daObjUsovmc5Act_cFv */
void daObjUsovmc::Act_c::set_mtx() {
/* Nonmatching */
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::ZXYrotM(shape_angle);
mModel->setBaseTRMtx(mDoMtx_stack_c::get());
mDoMtx_copy(mDoMtx_stack_c::get(), M_tmp_mtx);
}

/* 00000364-000003A0 .text init_mtx__Q211daObjUsovmc5Act_cFv */
void daObjUsovmc::Act_c::init_mtx() {
/* Nonmatching */
mModel->setBaseScale(scale);
set_mtx();
}

/* 000003A0-000003DC .text Execute__Q211daObjUsovmc5Act_cFPPA3_A4_f */
void daObjUsovmc::Act_c::Execute(float(**)[3][4]) {
/* Nonmatching */
int daObjUsovmc::Act_c::Execute(Mtx** mtx) {
set_mtx();
*mtx = &M_tmp_mtx;
return TRUE;
}

/* 000003DC-0000047C .text Draw__Q211daObjUsovmc5Act_cFv */
BOOL daObjUsovmc::Act_c::Draw() {
/* Nonmatching */
g_env_light.settingTevStruct(TEV_TYPE_BG0, &current.pos, &tevStr);
g_env_light.setLightTevColorType(mModel, &tevStr);
dComIfGd_setListBG();
mDoExt_modelUpdateDL(mModel);
dComIfGd_setList();
return TRUE;
}

namespace daObjUsovmc {
namespace {
/* 0000047C-0000049C .text Mthd_Create__Q211daObjUsovmc28@unnamed@d_a_obj_usovmc_cpp@FPv */
void Mthd_Create(void*) {
/* Nonmatching */
s32 Mthd_Create(void* i_ac) {
return ((Act_c*)i_ac)->Mthd_Create();
}

/* 0000049C-000004BC .text Mthd_Delete__Q211daObjUsovmc28@unnamed@d_a_obj_usovmc_cpp@FPv */
void Mthd_Delete(void*) {
/* Nonmatching */
BOOL Mthd_Delete(void* i_ac) {
return ((Act_c*)i_ac)->Mthd_Delete();
}

/* 000004BC-000004DC .text Mthd_Execute__Q211daObjUsovmc28@unnamed@d_a_obj_usovmc_cpp@FPv */
void Mthd_Execute(void*) {
/* Nonmatching */
BOOL Mthd_Execute(void* i_ac) {
return ((Act_c*)i_ac)->MoveBGExecute();
}

/* 000004DC-00000508 .text Mthd_Draw__Q211daObjUsovmc28@unnamed@d_a_obj_usovmc_cpp@FPv */
void Mthd_Draw(void*) {
/* Nonmatching */
BOOL Mthd_Draw(void* i_ac) {
return ((Act_c*)i_ac)->MoveBGDraw();
}

/* 00000508-00000534 .text Mthd_IsDelete__Q211daObjUsovmc28@unnamed@d_a_obj_usovmc_cpp@FPv */
void Mthd_IsDelete(void*) {
/* Nonmatching */
BOOL Mthd_IsDelete(void* i_ac) {
return ((Act_c*)i_ac)->MoveBGIsDelete();
}

static actor_method_class Mthd_Usovmc = {
Expand Down

0 comments on commit e6a4022

Please sign in to comment.