Fix TevType enum

This commit is contained in:
LagoLunatic
2024-05-01 13:19:25 -04:00
parent aaa0a4f77b
commit f9a8f92a15
10 changed files with 80 additions and 76 deletions
+4 -4
View File
@@ -12,13 +12,13 @@ struct daShopItem_c_m_data {
class daShopItem_c : public daItemBase_c {
public:
inline int _create();
inline BOOL _delete();
void setTevType(int) {}
void setTevType(int type) { mTevType = type; }
char* getShopArcname();
s16 getShopBmdIdx();
void CreateInit();
inline int _create();
bool _execute();
void set_mtx();
bool _draw();
@@ -42,11 +42,11 @@ public:
static const u8 mModelType[255];
static const daShopItem_c_m_data mData[255];
/* 0x63C */ request_of_phase_process_class field_0x63C;
/* 0x63C */ request_of_phase_process_class mPhase;
/* 0x644 */ dCloth_packet_c* field_0x644;
/* 0x648 */ u8 field_0x648;
/* 0x64C */ Mtx field_0x64C;
/* 0x67C */ TevType tevType;
/* 0x67C */ int mTevType;
};
#endif /* D_A_SHOP_ITEM_H */
+15 -14
View File
@@ -136,20 +136,21 @@ public:
STATIC_ASSERT(sizeof(dKy_tevstr_c) == 0xB0);
enum TevType {
TEV_TYPE_ACTOR,
TEV_TYPE_BG0,
TEV_TYPE_BG1,
TEV_TYPE_BG2,
TEV_TYPE_BG3,
TEV_TYPE_BG0_FULL,
TEV_TYPE_BG1_FULL,
TEV_TYPE_BG2_FULL,
TEV_TYPE_BG3_FULL,
TEV_TYPE_PLAYER,
TEV_TYPE_BG0_PLIGHT,
TEV_TYPE_BG1_PLIGHT,
TEV_TYPE_BG2_PLIGHT,
TEV_TYPE_ACTOR_NOLIGHT,
TEV_TYPE_ACTOR = 0,
TEV_TYPE_BG0 = 1,
TEV_TYPE_BG1 = 2,
TEV_TYPE_BG2 = 3,
TEV_TYPE_BG3 = 4,
TEV_TYPE_BG0_FULL = 5,
TEV_TYPE_BG1_FULL = 6,
TEV_TYPE_BG2_FULL = 7,
TEV_TYPE_BG3_FULL = 8,
TEV_TYPE_PLAYER = 9,
TEV_TYPE_BG0_PLIGHT = 91,
TEV_TYPE_BG1_PLIGHT = 92,
TEV_TYPE_BG2_PLIGHT = 93,
TEV_TYPE_ACTOR_NOLIGHT = 94,
TEV_TYPE_UNK99 = 99,
};
class dKankyo_sun_Packet;
+1 -1
View File
@@ -13,7 +13,7 @@
#include "dolphin/os/OS.h"
#include "global.h"
JFWDisplay* JFWDisplay::sManager = 0;
JFWDisplay* JFWDisplay::sManager = NULL;
bool JFWAutoAbortGfx = true;
Mtx e_mtx = {
+7 -7
View File
@@ -33,13 +33,13 @@ ResFONT* JFWSystem::CSetUpParam::systemFontRes = (ResFONT*)JUTResFONT_Ascfont_fi
GXRenderModeObj* JFWSystem::CSetUpParam::renderMode = &GXNtsc480IntDf;
u32 JFWSystem::CSetUpParam::exConsoleBufferSize = 0x24F8;
JKRExpHeap* JFWSystem::rootHeap = 0;
JKRExpHeap* JFWSystem::systemHeap = 0;
JKRThread* JFWSystem::mainThread = 0;
JUTDbPrint* JFWSystem::debugPrint = 0;
JUTResFont* JFWSystem::systemFont = 0;
JUTConsoleManager* JFWSystem::systemConsoleManager = 0;
JUTConsole* JFWSystem::systemConsole = 0;
JKRExpHeap* JFWSystem::rootHeap = NULL;
JKRExpHeap* JFWSystem::systemHeap = NULL;
JKRThread* JFWSystem::mainThread = NULL;
JUTDbPrint* JFWSystem::debugPrint = NULL;
JUTResFont* JFWSystem::systemFont = NULL;
JUTConsoleManager* JFWSystem::systemConsoleManager = NULL;
JUTConsole* JFWSystem::systemConsole = NULL;
bool JFWSystem::sInitCalled = false;
/* 80254DD0-80254E54 .text firstInit__9JFWSystemFv */
+1 -1
View File
@@ -531,7 +531,7 @@ static u32 daNpcNz_getShopBoughtMsg(u8 itemNo) {
static int daNpc_Nz_ShopItemCreateCB(void* i_item) {
daShopItem_c* i_this = static_cast<daShopItem_c*>(i_item);
i_this->hide();
i_this->tevType = TEV_TYPE_ACTOR;
i_this->setTevType(TEV_TYPE_ACTOR);
return cPhs_COMPLEATE_e;
}
+27 -24
View File
@@ -9,31 +9,34 @@
#include "d/d_procname.h"
#include "dolphin/types.h"
const char daObjXfuta::Act_c::M_arcname[] = "X_futa";
namespace daObjXfuta {
static int tev_mode[] = {TEV_TYPE_ACTOR,
TEV_TYPE_BG0,
TEV_TYPE_BG1,
TEV_TYPE_BG2,
TEV_TYPE_BG3,
TEV_TYPE_BG0_FULL,
TEV_TYPE_BG1_FULL,
TEV_TYPE_BG2_FULL,
TEV_TYPE_BG3_FULL,
TEV_TYPE_PLAYER,
0x5B,
0x5C,
0x5D,
0x5E};
}
const char Act_c::M_arcname[] = "X_futa";
static int tev_mode[] = {
TEV_TYPE_ACTOR,
TEV_TYPE_BG0,
TEV_TYPE_BG1,
TEV_TYPE_BG2,
TEV_TYPE_BG3,
TEV_TYPE_BG0_FULL,
TEV_TYPE_BG1_FULL,
TEV_TYPE_BG2_FULL,
TEV_TYPE_BG3_FULL,
TEV_TYPE_PLAYER,
TEV_TYPE_BG0_PLIGHT,
TEV_TYPE_BG1_PLIGHT,
TEV_TYPE_BG2_PLIGHT,
TEV_TYPE_ACTOR_NOLIGHT
};
/* 00000078-0000009C .text solidHeapCB__Q210daObjXfuta5Act_cFP10fopAc_ac_c */
BOOL daObjXfuta::Act_c::solidHeapCB(fopAc_ac_c* i_this) {
BOOL Act_c::solidHeapCB(fopAc_ac_c* i_this) {
return ((Act_c*)i_this)->create_heap();
}
/* 0000009C-0000015C .text create_heap__Q210daObjXfuta5Act_cFv */
bool daObjXfuta::Act_c::create_heap() {
bool Act_c::create_heap() {
J3DModelData* mdl_data;
mdl_data = (J3DModelData*)(dComIfG_getObjectRes(M_arcname, 0x03));
@@ -50,7 +53,7 @@ bool daObjXfuta::Act_c::create_heap() {
}
/* 0000015C-00000214 .text _create__Q210daObjXfuta5Act_cFv */
s32 daObjXfuta::Act_c::_create() {
s32 Act_c::_create() {
fopAcM_SetupActor(this, Act_c);
int phase_state = dComIfG_resLoad(&mPhs, M_arcname);
if (phase_state == cPhs_COMPLEATE_e) {
@@ -65,13 +68,13 @@ s32 daObjXfuta::Act_c::_create() {
}
/* 00000214-00000244 .text _delete__Q210daObjXfuta5Act_cFv */
bool daObjXfuta::Act_c::_delete() {
bool Act_c::_delete() {
dComIfG_resDelete(&mPhs, M_arcname);
return true;
}
/* 00000244-000002F0 .text set_mtx__Q210daObjXfuta5Act_cFv */
void daObjXfuta::Act_c::set_mtx() {
void Act_c::set_mtx() {
mpModel->setBaseScale(scale);
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::ZXYrotM(shape_angle);
@@ -81,14 +84,14 @@ void daObjXfuta::Act_c::set_mtx() {
}
/* 000002F0-00000338 .text _execute__Q210daObjXfuta5Act_cFv */
bool daObjXfuta::Act_c::_execute() {
bool Act_c::_execute() {
current.pos = cXyz(home.pos.x, home.pos.y, home.pos.z);
set_mtx();
return TRUE;
}
/* 00000338-0000040C .text _draw__Q210daObjXfuta5Act_cFv */
bool daObjXfuta::Act_c::_draw() {
bool Act_c::_draw() {
if (dComIfGp_demo_mode() != 1) {
cXyz pos(0.0f, 0.0f, 0.0f);
g_env_light.settingTevStruct(tev_mode[1], &pos, &tevStr);
@@ -100,7 +103,6 @@ bool daObjXfuta::Act_c::_draw() {
return TRUE;
}
namespace daObjXfuta {
namespace {
s32 Mthd_Create(void* i_this) {
@@ -128,6 +130,7 @@ static actor_method_class Mthd_Table = {
(process_method_func)Mthd_Execute, (process_method_func)Mthd_IsDelete,
(process_method_func)Mthd_Draw,
};
} // namespace
} // namespace daObjXfuta
+2 -2
View File
@@ -1662,7 +1662,7 @@ bool daRd_c::_execute() {
modeProc(PROC_EXEC, MODE_NULL);
setAnm(AnmPrm_NULL, false);
setBtkAnm(0x5);
g_env_light.settingTevStruct(0, &current.pos, &tevStr);
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &current.pos, &tevStr);
return false;
}
@@ -1760,7 +1760,7 @@ void daRd_c::createInit() {
mpMorf->play(&current.pos, 0, 0);
mBrkAnm.setFrame(0.0f);
mpMorf->calc();
g_env_light.settingTevStruct(0, &current.pos, &tevStr);
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &current.pos, &tevStr);
fopAcM_SetMtx(this, mpMorf->getModel()->getBaseTRMtx());
fopAcM_setCullSizeBox(this, -100.0f, -10.0f, -100.0f, 100.0f, 250.0f, 150.0f);
+5 -5
View File
@@ -55,10 +55,10 @@ void daShopItem_c::CreateInit() {
set_mtx();
if(isDaizaItem(m_itemNo)) {
tevType = TEV_TYPE_ACTOR;
mTevType = TEV_TYPE_ACTOR;
}
else {
tevType = (TevType)0x5C;
mTevType = TEV_TYPE_BG1_PLIGHT;
}
mpModel->setUserArea(0);
@@ -175,7 +175,7 @@ void daShopItem_c::settingBeforeDraw() {
/* 0000070C-000007A4 .text setTevStr__12daShopItem_cFv */
void daShopItem_c::setTevStr() {
g_env_light.settingTevStruct(tevType, &current.pos, &tevStr);
g_env_light.settingTevStruct(mTevType, &current.pos, &tevStr);
g_env_light.setLightTevColorType(mpModel, &tevStr);
for(int i = 0; i < 2; i++) {
if(mpModelArrow[i] != 0) {
@@ -209,7 +209,7 @@ int daShopItem_c::_create() {
else {
int result2 = cPhs_COMPLEATE_e;
if(isUseClothPacket(m_itemNo)) {
result2 = dComIfG_resLoad(&field_0x63C, m_cloth_arcname);
result2 = dComIfG_resLoad(&mPhase, m_cloth_arcname);
}
if(result2 != cPhs_COMPLEATE_e) {
@@ -245,7 +245,7 @@ static BOOL daShopItem_Delete(void* i_this) {
daShopItem_c* inst = static_cast<daShopItem_c*>(i_this);
if(isUseClothPacket(inst->m_itemNo)) {
dComIfG_resDelete(&inst->field_0x63C, daShopItem_c::m_cloth_arcname);
dComIfG_resDelete(&inst->mPhase, daShopItem_c::m_cloth_arcname);
}
inst->DeleteBase(inst->getShopArcname());
+14 -14
View File
@@ -1534,7 +1534,7 @@ dKy_setLight__Status lightStatusData[8];
void dScnKy_env_light_c::settingTevStruct(int i_lightType, cXyz* param_1, dKy_tevstr_c* i_tevstr) {
int var_r31 = -1;
u8 var_r30 = i_tevstr->mInitTimer;
u8 var_r29 = 0;
bool var_r29 = false;
GXColorS10 sp98;
GXColorS10 sp90;
@@ -1562,7 +1562,7 @@ void dScnKy_env_light_c::settingTevStruct(int i_lightType, cXyz* param_1, dKy_te
mActorC0.a = 255;
mActorK0.a = 255;
if (i_lightType == 0 || i_lightType == 9 || i_lightType == 99) {
if (i_lightType == TEV_TYPE_ACTOR || i_lightType == TEV_TYPE_PLAYER || i_lightType == TEV_TYPE_UNK99) {
i_tevstr->mLightMode = 1;
sp98 = mActorC0;
@@ -1572,9 +1572,9 @@ void dScnKy_env_light_c::settingTevStruct(int i_lightType, cXyz* param_1, dKy_te
fog_z_start = mFogStartZ__setLight;
fog_z_end = mFogEndZ__setLight;
if (i_lightType == 0 || i_lightType == 99) {
if (i_lightType == TEV_TYPE_ACTOR || i_lightType == TEV_TYPE_UNK99) {
settingTevStruct_colget_actor(param_1, i_tevstr, &sp98, &sp90, &sp88, &fog_z_start, &fog_z_end);
} else if (i_lightType == 9) {
} else if (i_lightType == TEV_TYPE_PLAYER) {
var_r30 = g_env_light.mInitAnimTimer;
settingTevStruct_colget_player(i_tevstr);
settingTevStruct_colget_actor(param_1, i_tevstr, &sp98, &sp90, &sp88, &fog_z_start, &fog_z_end);
@@ -1590,12 +1590,12 @@ void dScnKy_env_light_c::settingTevStruct(int i_lightType, cXyz* param_1, dKy_te
mK0.b = sp90.b;
mK0.a = 255;
if (i_lightType != 99) {
if (i_lightType != TEV_TYPE_UNK99) {
settingTevStruct_plightcol_plus(param_1, i_tevstr, sp98, sp90, var_r30);
settingTevStruct_eflightcol_plus(param_1, i_tevstr);
}
if (i_lightType == 9) {
if (i_lightType == TEV_TYPE_PLAYER) {
g_env_light.mPLightNearPlayer = i_tevstr->mLightPosWorld;
}
} else {
@@ -1610,15 +1610,15 @@ void dScnKy_env_light_c::settingTevStruct(int i_lightType, cXyz* param_1, dKy_te
setLight_bg(i_tevstr, &sp80, &sp78, &sp70, &sp68, &sp60, &sp58, &sp50, &sp48, &sp88,
&fog_z_start, &fog_z_end);
if (i_lightType >= 5 && i_lightType <= 8) {
var_r29 = 1;
i_lightType -= 4;
if (i_lightType >= TEV_TYPE_BG0_FULL && i_lightType <= TEV_TYPE_BG3_FULL) {
var_r29 = true;
i_lightType = TEV_TYPE_BG0 + (i_lightType - TEV_TYPE_BG0_FULL);
}
if (i_lightType >= 91 && i_lightType <= 94) {
var_r31 = i_lightType - 91;
if (i_lightType >= TEV_TYPE_BG0_PLIGHT && i_lightType <= TEV_TYPE_ACTOR_NOLIGHT) {
var_r31 = i_lightType - TEV_TYPE_BG0_PLIGHT;
} else {
var_r31 = i_lightType - 1;
var_r31 = i_lightType - TEV_TYPE_BG0;
}
switch (var_r31) {
@@ -1641,7 +1641,7 @@ void dScnKy_env_light_c::settingTevStruct(int i_lightType, cXyz* param_1, dKy_te
break;
}
if (i_lightType >= 91 && i_lightType < 94) {
if (i_lightType >= TEV_TYPE_BG0_PLIGHT && i_lightType < TEV_TYPE_ACTOR_NOLIGHT) {
sp98.r = (u8)mC0.r;
sp98.g = (u8)mC0.g;
sp98.b = (u8)mC0.b;
@@ -1799,7 +1799,7 @@ void dScnKy_env_light_c::setLightTevColorType(J3DModel* i_model, dKy_tevstr_c* i
dKy_tevstr_init(i_tevstr, dComIfGp_roomControl_getStayNo(), 0xFF);
}
settingTevStruct(99, NULL, i_tevstr);
settingTevStruct(TEV_TYPE_UNK99, NULL, i_tevstr);
}
int mat_num = i_model->getModelData()->getMaterialNum() - 1;
+4 -4
View File
@@ -173,7 +173,7 @@ bool dNpc_PathRun_c::setInf(u8 pathIdx, s8 roomNo, u8 forwards) {
/* 8021AD1C-8021AD58 .text nextPath__14dNpc_PathRun_cFSc */
dPath* dNpc_PathRun_c::nextPath(s8 roomNo) {
dPath* pPath = 0;
dPath* pPath = NULL;
if(mPath != 0) {
pPath = dPath_GetNextRoomPath(mPath, roomNo);
@@ -543,7 +543,7 @@ void dNpc_EventCut_c::setActorInfo2(char* staffName, fopNpc_npc_c* pActor) {
/* 8021B9D8-8021BABC .text dNpc_setAnmIDRes__FP14mDoExt_McaMorfiffiiPCc */
bool dNpc_setAnmIDRes(mDoExt_McaMorf* pMorf, int loopMode, float morf, float speed, int animResId, int soundResId, const char* arcName) {
void* pSoundAnimRes = 0;
void* pSoundAnimRes = NULL;
bool ret = false;
if(pMorf != 0) {
@@ -567,7 +567,7 @@ bool dNpc_setAnmFNDirect(mDoExt_McaMorf* pMorf, int loopMode, f32 morf, f32 spee
if(pMorf != 0 && animFilename != 0 && arcName != 0) {
J3DAnmTransform* pAnimRes = (J3DAnmTransform*)dComIfG_getObjectRes(arcName, animFilename);
void* pSoundAnimRes = 0;
void* pSoundAnimRes = NULL;
if(soundFilename != 0) {
pSoundAnimRes = dComIfG_getObjectRes(arcName, soundFilename);
}
@@ -582,7 +582,7 @@ bool dNpc_setAnmFNDirect(mDoExt_McaMorf* pMorf, int loopMode, f32 morf, f32 spee
/* 8021BBA8-8021BC8C .text dNpc_setAnm__FP14mDoExt_McaMorfiffiiPCc */
bool dNpc_setAnm(mDoExt_McaMorf* pMorf, int loopMode, f32 morf, f32 speed, int animFileIdx, int soundFileIdx, const char* arcName) {
void* pSoundAnimRes = 0;
void* pSoundAnimRes = NULL;
bool ret = false;
if(pMorf != 0) {