mirror of
https://github.com/zeldaret/tww.git
synced 2026-05-23 06:54:16 -04:00
d_a_tori_flag 100% (#689)
* d_a_tori_flag 100% Had to add a constructor for `dCloth_packet_c`, may want to reconsider the naming of certain members of `daTori_Flag_HIO_c` in the future. * d_a_tori_flag 100% configuration * Requested PR changes made * added proper inline functions
This commit is contained in:
@@ -33,3 +33,4 @@ compile_commands.json
|
||||
# Miscellaneous
|
||||
/*.txt
|
||||
*.exe
|
||||
.DS_Store
|
||||
|
||||
+1
-1
@@ -1730,7 +1730,7 @@ config.libs = [
|
||||
ActorRel(Matching, "d_a_title", extra_cflags=['-pragma "nosyminline on"']),
|
||||
ActorRel(NonMatching, "d_a_tn"),
|
||||
ActorRel(Matching, "d_a_toge", extra_cflags=['-pragma "nosyminline on"']),
|
||||
ActorRel(NonMatching, "d_a_tori_flag"),
|
||||
ActorRel(Matching, "d_a_tori_flag", extra_cflags=['-pragma "nosyminline on"']),
|
||||
ActorRel(Matching, "d_a_wall", extra_cflags=['-pragma "nosyminline on"']),
|
||||
ActorRel(Matching, "d_a_warpfout"),
|
||||
ActorRel(NonMatching, "d_a_warpgn"),
|
||||
|
||||
@@ -6,6 +6,21 @@
|
||||
#include "SSystem/SComponent/c_phase.h"
|
||||
#include "d/d_cloth_packet.h"
|
||||
|
||||
class daTori_Flag_HIO_c {
|
||||
public:
|
||||
// Constructor
|
||||
daTori_Flag_HIO_c();
|
||||
|
||||
// Virtual Destructor
|
||||
virtual ~daTori_Flag_HIO_c(){}
|
||||
|
||||
public:
|
||||
/* 0x00 */ //vtable
|
||||
/* 0x04 */ signed char mNo;
|
||||
/* 0x08 */ float someFloat;
|
||||
/* 0x0c */ signed short someShort;
|
||||
};
|
||||
|
||||
class daTori_Flag_c : public fopAc_ac_c {
|
||||
public:
|
||||
inline s32 _create();
|
||||
@@ -14,8 +29,10 @@ public:
|
||||
inline bool _execute();
|
||||
|
||||
void set_mtx();
|
||||
void CreateHeap();
|
||||
void CreateInit();
|
||||
BOOL CreateHeap();
|
||||
s32 CreateInit();
|
||||
|
||||
static const char M_arcname[7];
|
||||
|
||||
public:
|
||||
/* 0x290 */ request_of_phase_process_class mPhsTrflag;
|
||||
@@ -29,12 +46,4 @@ public:
|
||||
/* 0x4D0 */ dCcD_Cyl mCyl2;
|
||||
};
|
||||
|
||||
class daTori_Flag_HIO_c {
|
||||
public:
|
||||
daTori_Flag_HIO_c();
|
||||
|
||||
public:
|
||||
/* Place member variables here */
|
||||
};
|
||||
|
||||
#endif /* D_A_TORI_FLAG_H */
|
||||
|
||||
@@ -80,6 +80,7 @@ private:
|
||||
/* 0xF6 */ s16 mRotateY;
|
||||
/* 0xF8 */ u8 mCurArr;
|
||||
}; // Size: 0xFC
|
||||
dCloth_packet_c* dCloth_packet_create(ResTIMG*, ResTIMG*, int, int, float, float, dKy_tevstr_c*, cXyz**);
|
||||
|
||||
class dCloth_packetXlu_c : public dCloth_packet_c {
|
||||
virtual void init();
|
||||
@@ -89,6 +90,7 @@ class dCloth_packetXlu_c : public dCloth_packet_c {
|
||||
virtual void TexObjLoad();
|
||||
virtual void TevSetting();
|
||||
};
|
||||
dCloth_packetXlu_c* dCloth_packetXlu_create(ResTIMG*, ResTIMG*, int, int, float, float, dKy_tevstr_c*, cXyz**);
|
||||
|
||||
class dClothVobj03_c : public dCloth_packet_c {
|
||||
virtual void init();
|
||||
@@ -150,6 +152,4 @@ public:
|
||||
};
|
||||
dClothVobj07_0_c* dClothVobj07_0_create(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**);
|
||||
|
||||
dCloth_packetXlu_c* dCloth_packetXlu_create(ResTIMG*, ResTIMG*, int, int, float, float, dKy_tevstr_c*, cXyz**);
|
||||
|
||||
#endif /* D_A_CLOTH_PACKET_H */
|
||||
|
||||
+160
-25
@@ -4,66 +4,201 @@
|
||||
//
|
||||
|
||||
#include "d/actor/d_a_tori_flag.h"
|
||||
#include "dolphin/mtx/mtx.h"
|
||||
#include "d/d_procname.h"
|
||||
#include "d/d_kankyo_wether.h"
|
||||
#include "m_Do/m_Do_mtx.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "m_Do/m_Do_ext.h"
|
||||
#include "d/res/res_trflag.h"
|
||||
#include "d/res/res_cloth.h"
|
||||
#include "f_op/f_op_actor_mng.h"
|
||||
#include "d/d_a_obj.h"
|
||||
#include "SSystem/SComponent/c_math.h"
|
||||
|
||||
#include "weak_bss_936_to_1036.h" // IWYU pragma: keep
|
||||
|
||||
static dCcD_SrcCyl l_cyl_src = {
|
||||
// dCcD_SrcGObjInf
|
||||
{
|
||||
/* Flags */ 0,
|
||||
/* SrcObjAt Type */ 0,
|
||||
/* SrcObjAt Atp */ 0,
|
||||
/* SrcObjAt SPrm */ 0,
|
||||
/* SrcObjTg Type */ ~(AT_TYPE_BOOMERANG),
|
||||
/* SrcObjTg SPrm */ cCcD_TgSPrm_Set_e | cCcD_TgSPrm_IsEnemy_e,
|
||||
/* SrcObjCo SPrm */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsEnemy_e | cCcD_CoSPrm_VsPlayer_e | cCcD_CoSPrm_VsOther_e,
|
||||
/* SrcGObjAt Se */ 0,
|
||||
/* SrcGObjAt HitMark */ 0,
|
||||
/* SrcGObjAt Spl */ 0,
|
||||
/* SrcGObjAt Mtrl */ 0,
|
||||
/* SrcGObjAt SPrm */ 0,
|
||||
/* SrcGObjTg Se */ 0,
|
||||
/* SrcGObjTg HitMark */ 0,
|
||||
/* SrcGObjTg Spl */ 0,
|
||||
/* SrcGObjTg Mtrl */ 0,
|
||||
/* SrcGObjTg SPrm */ cCcD_TgSPrm_Set_e | cCcD_TgSPrm_IsEnemy_e | cCcD_TgSPrm_IsPlayer_e,
|
||||
/* SrcGObjCo SPrm */ 0,
|
||||
},
|
||||
// cM3dGCylS
|
||||
{
|
||||
/* Center */ 0.0f, 0.0f, 0.0f,
|
||||
/* Radius */ 30.0f,
|
||||
/* Height */ 400.0f,
|
||||
},
|
||||
};
|
||||
|
||||
/* 000000EC-00000118 .text __ct__17daTori_Flag_HIO_cFv */
|
||||
daTori_Flag_HIO_c::daTori_Flag_HIO_c() {
|
||||
/* Nonmatching */
|
||||
mNo = -0x1;
|
||||
someFloat = 0.0f;
|
||||
someShort = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
static daTori_Flag_HIO_c l_HIO;
|
||||
|
||||
static cXyz l_flag_offset(0.0f, 350.0f, 0.0f);
|
||||
|
||||
const char daTori_Flag_c::M_arcname[7] = "Trflag";
|
||||
|
||||
/* 00000118-000001C4 .text set_mtx__13daTori_Flag_cFv */
|
||||
void daTori_Flag_c::set_mtx() {
|
||||
/* Nonmatching */
|
||||
mpModel->setBaseScale(scale);
|
||||
mDoMtx_stack_c::transS(current.pos);
|
||||
mDoMtx_stack_c::ZXYrotM(shape_angle);
|
||||
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
|
||||
mDoMtx_stack_c::transM(l_flag_offset);
|
||||
mpCloth->setMtx(mDoMtx_stack_c::get());
|
||||
return;
|
||||
}
|
||||
|
||||
/* 000001C4-000001E4 .text CheckCreateHeap__FP10fopAc_ac_c */
|
||||
static BOOL CheckCreateHeap(fopAc_ac_c*) {
|
||||
/* Nonmatching */
|
||||
static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
|
||||
return ((daTori_Flag_c*)i_this)->CreateHeap();
|
||||
}
|
||||
|
||||
/* 000001E4-0000030C .text CreateHeap__13daTori_Flag_cFv */
|
||||
void daTori_Flag_c::CreateHeap() {
|
||||
/* Nonmatching */
|
||||
BOOL daTori_Flag_c::CreateHeap() {
|
||||
BOOL ret;
|
||||
J3DModelData* modelData = (J3DModelData *)dComIfG_getObjectRes(M_arcname, TRFLAG_BDL_ETHATA);
|
||||
JUT_ASSERT(0x120, modelData != 0);
|
||||
mpModel = mDoExt_J3DModel__create(modelData, 0, 0x11020203);
|
||||
if (mpModel == NULL) {
|
||||
ret = FALSE;
|
||||
}
|
||||
else {
|
||||
ResTIMG* flagTimg = (ResTIMG *)dComIfG_getObjectRes(M_arcname, TRFLAG_BTI_ETHATA);
|
||||
ResTIMG* clothTimg = (ResTIMG *)dComIfG_getObjectRes("Cloth", CLOTH_BTI_CLOTHTOON);
|
||||
mpCloth = dCloth_packet_create(flagTimg, clothTimg, 5, 5, 210.0f, 105.0f, &mClothTevStr, NULL);
|
||||
ret = (mpCloth != NULL) ? TRUE : FALSE;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 0000030C-000003A4 .text CreateInit__13daTori_Flag_cFv */
|
||||
void daTori_Flag_c::CreateInit() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 000003A4-000003C4 .text daTori_FlagCreate__FPv */
|
||||
static s32 daTori_FlagCreate(void*) {
|
||||
/* Nonmatching */
|
||||
s32 daTori_Flag_c::CreateInit() {
|
||||
mStts.Init(0xFF,0xFF,this);
|
||||
mCyl.Set(l_cyl_src);
|
||||
mCyl.SetStts(&mStts);
|
||||
cXyz* wind_vec = dKyw_get_wind_vec();
|
||||
mWindvec.x = wind_vec->x;
|
||||
mWindvec.y = wind_vec->y;
|
||||
mWindvec.z = wind_vec->z;
|
||||
set_mtx();
|
||||
dKy_tevstr_init(&mClothTevStr, current.roomNo, 0xFF);
|
||||
fopAcM_SetMtx(this, mpModel->getBaseTRMtx());
|
||||
return 4;
|
||||
}
|
||||
|
||||
/* 000003C4-00000478 .text _create__13daTori_Flag_cFv */
|
||||
s32 daTori_Flag_c::_create() {
|
||||
/* Nonmatching */
|
||||
fopAcM_SetupActor(this, daTori_Flag_c);
|
||||
int result = dComIfG_resLoad(&mPhsTrflag, M_arcname);
|
||||
if (result != cPhs_COMPLEATE_e) {
|
||||
return result;
|
||||
}
|
||||
result = dComIfG_resLoad(&mPhsCloth, "Cloth");
|
||||
if (result != cPhs_COMPLEATE_e) {
|
||||
return result;
|
||||
}
|
||||
if (fopAcM_entrySolidHeap(this, CheckCreateHeap, 0x1020)) {
|
||||
result = CreateInit();
|
||||
}
|
||||
else {
|
||||
result = cPhs_ERROR_e;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* 000003A4-000003C4 .text daTori_FlagCreate__FPv */
|
||||
static s32 daTori_FlagCreate(void* i_this) {
|
||||
return ((daTori_Flag_c*)i_this)->_create();
|
||||
}
|
||||
|
||||
bool daTori_Flag_c::_delete() {
|
||||
dComIfG_resDelete(&mPhsTrflag, M_arcname);
|
||||
dComIfG_resDelete(&mPhsCloth, "Cloth");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 00000804-00000854 .text daTori_FlagDelete__FPv */
|
||||
static BOOL daTori_FlagDelete(void*) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 00000854-00000878 .text daTori_FlagExecute__FPv */
|
||||
static BOOL daTori_FlagExecute(void*) {
|
||||
/* Nonmatching */
|
||||
static BOOL daTori_FlagDelete(void* i_this) {
|
||||
return ((daTori_Flag_c*)i_this)->_delete();
|
||||
}
|
||||
|
||||
/* 00000878-00000B1C .text _execute__13daTori_Flag_cFv */
|
||||
bool daTori_Flag_c::_execute() {
|
||||
/* Nonmatching */
|
||||
set_mtx();
|
||||
mStts.Move();
|
||||
if (mCyl.ChkTgHit()) {
|
||||
daObj::HitSeStart(¤t.pos, current.roomNo, &mCyl, 0x0B);
|
||||
}
|
||||
fopAcM_rollPlayerCrash(this, 40.0f, 7);
|
||||
cXyz wind;
|
||||
cXyz pt = current.pos + l_flag_offset;
|
||||
wind = dKyw_get_AllWind_vecpow(&pt);
|
||||
f32 windStrength = wind.abs();
|
||||
f32 currStrength = mWindvec.abs();
|
||||
if (windStrength > currStrength) {
|
||||
mWindvec.x = wind.x;
|
||||
mWindvec.y = wind.y;
|
||||
mWindvec.z = wind.z;
|
||||
}
|
||||
else {
|
||||
cLib_addCalcPos2(&mWindvec, wind, 0.05f, 0.05f);
|
||||
}
|
||||
mCyl.SetC(current.pos);
|
||||
dComIfG_Ccsp()->Set(&mCyl);
|
||||
mpCloth->setParam(0.4f, -1.5f, 0.75f, 0.9f, 0.9f, 0x400, 0, 900, -800, 7.0f, 6.0f);
|
||||
mpCloth->setWindPower(8.0f, 3.0f);
|
||||
mpCloth->setGlobalWind(&mWindvec);
|
||||
mpCloth->cloth_move();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 00000854-00000878 .text daTori_FlagExecute__FPv */
|
||||
static BOOL daTori_FlagExecute(void* i_this) {
|
||||
return ((daTori_Flag_c*)i_this)->_execute();
|
||||
}
|
||||
|
||||
bool daTori_Flag_c::_draw() {
|
||||
g_env_light.settingTevStruct(TEV_TYPE_BG0, ¤t.pos, &tevStr);
|
||||
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, ¤t.pos, &mClothTevStr);
|
||||
g_env_light.setLightTevColorType(mpModel, &tevStr);
|
||||
mDoExt_modelUpdateDL(mpModel);
|
||||
mpCloth->cloth_draw();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 00000B1C-00000BB8 .text daTori_FlagDraw__FPv */
|
||||
static BOOL daTori_FlagDraw(void*) {
|
||||
/* Nonmatching */
|
||||
static BOOL daTori_FlagDraw(void* i_this) {
|
||||
return ((daTori_Flag_c*)i_this)->_draw();
|
||||
}
|
||||
|
||||
/* 00000BB8-00000BC0 .text daTori_FlagIsDelete__FPv */
|
||||
static BOOL daTori_FlagIsDelete(void*) {
|
||||
/* Nonmatching */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static actor_method_class daTori_FlagMethodTable = {
|
||||
|
||||
@@ -84,7 +84,7 @@ void dCloth_packet_c::plot() {
|
||||
}
|
||||
|
||||
/* 8006487C-800649C4 .text dCloth_packet_create__FP7ResTIMGP7ResTIMGiiffP12dKy_tevstr_cPP4cXyz */
|
||||
void dCloth_packet_create(ResTIMG*, ResTIMG*, int, int, float, float, dKy_tevstr_c*, cXyz**) {
|
||||
dCloth_packet_c* dCloth_packet_create(ResTIMG*, ResTIMG*, int, int, float, float, dKy_tevstr_c*, cXyz**) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user