d_a_swtdoor 90%

This commit is contained in:
Jasper St. Pierre
2023-10-20 21:14:00 -07:00
parent fed6248532
commit f890e8b293
3 changed files with 105 additions and 121 deletions
+97 -14
View File
@@ -3,36 +3,119 @@
// Translation Unit: d_a_swtdoor.cpp
//
#include "d_a_swtdoor.h"
#include "dolphin/types.h"
#include "f_op/f_op_actor_mng.h"
#include "d/d_com_inf_game.h"
#include "d/d_procname.h"
#include "d/actor/d_a_player.h"
#include "m_Do/m_Do_ext.h"
#include "m_Do/m_Do_mtx.h"
#include "SSystem/SComponent/c_lib.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JUtility/JUTAssert.h"
class swtdoor_class : public fopAc_ac_c {
public:
/* 0x290 */ request_of_phase_process_class mPhs;
/* 0x298 */ J3DModel * model;
/* 0x29C */ u8 field_0x29c;
/* 0x29D */ u8 mSwitchNo;
};
/* 00000078-000000C4 .text daSwtdoor_Draw__FP13swtdoor_class */
void daSwtdoor_Draw(swtdoor_class*) {
/* Nonmatching */
BOOL daSwtdoor_Draw(swtdoor_class* i_this) {
J3DModel * model = i_this->model;
g_env_light.setLightTevColorType(model, &i_this->mTevStr);
mDoExt_modelUpdateDL(model);
return TRUE;
}
/* 000000C4-000001BC .text daSwtdoor_Execute__FP13swtdoor_class */
void daSwtdoor_Execute(swtdoor_class*) {
/* Nonmatching */
BOOL daSwtdoor_Execute(swtdoor_class* i_this) {
g_env_light.settingTevStruct(TEV_TYPE_BG0, i_this->getPositionP(), &i_this->mTevStr);
if (dComIfGs_isSwitch(i_this->mSwitchNo, fopAcM_GetRoomNo(i_this)) && i_this->orig.pos.y > -300.0f)
i_this->orig.pos.y -= 10.0f;
MtxTrans(i_this->current.pos.x, i_this->current.pos.y + i_this->orig.pos.y, i_this->current.pos.z, false);
mDoMtx_YrotM(*calc_mtx, i_this->current.angle.y);
mDoMtx_XrotM(*calc_mtx, i_this->current.angle.x);
mDoMtx_ZrotM(*calc_mtx, i_this->current.angle.z);
i_this->model->setBaseTRMtx(*calc_mtx);
return TRUE;
}
/* 000001BC-000001C4 .text daSwtdoor_IsDelete__FP13swtdoor_class */
void daSwtdoor_IsDelete(swtdoor_class*) {
/* Nonmatching */
BOOL daSwtdoor_IsDelete(swtdoor_class* i_this) {
return TRUE;
}
/* 000001C4-000001F4 .text daSwtdoor_Delete__FP13swtdoor_class */
void daSwtdoor_Delete(swtdoor_class*) {
/* Nonmatching */
BOOL daSwtdoor_Delete(swtdoor_class* i_this) {
dComIfG_resDelete(&i_this->mPhs, "Swtdoor");
return TRUE;
}
/* 000001F4-00000260 .text useHeapInit__FP10fopAc_ac_c */
void useHeapInit(fopAc_ac_c*) {
/* Nonmatching */
BOOL useHeapInit(fopAc_ac_c* i_ac) {
swtdoor_class * i_this = (swtdoor_class *)i_ac;
J3DModelData * modelData = (J3DModelData *)dComIfG_getObjectRes("Swtdoor", 3);
i_this->model = mDoExt_J3DModel__create(modelData, 0, 0x11020203);
if (i_this->model == NULL)
return FALSE;
return TRUE;
}
/* 00000260-00000374 .text daSwtdoor_Create__FP10fopAc_ac_c */
void daSwtdoor_Create(fopAc_ac_c*) {
/* Nonmatching */
s32 daSwtdoor_Create(fopAc_ac_c* i_ac) {
/* Nonmatching - r30/r31 regswap */
swtdoor_class * i_this;
fopAcM_SetupActor(i_ac, swtdoor_class);
i_this = (swtdoor_class *)i_ac;
s32 rt = dComIfG_resLoad(&i_this->mPhs, "Swtdoor");
if (rt == cPhs_ERROR_e)
return cPhs_ERROR_e;
if (rt != cPhs_COMPLEATE_e)
return rt;
i_this->field_0x29c = (fopAcM_GetParam(i_this) >> 0) & 0xFF;
if (i_this->field_0x29c == 0xFF)
i_this->field_0x29c = 0;
i_this->mSwitchNo = (fopAcM_GetParam(i_this) >> 24) & 0xFF;
if (fopAcM_entrySolidHeap(i_this, useHeapInit, 0x3000) == 0)
return cPhs_ERROR_e;
fopAcM_SetMin(i_this, -2000.0f, -1000.0f, -2000.0f);
fopAcM_SetMax(i_this, 2000.0f, 1000.0f, 2000.0f);
fopAcM_SetMtx(i_this, i_this->model->getBaseTRMtx());
i_this->orig.pos.y = 0.0f;
return cPhs_COMPLEATE_e;
}
actor_method_class l_daSwtdoor_Method = {
(process_method_func)daSwtdoor_Create,
(process_method_func)daSwtdoor_Delete,
(process_method_func)daSwtdoor_Execute,
(process_method_func)daSwtdoor_IsDelete,
(process_method_func)daSwtdoor_Draw,
};
actor_process_profile_definition g_profile_SWTDOOR = {
fpcLy_CURRENT_e,
7,
fpcPi_CURRENT_e,
PROC_SWTDOOR,
&g_fpcLf_Method.mBase,
sizeof(swtdoor_class),
0,
0,
&g_fopAc_Method.base,
0x00ED,
&l_daSwtdoor_Method,
fopAcStts_CULL_e | fopAcStts_UNK40000_e,
fopAc_ACTOR_e,
fopAc_CULLBOX_CUSTOM_e,
};