summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2023-12-18 19:55:24 -0500
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2023-12-18 19:55:24 -0500
commit2498d687ebdca4e035887054fe6fd3b1a4ca09dd (patch)
treec49bae3f8eefeef393e06eeb4e64a39d677af59f /src
parent457a32d3b852d0a4e78567e7437b4382b3dbcb08 (diff)
use enums for file indexes in a few more actors
Diffstat (limited to 'src')
-rw-r--r--src/d/actor/d_a_arrow_lighteff.cpp18
-rw-r--r--src/d/actor/d_a_ghostship.cpp22
-rw-r--r--src/d/actor/d_a_shop_item.cpp51
3 files changed, 74 insertions, 17 deletions
diff --git a/src/d/actor/d_a_arrow_lighteff.cpp b/src/d/actor/d_a_arrow_lighteff.cpp
index 54d72f40..4584c4aa 100644
--- a/src/d/actor/d_a_arrow_lighteff.cpp
+++ b/src/d/actor/d_a_arrow_lighteff.cpp
@@ -81,13 +81,13 @@ BOOL daArrow_Lighteff_c::CreateHeap() {
J3DModelData* modelData;
if(field_0x2E8 == 1) {
- modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Link", 0x32));
+ modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Link", LINK_BDL_GARWFI00));
}
else if(field_0x2E8 == 2) {
- modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Link", 0x33));
+ modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Link", LINK_BDL_GARWFI01));
}
else {
- modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Link", 0x34));
+ modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Link", LINK_BDL_GARWG00));
}
JUT_ASSERT(187, modelData != 0);
@@ -100,16 +100,16 @@ BOOL daArrow_Lighteff_c::CreateHeap() {
J3DAnmTextureSRTKey* btk;
J3DAnmTevRegKey* brk;
if(field_0x2E8 == 1) {
- btk = static_cast<J3DAnmTextureSRTKey*>(dComIfG_getObjectRes("Link", 0x5E));
- brk = static_cast<J3DAnmTevRegKey*>(dComIfG_getObjectRes("Link", 0x52));
+ btk = static_cast<J3DAnmTextureSRTKey*>(dComIfG_getObjectRes("Link", LINK_BTK_GARWFI00));
+ brk = static_cast<J3DAnmTevRegKey*>(dComIfG_getObjectRes("Link", LINK_BRK_GARWFI00));
}
else if(field_0x2E8 == 2) {
- btk = static_cast<J3DAnmTextureSRTKey*>(dComIfG_getObjectRes("Link", 0x5F));
- brk = static_cast<J3DAnmTevRegKey*>(dComIfG_getObjectRes("Link", 0x53));
+ btk = static_cast<J3DAnmTextureSRTKey*>(dComIfG_getObjectRes("Link", LINK_BTK_GARWFI01));
+ brk = static_cast<J3DAnmTevRegKey*>(dComIfG_getObjectRes("Link", LINK_BRK_GARWFI01));
}
else {
- btk = static_cast<J3DAnmTextureSRTKey*>(dComIfG_getObjectRes("Link", 0x60));
- brk = static_cast<J3DAnmTevRegKey*>(dComIfG_getObjectRes("Link", 0x54));
+ btk = static_cast<J3DAnmTextureSRTKey*>(dComIfG_getObjectRes("Link", LINK_BTK_GARWG00));
+ brk = static_cast<J3DAnmTevRegKey*>(dComIfG_getObjectRes("Link", LINK_BRK_GARWG00));
}
JUT_ASSERT(216, btk != 0);
diff --git a/src/d/actor/d_a_ghostship.cpp b/src/d/actor/d_a_ghostship.cpp
index 425c4326..1e5bab71 100644
--- a/src/d/actor/d_a_ghostship.cpp
+++ b/src/d/actor/d_a_ghostship.cpp
@@ -12,6 +12,18 @@
#include "d/d_s_play.h"
#include "d/d_kankyo_wether.h"
+enum AYUSH_RES_FILE_ID { // IDs and indexes are synced
+ /* BDLM */
+ AYUSH_BDL_AYUSH=0x5,
+
+ /* BTK */
+ AYUSH_BTK_AYUSH=0x8,
+
+ /* TEX */
+ AYUSH_BTI_B_GSHIP_HATA=0xB,
+ AYUSH_BTI_B_GSHIP_HO=0xC,
+};
+
// Needed for .data to match.
static f32 dummy1[3] = {1.0f, 1.0f, 1.0f};
static f32 dummy2[3] = {1.0f, 1.0f, 1.0f};
@@ -36,7 +48,7 @@ static BOOL createHeap_CB(fopAc_ac_c* i_this) {
/* 00000118-0000032C .text _createHeap__13daGhostship_cFv */
BOOL daGhostship_c::_createHeap() {
- J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(m_arc_name, 5));
+ J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(m_arc_name, AYUSH_BDL_AYUSH));
JUT_ASSERT(88, modelData != 0);
mpModel = mDoExt_J3DModel__create(modelData, 0, 0x11020203);
@@ -44,16 +56,16 @@ BOOL daGhostship_c::_createHeap() {
return false;
}
- J3DAnmTextureSRTKey* btk = static_cast<J3DAnmTextureSRTKey*>(dComIfG_getObjectRes(m_arc_name, 8));
+ J3DAnmTextureSRTKey* btk = static_cast<J3DAnmTextureSRTKey*>(dComIfG_getObjectRes(m_arc_name, AYUSH_BTK_AYUSH));
JUT_ASSERT(95, btk != 0);
if(!mBtk.init(modelData, btk, true, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1, false, 0)) {
return false;
}
- ResTIMG* res1 = static_cast<ResTIMG*>(dComIfG_getObjectRes(m_arc_name, 0xB));
- ResTIMG* res2 = static_cast<ResTIMG*>(dComIfG_getObjectRes(m_arc_name, 0xC));
- ResTIMG* res3 = static_cast<ResTIMG*>(dComIfG_getObjectRes(m_cloth_arc_name, 0x3));
+ ResTIMG* res1 = static_cast<ResTIMG*>(dComIfG_getObjectRes(m_arc_name, AYUSH_BTI_B_GSHIP_HATA));
+ ResTIMG* res2 = static_cast<ResTIMG*>(dComIfG_getObjectRes(m_arc_name, AYUSH_BTI_B_GSHIP_HO));
+ ResTIMG* res3 = static_cast<ResTIMG*>(dComIfG_getObjectRes(m_cloth_arc_name, CLOTH_BTI_CLOTHTOON));
mpCloth = dCloth_packetXlu_create(res1, res3, 5, 5, 700.0f, 350.0f, &mTevStr, 0);
mpCloth2 = dCloth_packetXlu_create(res2, res3, 6, 6, 1800.0f, 1000.0f, &mTevStr, 0);
diff --git a/src/d/actor/d_a_shop_item.cpp b/src/d/actor/d_a_shop_item.cpp
index d7de7727..66ea9b67 100644
--- a/src/d/actor/d_a_shop_item.cpp
+++ b/src/d/actor/d_a_shop_item.cpp
@@ -15,6 +15,41 @@
#include "m_Do/m_Do_mtx.h"
#include "m_Do/m_Do_lib.h"
+enum FDAI_RES_FILE_ID { // IDs and indexes are synced
+ /* BCK */
+ FDAI_BCK_FOBJ00=0x5,
+ FDAI_BCK_FOBJ01=0x6,
+ FDAI_BCK_FOBJ02=0x7,
+ FDAI_BCK_FOBJ05=0x8,
+ FDAI_BCK_FOBJ06=0x9,
+ FDAI_BCK_FOBJ07=0xA,
+ FDAI_BCK_FOBJ08=0xB,
+ FDAI_BCK_FOBJ09=0xC,
+ FDAI_BCK_FOBJ10=0xD,
+ FDAI_BCK_FOBJ11=0xE,
+
+ /* BDL */
+ FDAI_BDL_FDAI=0x11,
+ FDAI_BDL_FOBJ00=0x12,
+ FDAI_BDL_FOBJ01=0x13,
+ FDAI_BDL_FOBJ02=0x14,
+ FDAI_BDL_FOBJ03=0x15,
+ FDAI_BDL_FOBJ04=0x16,
+ FDAI_BDL_FOBJ05=0x17,
+ FDAI_BDL_FOBJ06=0x18,
+ FDAI_BDL_FOBJ07=0x19,
+ FDAI_BDL_FOBJ08=0x1A,
+ FDAI_BDL_FOBJ09=0x1B,
+ FDAI_BDL_FOBJ10=0x1C,
+ FDAI_BDL_FOBJ11=0x1D,
+
+ /* TEX */
+ FDAI_BTI_FTEX03=0x20,
+ FDAI_BTI_FTEX04=0x21,
+ FDAI_BTI_FTEX05=0x22,
+ FDAI_BTI_FTEX07=0x23,
+};
+
const char daShopItem_c::m_cloth_arcname[] = "Cloth";
const f32 daShopItem_c::m_cullfar_max = 5000.0f;
@@ -62,8 +97,18 @@ void daShopItem_c::CreateInit() {
BOOL daShopItem_c::clothCreate() {
if(isUseClothPacket(m_itemNo)) {
- dCloth_packet_c* (*clothFunc[4])(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**) = {dClothVobj03_create, dClothVobj04_create, dClothVobj05_create, dClothVobj07_0_create};
- u32 clothRes[4] = {0x20, 0x21, 0x22, 0x23};
+ dCloth_packet_c::CreateFunc clothFunc[4] = {
+ (dCloth_packet_c::CreateFunc)dClothVobj03_create,
+ (dCloth_packet_c::CreateFunc)dClothVobj04_create,
+ (dCloth_packet_c::CreateFunc)dClothVobj05_create,
+ (dCloth_packet_c::CreateFunc)dClothVobj07_0_create
+ };
+ u32 clothRes[4] = {
+ FDAI_BTI_FTEX03,
+ FDAI_BTI_FTEX04,
+ FDAI_BTI_FTEX05,
+ FDAI_BTI_FTEX07
+ };
switch(m_itemNo) {
case HEROS_FLAG:
@@ -81,7 +126,7 @@ BOOL daShopItem_c::clothCreate() {
}
ResTIMG* shopArc = (ResTIMG*)dComIfG_getObjectRes(getShopArcname(), clothRes[field_0x648]);
- ResTIMG* clothArc = (ResTIMG*)dComIfG_getObjectRes(m_cloth_arcname, 3);
+ ResTIMG* clothArc = (ResTIMG*)dComIfG_getObjectRes(m_cloth_arcname, CLOTH_BTI_CLOTHTOON);
field_0x644 = (*clothFunc[field_0x648])(shopArc, clothArc, &mTevStr, 0);
if (field_0x644 == 0) {