Minor d_resource fixes

This commit is contained in:
LagoLunatic
2023-11-21 17:03:56 -05:00
parent d27ea6aceb
commit 48342a8899
3 changed files with 14 additions and 9 deletions
@@ -328,9 +328,9 @@ public:
field_0x28 = 0;
}
void calcTransform(f32, u16, J3DTransformInfo*) const;
virtual void calcTransform(f32, u16, J3DTransformInfo*) const;
virtual ~J3DAnmTransformKey();
virtual ~J3DAnmTransformKey() {}
virtual void getTransform(u16, J3DTransformInfo*) const;
private:
+1
View File
@@ -22,6 +22,7 @@ public:
static void dump(dRes_info_c*, int);
void* getRes(u32 resIdx) { return *(mRes + resIdx); }
int getResNum() { return mpArchive->countFile(); }
int getCount() { return mCount; }
char* getArchiveName() { return mArchiveName; }
mDoDvdThd_mountArchive_c* getDMCommand() { return mpDMCommand; }
+11 -7
View File
@@ -144,7 +144,7 @@ static void setToonTex(J3DMaterialTable* pMaterialTable) {
int dRes_info_c::loadResource() {
JUT_ASSERT(0x25f, mRes == 0);
s32 fileNum = mpArchive->countFile();
s32 fileNum = getResNum();
mRes = new void*[fileNum];
if (mRes == NULL) {
OSReport_Error("<%s.arc> setRes: res pointer buffer nothing !!\n", this);
@@ -192,13 +192,14 @@ int dRes_info_c::loadResource() {
JKRArcFinder * pArcFinder = mpArchive->getFirstResource(*pResType);
for (; pArcFinder->isAvailable(); pArcFinder->findNextFile()) {
u32 resType;
void * pRes = JKRArchive::getGlbResource(*pResType, pArcFinder->mEntryName, mpArchive);
if (pRes == NULL) {
OSReport_Error("<%s> res == NULL !!\n", pArcFinder->mEntryName);
goto next;
}
u32 resType = *pResType;
resType = *pResType;
if (resType == 'BMD ') {
pRes = J3DModelLoaderDataBase::load(pRes, 0x51240020);
if (pRes == NULL)
@@ -482,7 +483,7 @@ void dRes_info_c::dump_long(dRes_info_c* pRes, int num) {
s32 size;
JKRArchive* archive;
mDoDvdThd_command_c* command;
void* header;
SArcHeader* header;
s32 refCount;
s32 heapSize;
s32 i;
@@ -507,9 +508,13 @@ void dRes_info_c::dump_long(dRes_info_c* pRes, int num) {
}
}
// This hack fixes the .sdata2 section, since dRes_info_c::dump puts the floats in the wrong order
static f32 dummy(int i) {
return i;
}
/* 8006ECF4-8006EE6C .text dump__11dRes_info_cFP11dRes_info_ci */
void dRes_info_c::dump(dRes_info_c* pRes, int num) {
// sda
int totalArcHeaderSize;
int totalHeapSize;
int arcHeaderSize;
@@ -640,8 +645,7 @@ void* dRes_control_c::getRes(char const* pArcName, s32 resIdx, dRes_info_c* pInf
if (resInfo == NULL)
return resInfo;
JKRArchive* archive = resInfo->getArchive();
u32 fileCount = archive->countFile();
u32 fileCount = resInfo->getResNum();
if (resIdx >= (int)fileCount) {
OSReport_Error("<%s.arc> getRes: res index over !! index=%d count=%d\n", pArcName, resIdx,
@@ -658,7 +662,7 @@ void* dRes_control_c::getRes(char const* pArcName, char const* resName, dRes_inf
if (resInfo == NULL)
return resInfo;
s32 fileNum = resInfo->getArchive()->countFile();
s32 fileNum = resInfo->getResNum();
for (s32 i = 0; i < fileNum; i++) {
if (resInfo->getRes(i) != NULL) {
JKRArchive::SDirEntry dirEntry;