mirror of
https://github.com/zeldaret/ss
synced 2026-05-25 23:35:13 -04:00
d_rawarchive followups (#42)
* d_rawarchive followups * symbols hygiene * Add Egg function
This commit is contained in:
@@ -126,6 +126,13 @@ d/d_stage.cpp:
|
||||
d/d_sys.cpp:
|
||||
.text start:0x80064250 end:0x80064920
|
||||
|
||||
toBeSorted/arc_callback_handler.cpp:
|
||||
.text start:0x80065050 end:0x80065590
|
||||
.ctors start:0x804DB69C end:0x804DB6A0
|
||||
.data start:0x8050DF28 end:0x8050DF60
|
||||
.sdata start:0x80571D10 end:0x80571D20
|
||||
.sbss start:0x80575250 end:0x80575258
|
||||
|
||||
toBeSorted/arc_managers/current_stage_arc_manager.cpp:
|
||||
.text start:0x80068FD0 end:0x80069910
|
||||
.ctors start:0x804DB6A8 end:0x804DB6AC
|
||||
|
||||
+18
-18
@@ -2738,9 +2738,9 @@ fn_80061A30 = .text:0x80061A30; // type:function size:0x58
|
||||
fn_80061A90 = .text:0x80061A90; // type:function size:0x4
|
||||
fn_80061AA0 = .text:0x80061AA0; // type:function size:0x4
|
||||
dPlayerModel__sinit = .text:0x80061AB0; // type:function size:0x5C
|
||||
fn_80061B10 = .text:0x80061B10; // type:function size:0x88
|
||||
fn_80061BA0 = .text:0x80061BA0; // type:function size:0x34
|
||||
fn_80061BE0 = .text:0x80061BE0; // type:function size:0x10
|
||||
computeChecksumInner__FPvUl = .text:0x80061B10; // type:function size:0x88
|
||||
computeChecksum__FPvUl = .text:0x80061BA0; // type:function size:0x34
|
||||
setPrefix__FP18ArcCallbackHandlerPCcUl = .text:0x80061BE0; // type:function size:0x10
|
||||
__ct__14dRawArcEntry_cFv = .text:0x80061BF0; // type:function size:0x28
|
||||
__dt__14dRawArcEntry_cFv = .text:0x80061C20; // type:function size:0x80
|
||||
searchCallback__14dRawArcEntry_cFPvPvPC11ARCDirEntryPCcb = .text:0x80061CA0; // type:function size:0xA0
|
||||
@@ -2751,12 +2751,12 @@ loadArcFromDiskChecked__14dRawArcEntry_cFPCcPCcUcPQ23EGG4Heap = .text:0x80061E70
|
||||
loadArcFromDisk__14dRawArcEntry_cFPCcPCcUcPQ23EGG4Heap = .text:0x80061EF0; // type:function size:0xD0
|
||||
checkArcExistsOnDisk__14dRawArcEntry_cFPCcPCc = .text:0x80061FC0; // type:function size:0x34
|
||||
checkArcExistsOnDiskInner__14dRawArcEntry_cFR16SizedString<128>PCcPCc = .text:0x80062000; // type:function size:0x9C
|
||||
mount__14dRawArcEntry_cFPCcPvPvUcPQ23EGG4Heap = .text:0x800620A0; // type:function size:0x104
|
||||
mount__14dRawArcEntry_cFPCcPvP18ArcCallbackHandlerUcPQ23EGG4Heap = .text:0x800620A0; // type:function size:0x104
|
||||
ensureLoadedMaybe__14dRawArcEntry_cFPv = .text:0x800621B0; // type:function size:0x14C
|
||||
onMount__14dRawArcEntry_cFPv = .text:0x80062300; // type:function size:0x5C
|
||||
__ct__14dRawArcTable_cFv = .text:0x80062360; // type:function size:0x14
|
||||
__dt__14dRawArcTable_cFv = .text:0x80062380; // type:function size:0x74
|
||||
init__14dRawArcTable_cFUsPvPQ23EGG4Heap = .text:0x80062400; // type:function size:0x90
|
||||
init__14dRawArcTable_cFUsP18ArcCallbackHandlerPQ23EGG4Heap = .text:0x80062400; // type:function size:0x90
|
||||
getArcOrLoadFromDisk__14dRawArcTable_cFPCcPCcUcPQ23EGG4Heap = .text:0x80062490; // type:function size:0xAC
|
||||
addEntryFromSuperArc__14dRawArcTable_cFPCcPvUcPQ23EGG4Heap = .text:0x80062540; // type:function size:0xB0
|
||||
ensureLoadedMaybe2__14dRawArcTable_cFPCc = .text:0x800625F0; // type:function size:0x44
|
||||
@@ -2855,10 +2855,10 @@ fn_80064FC0 = .text:0x80064FC0; // type:function size:0x30
|
||||
fn_80064FF0 = .text:0x80064FF0; // type:function size:0x24
|
||||
fn_80065020 = .text:0x80065020; // type:function size:0x14
|
||||
fn_80065040 = .text:0x80065040; // type:function size:0x8
|
||||
BindSystemModelsAndLighting = .text:0x80065050; // type:function size:0x164
|
||||
fn_800651C0 = .text:0x800651C0; // type:function size:0x204
|
||||
fn_800653D0 = .text:0x800653D0; // type:function size:0x194
|
||||
fn_80065570 = .text:0x80065570; // type:function size:0x20
|
||||
BindSystemModelsAndLighting__FQ34nw4r3g3d7ResFile = .text:0x80065050; // type:function size:0x164
|
||||
CreateArcEntry__22ArcCallbackHandlerBaseFPvPCc = .text:0x800651C0; // type:function size:0x204
|
||||
DestroyArcEntry__22ArcCallbackHandlerBaseFPCc = .text:0x800653D0; // type:function size:0x194
|
||||
__sinit_\arc_callback_handler_cpp = .text:0x80065570; // type:function size:0x20 scope:local
|
||||
create__6mVideoFv = .text:0x80065590; // type:function size:0x54
|
||||
fn_800655F0 = .text:0x800655F0; // type:function size:0x4
|
||||
fn_80065600 = .text:0x80065600; // type:function size:0x3C
|
||||
@@ -26668,8 +26668,8 @@ createTexture__Q23EGG19LightTextureManagerFPCc = .text:0x804AD690; // type:funct
|
||||
EGG__LightTextureManager__createTextureFromBin = .text:0x804AD7A0; // type:function size:0x5C
|
||||
EGG__LightTextureManager__createTexturesFromBin = .text:0x804AD800; // type:function size:0x6C
|
||||
deleteTexture__Q23EGG19LightTextureManagerFi = .text:0x804AD870; // type:function size:0x84
|
||||
replaceModelTextures__Q23EGG19LightTextureManagerCFPQ34nw4r3g3d6ResMdl = .text:0x804AD900; // type:function size:0x84
|
||||
replaceModelTexture__Q23EGG19LightTextureManagerCFiPQ34nw4r3g3d6ResMdl = .text:0x804AD990; // type:function size:0x104
|
||||
replaceModelTextures__Q23EGG19LightTextureManagerCFQ34nw4r3g3d6ResMdl = .text:0x804AD900; // type:function size:0x84
|
||||
replaceModelTexture__Q23EGG19LightTextureManagerCFiQ34nw4r3g3d6ResMdl = .text:0x804AD990; // type:function size:0x104
|
||||
getTextureIndex__Q23EGG19LightTextureManagerCFPCc = .text:0x804ADAA0; // type:function size:0x7C
|
||||
setBinaryToTexture__Q23EGG19LightTextureManagerFPCv = .text:0x804ADB20; // type:function size:0x90
|
||||
correctLightObject__Q23EGG19LightTextureManagerFv = .text:0x804ADBB0; // type:function size:0x90
|
||||
@@ -27544,7 +27544,7 @@ sprintf = .text:0x804CC5D8; // type:function size:0xD4 scope:global
|
||||
__StringRead = .text:0x804CC6AC; // type:function size:0x694
|
||||
fn_804CCD40 = .text:0x804CCD40; // type:function size:0xC98
|
||||
fn_804CD9D8 = .text:0x804CD9D8; // type:function size:0x88
|
||||
fn_804CDA60 = .text:0x804CDA60; // type:function size:0x130
|
||||
sscanf = .text:0x804CDA60; // type:function size:0x130
|
||||
strcpy = .text:0x804CDB90; // type:function size:0xC0 scope:global
|
||||
strncpy = .text:0x804CDC50; // type:function size:0x44
|
||||
strcat = .text:0x804CDC94; // type:function size:0x2C
|
||||
@@ -30773,9 +30773,9 @@ lbl_8050DEB4 = .data:0x8050DEB4; // type:object size:0x10
|
||||
lbl_8050DEC4 = .data:0x8050DEC4; // type:object size:0x10
|
||||
RootHeapsManager__EGG__T_System<>__Configuration__vtable = .data:0x8050DED4; // type:object size:0x3C
|
||||
lbl_8050DF10 = .data:0x8050DF10; // type:object size:0x18
|
||||
lbl_8050DF28 = .data:0x8050DF28; // type:object size:0x14
|
||||
lbl_8050DF3C = .data:0x8050DF3C; // type:object size:0x14
|
||||
lbl_8050DF50 = .data:0x8050DF50; // type:object size:0x10
|
||||
lbl_8050DF28 = .data:0x8050DF28; // type:object size:0x11 data:string
|
||||
lbl_8050DF3C = .data:0x8050DF3C; // type:object size:0x11 data:string
|
||||
__vt__18ArcCallbackHandler = .data:0x8050DF50; // type:object size:0x10
|
||||
lbl_8050DF60 = .data:0x8050DF60; // type:object size:0x10
|
||||
lbl_8050DF70 = .data:0x8050DF70; // type:object size:0x14
|
||||
lbl_8050DF84 = .data:0x8050DF84; // type:object size:0xC
|
||||
@@ -37661,8 +37661,8 @@ lbl_80571CF8 = .sdata:0x80571CF8; // type:object size:0x8 data:string
|
||||
lbl_80571D00 = .sdata:0x80571D00; // type:object size:0x8 data:string
|
||||
RootActorID = .sdata:0x80571D08; // type:object size:0x2 data:2byte
|
||||
gameStateIsActive = .sdata:0x80571D0A; // type:object size:0x6 data:byte
|
||||
lbl_80571D10 = .sdata:0x80571D10; // type:object size:0x8
|
||||
lbl_80571D18 = .sdata:0x80571D18; // type:object size:0x8
|
||||
lbl_80571D10 = .sdata:0x80571D10; // type:object size:0x7 data:string
|
||||
lbl_80571D18 = .sdata:0x80571D18; // type:object size:0x3 data:string
|
||||
lbl_80571D20 = .sdata:0x80571D20; // type:object size:0x8
|
||||
lbl_80571D28 = .sdata:0x80571D28; // type:object size:0x8 data:string
|
||||
lbl_80571D30 = .sdata:0x80571D30; // type:object size:0x7 data:string
|
||||
@@ -39822,7 +39822,7 @@ dSystem__s_NewMEM1ArenaLo = .sbss:0x80575238; // type:object size:0x4 data:4byte
|
||||
dSystem__s_OrgMEM1ArenaHi = .sbss:0x8057523C; // type:object size:0x4 data:4byte
|
||||
dSystem__s_NewMEM1ArenaHi = .sbss:0x80575240; // type:object size:0x8 data:4byte
|
||||
dSystem__myDylinkInitPhase = .sbss:0x80575248; // type:object size:0x8
|
||||
lbl_80575250 = .sbss:0x80575250; // type:object size:0x8 data:4byte
|
||||
sInstance__18ArcCallbackHandler = .sbss:0x80575250; // type:object size:0x8 data:4byte
|
||||
aspectRatio = .sbss:0x80575258; // type:object size:0x8 data:float
|
||||
lbl_80575260 = .sbss:0x80575260; // type:object size:0x8 data:4byte
|
||||
lbl_80575268 = .sbss:0x80575268; // type:object size:0x8 data:4byte
|
||||
|
||||
@@ -319,6 +319,7 @@ config.libs = [
|
||||
Object(NonMatching, "d/d_stage.cpp"),
|
||||
Object(NonMatching, "d/d_sys.cpp"),
|
||||
Object(NonMatching, "toBeSorted/sound_info.cpp"),
|
||||
Object(Matching, "toBeSorted/arc_callback_handler.cpp"),
|
||||
Object(NonMatching, "d/a/d_a_base.cpp"),
|
||||
Object(NonMatching, "d/a/obj/d_a_obj_base.cpp"),
|
||||
Object(NonMatching, "d/a/obj/d_a_obj_item.cpp"),
|
||||
|
||||
@@ -17,6 +17,7 @@ int strcmp(const char* str1, const char* str2);
|
||||
char* strcat(char* dst, const char* src);
|
||||
char* strncpy(char* dst, const char* src, size_t n);
|
||||
char* strcpy(char* dst, const char* src);
|
||||
int sscanf(const char *buffer, const char *format, ...);
|
||||
size_t strlen(const char* str);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -3,9 +3,25 @@
|
||||
|
||||
#include <common.h>
|
||||
#include <m/m_dvd.h>
|
||||
// clang-format off
|
||||
#include <sized_string.h>
|
||||
// clang-format on
|
||||
|
||||
class ArcCallbackHandlerBase {
|
||||
public:
|
||||
ArcCallbackHandlerBase(): mPrefix(' ') {}
|
||||
/* vtable at 8050df50 */
|
||||
/** 800651c0 */
|
||||
virtual void CreateArcEntry(void *data, const char *path);
|
||||
/** 800653d0 */
|
||||
virtual void DestroyArcEntry(const char *path);
|
||||
|
||||
u32 mPrefix;
|
||||
};
|
||||
|
||||
class ArcCallbackHandler : public ArcCallbackHandlerBase {
|
||||
public:
|
||||
ArcCallbackHandler() {}
|
||||
static ArcCallbackHandler sInstance;
|
||||
};
|
||||
|
||||
// TODO: loading status could be an enum (-2/-1/0/+1)
|
||||
|
||||
@@ -22,7 +38,7 @@ public:
|
||||
static BOOL checkArcExistsOnDisk(const char *fileName, const char *dirName);
|
||||
static BOOL checkArcExistsOnDiskInner(SizedString<128> &path, const char *fileName, const char *dirName);
|
||||
|
||||
int mount(const char *name, void *data, void *callbackArg, u8 mountDirection, EGG::Heap *heap);
|
||||
int mount(const char *name, void *data, ArcCallbackHandler *callbackArg, u8 mountDirection, EGG::Heap *heap);
|
||||
int onMount(void *callbackArg);
|
||||
|
||||
int ensureLoadedMaybe(void *callbackArg);
|
||||
@@ -83,7 +99,7 @@ public:
|
||||
dRawArcTable_c();
|
||||
~dRawArcTable_c();
|
||||
|
||||
bool init(u16 count, void *callbackArg, EGG::Heap *heap);
|
||||
bool init(u16 count, ArcCallbackHandler *callbackArg, EGG::Heap *heap);
|
||||
BOOL getArcOrLoadFromDisk(const char *name, const char *dirName, u8 mountDirection, EGG::Heap *heap);
|
||||
BOOL addEntryFromSuperArc(const char *name, void *data, u8 mountDirection, EGG::Heap *heap);
|
||||
int ensureLoadedMaybe2(const char *name);
|
||||
@@ -101,7 +117,7 @@ public:
|
||||
private:
|
||||
/* 0x0 */ dRawArcEntry_c *mpEntries;
|
||||
/* 0x4 */ u16 mCount;
|
||||
/* 0x8 */ void *mCallbackArg;
|
||||
/* 0x8 */ ArcCallbackHandler *mCallbackArg;
|
||||
};
|
||||
|
||||
#endif;
|
||||
|
||||
@@ -20,6 +20,7 @@ public:
|
||||
virtual void GetBinaryInner(Bin *) const override;
|
||||
virtual size_t GetBinarySize() override;
|
||||
virtual void SetBinaryInner(const Bin &, const Bin &, f32) override;
|
||||
void replaceModelTextures(nw4r::g3d::ResMdl) const;
|
||||
|
||||
void drawAndCaptureTexture(f32, f32, f32, f32);
|
||||
};
|
||||
|
||||
@@ -18,8 +18,8 @@ struct ResFileData {
|
||||
struct ResFile {
|
||||
ResCommon<ResFileData> mFile; // at 0x0
|
||||
|
||||
ResFile(): mFile((void*)nullptr) {}
|
||||
ResFile(void *ptr): mFile(ptr) {}
|
||||
ResFile() : mFile((void *)nullptr) {}
|
||||
ResFile(void *ptr) : mFile(ptr) {}
|
||||
|
||||
inline ResFileData &ref() const {
|
||||
return mFile.ref();
|
||||
@@ -79,6 +79,9 @@ struct ResFile {
|
||||
u32 GetResAnmScnNumEntries() const;
|
||||
|
||||
bool Bind(ResFile);
|
||||
bool Bind() {
|
||||
return Bind(*this);
|
||||
}
|
||||
void Release();
|
||||
void Init();
|
||||
void Terminate();
|
||||
|
||||
@@ -46,6 +46,8 @@ struct ResPixDL {
|
||||
struct ResMatPix : public ResCommon<ResPixDL> {
|
||||
ResMatPix(void *vptr) : ResCommon(vptr) {}
|
||||
void DCStore(bool sync);
|
||||
void GXGetDstAlpha(u8*, u8*) const;
|
||||
void GXSetDstAlpha(u8, u8);
|
||||
void CallDisplayList(bool bSync) const;
|
||||
ResMatPix CopyTo(void *p) const;
|
||||
|
||||
@@ -179,6 +181,8 @@ struct ResMat : public ResCommon<ResMatData> {
|
||||
return ResMatTexCoordGen(&ofs_to_ptr<ResMatDLData>(ref().toResMatDLData)->dlTexCoordGen);
|
||||
}
|
||||
|
||||
bool IsOpaque() const;
|
||||
|
||||
bool Bind(ResFile);
|
||||
UNKTYPE Release();
|
||||
UNKTYPE Init();
|
||||
|
||||
+14
-25
@@ -1,18 +1,8 @@
|
||||
#include <d/d_rawarchive.h>
|
||||
#include <rvl/VI.h>
|
||||
|
||||
class UnkManager {
|
||||
public:
|
||||
/* vtable at 8050df50 */
|
||||
/** 800651c0 */
|
||||
virtual void CreateArc(void *data, const char *path);
|
||||
/** 800653d0 */
|
||||
virtual void DestroyArc(const char *path);
|
||||
|
||||
u32 stage;
|
||||
};
|
||||
|
||||
extern "C" int fn_80061B10(void *d, u32 len) {
|
||||
int computeChecksumInner(void *d, u32 len) {
|
||||
u32 *data = (u32 *)d;
|
||||
u32 result = 0;
|
||||
// Compiler will unroll this loop
|
||||
@@ -22,16 +12,15 @@ extern "C" int fn_80061B10(void *d, u32 len) {
|
||||
return result;
|
||||
}
|
||||
|
||||
extern "C" int fn_80061BA0(void *data, u32 len) {
|
||||
int result = fn_80061B10(data, len);
|
||||
int computeChecksum(void *data, u32 len) {
|
||||
int result = computeChecksumInner(data, len);
|
||||
return result != 0 ? result : -1;
|
||||
}
|
||||
|
||||
extern "C" void fn_80061BE0(UnkManager *mgr, const char *name, size_t len) {
|
||||
// Sets stage to all spaces
|
||||
mgr->stage = 0x20202020;
|
||||
// copies the stage name?
|
||||
memcpy((char *)&mgr->stage, name, len);
|
||||
void setPrefix(ArcCallbackHandler *mgr, const char *name, size_t len) {
|
||||
mgr->mPrefix = ' ';
|
||||
// Copy the actual name
|
||||
memcpy(&mgr->mPrefix, name, len);
|
||||
}
|
||||
|
||||
dRawArcEntry_c::dRawArcEntry_c() {
|
||||
@@ -55,18 +44,18 @@ dRawArcEntry_c::~dRawArcEntry_c() {
|
||||
}
|
||||
|
||||
void dRawArcEntry_c::searchCallback(void *arg, void *data, const ARCDirEntry *entry, const char *path, bool ctrl) {
|
||||
UnkManager *mgr = (UnkManager *)arg;
|
||||
ArcCallbackHandler *mgr = (ArcCallbackHandler *)arg;
|
||||
if (entry->isDir) {
|
||||
int len = strlen(entry->name);
|
||||
fn_80061BE0(mgr, entry->name, len <= 4 ? len : 4);
|
||||
setPrefix(mgr, entry->name, len <= 4 ? len : 4);
|
||||
} else {
|
||||
// dolphin: arg vtable at 8050df50
|
||||
// any others?
|
||||
if (ctrl) {
|
||||
mgr->CreateArc(data, path);
|
||||
mgr->CreateArcEntry(data, path);
|
||||
// branch to 800651c0, sets up room
|
||||
} else {
|
||||
mgr->DestroyArc(path);
|
||||
mgr->DestroyArcEntry(path);
|
||||
// branch to 800653d0, destroys room
|
||||
}
|
||||
}
|
||||
@@ -153,7 +142,7 @@ BOOL dRawArcEntry_c::checkArcExistsOnDiskInner(SizedString<128> &path, const cha
|
||||
return true;
|
||||
}
|
||||
|
||||
int dRawArcEntry_c::mount(const char *name, void *data, void *callbackArg, u8 mountDirection, EGG::Heap *heap) {
|
||||
int dRawArcEntry_c::mount(const char *name, void *data, ArcCallbackHandler *callbackArg, u8 mountDirection, EGG::Heap *heap) {
|
||||
mArcName = name;
|
||||
mpArc = EGG::Archive::mount(data, heap, (mountDirection == 0 || mountDirection == 1) ? 4 : -4);
|
||||
if (mpArc == nullptr) {
|
||||
@@ -201,7 +190,7 @@ int dRawArcEntry_c::ensureLoadedMaybe(void *callbackArg) {
|
||||
int result = onMount(callbackArg);
|
||||
mHeap::restoreCurrentHeap();
|
||||
mHeap::adjustFrmHeap(mpFrmHeap);
|
||||
mChecksum = fn_80061BA0(mpData, mAmountRead);
|
||||
mChecksum = computeChecksum(mpData, mAmountRead);
|
||||
if (result == -1) {
|
||||
return result;
|
||||
}
|
||||
@@ -233,7 +222,7 @@ dRawArcTable_c::~dRawArcTable_c() {
|
||||
}
|
||||
}
|
||||
|
||||
bool dRawArcTable_c::init(u16 count, void *callbackArg, EGG::Heap *heap) {
|
||||
bool dRawArcTable_c::init(u16 count, ArcCallbackHandler *callbackArg, EGG::Heap *heap) {
|
||||
mpEntries = new (heap, 0x04) dRawArcEntry_c[count]();
|
||||
if (mpEntries == nullptr) {
|
||||
return false;
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
#include <d/d_rawarchive.h>
|
||||
#include <egg/gfx/eggLight.h>
|
||||
#include <m/m3d/m3d.h>
|
||||
#include <toBeSorted/arc_managers/oarc_manager.h>
|
||||
#include <toBeSorted/arc_managers/current_stage_arc_manager.h>
|
||||
#include <nw4r/g3d/g3d_resfile.h>
|
||||
#include <nw4r/g3d/g3d_resmdl.h>
|
||||
#include <nw4r/g3d/g3d_resmat.h>
|
||||
|
||||
ArcCallbackHandler ArcCallbackHandler::sInstance;
|
||||
|
||||
#define NAME_DZB 'dzb '
|
||||
#define NAME_G3D 'g3d '
|
||||
#define NAME_KCL 'kcl '
|
||||
#define NAME_OARC 'oarc'
|
||||
#define NAME_RARC 'rarc'
|
||||
|
||||
extern "C" void FUN_804a7260(nw4r::g3d::ResMdl, const char *prefix);
|
||||
|
||||
|
||||
void BindSystemModelsAndLighting(nw4r::g3d::ResFile file) {
|
||||
nw4r::g3d::ResFile sysFile = OarcManager::sInstance->getMdlFromArc2("System");
|
||||
if (sysFile.mFile.IsValid()) {
|
||||
file.Bind(sysFile);
|
||||
}
|
||||
|
||||
EGG::LightManager *mgr = m3d::getLightMgr(0);
|
||||
if (mgr != nullptr && mgr->GetTextureMgr() != nullptr) {
|
||||
EGG::LightTextureManager *lightTexMgr = mgr->GetTextureMgr();
|
||||
for (int i = 0; i < file.GetResMdlNumEntries(); i++) {
|
||||
nw4r::g3d::ResMdl mdl = file.GetResMdl(i);
|
||||
lightTexMgr->replaceModelTextures(mdl);
|
||||
FUN_804a7260(mdl, "Lm");
|
||||
for (int j = 0; j < mdl.GetResMatNumEntries(); j++) {
|
||||
nw4r::g3d::ResMat mat = mdl.GetResMat(j);
|
||||
if (mat.IsOpaque()) {
|
||||
nw4r::g3d::ResMatPix pix = mat.GetResMatPix();
|
||||
u8 bAlpha;
|
||||
u8 uAlpha;
|
||||
pix.GXGetDstAlpha(&bAlpha, &uAlpha);
|
||||
if (!bAlpha) {
|
||||
pix.GXSetDstAlpha(1, 0x80);
|
||||
pix.DCStore(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void fn_8033A140(void *data);
|
||||
extern "C" void dBgWKCol__initKCollision(void *dat);
|
||||
|
||||
void ArcCallbackHandlerBase::CreateArcEntry(void *data, const char *path) {
|
||||
if (mPrefix == NAME_G3D) {
|
||||
nw4r::g3d::ResFile file = data;
|
||||
file.Init();
|
||||
file.Bind();
|
||||
BindSystemModelsAndLighting(file);
|
||||
} else if (mPrefix == NAME_KCL) {
|
||||
dBgWKCol__initKCollision(data);
|
||||
} else if (mPrefix == NAME_DZB) {
|
||||
fn_8033A140(data);
|
||||
} else if (mPrefix == NAME_OARC) {
|
||||
SizedString<64> oarcPath = path;
|
||||
char buf[64];
|
||||
sscanf(&oarcPath, "/oarc/%31[^.]arc", buf);
|
||||
u32 oldPrefix = mPrefix;
|
||||
OarcManager::sInstance->addEntryFromSuperArc(buf, data, nullptr);
|
||||
mPrefix = oldPrefix;
|
||||
} else if (mPrefix == NAME_RARC) {
|
||||
SizedString<64> oarcPath = path;
|
||||
char buf[64];
|
||||
sscanf(&oarcPath, "/rarc/%31[^.]arc", buf);
|
||||
u32 oldPrefix = mPrefix;
|
||||
CurrentStageArcManager::sInstance->addEntryFromSuperArc(buf, data);
|
||||
mPrefix = oldPrefix;
|
||||
}
|
||||
}
|
||||
|
||||
void ArcCallbackHandlerBase::DestroyArcEntry(const char *path) {
|
||||
if (mPrefix == NAME_OARC) {
|
||||
SizedString<64> oarcPath = path;
|
||||
char buf[64];
|
||||
sscanf(&oarcPath, "/oarc/%31[^.]arc", buf);
|
||||
u32 oldPrefix = mPrefix;
|
||||
OarcManager::sInstance->decrement(buf);
|
||||
mPrefix = oldPrefix;
|
||||
} else if (mPrefix == NAME_RARC) {
|
||||
SizedString<64> oarcPath = path;
|
||||
char buf[64];
|
||||
sscanf(&oarcPath, "/rarc/%31[^.]arc", buf);
|
||||
u32 oldPrefix = mPrefix;
|
||||
CurrentStageArcManager::sInstance->decrement(buf);
|
||||
mPrefix = oldPrefix;
|
||||
}
|
||||
}
|
||||
@@ -11,10 +11,8 @@ CurrentStageArcManager::~CurrentStageArcManager() {
|
||||
sInstance = nullptr;
|
||||
}
|
||||
|
||||
extern char lbl_80575250;
|
||||
|
||||
void CurrentStageArcManager::init(EGG::Heap *heap) {
|
||||
mArcTable.init(18, &lbl_80575250, heap);
|
||||
mArcTable.init(18, &ArcCallbackHandler::sInstance, heap);
|
||||
}
|
||||
|
||||
bool CurrentStageArcManager::setStage(const char *newStage) {
|
||||
|
||||
@@ -11,10 +11,8 @@ LayoutArcManager::~LayoutArcManager() {
|
||||
sInstance = nullptr;
|
||||
}
|
||||
|
||||
extern char lbl_80575250;
|
||||
|
||||
void LayoutArcManager::init(EGG::Heap *heap) {
|
||||
mArcTable.init(16, &lbl_80575250, heap);
|
||||
mArcTable.init(16, &ArcCallbackHandler::sInstance, heap);
|
||||
}
|
||||
|
||||
bool LayoutArcManager::loadLayoutArcFromDisk(const char *object, EGG::Heap *heap) {
|
||||
|
||||
@@ -11,10 +11,8 @@ OarcManager::~OarcManager() {
|
||||
sInstance = nullptr;
|
||||
}
|
||||
|
||||
extern char lbl_80575250;
|
||||
|
||||
void OarcManager::init(EGG::Heap *heap) {
|
||||
mArcTable.init(200, &lbl_80575250, heap);
|
||||
mArcTable.init(200, &ArcCallbackHandler::sInstance, heap);
|
||||
}
|
||||
|
||||
bool OarcManager::checkIfObjectArcExistsOnDisk(const char *object) {
|
||||
|
||||
Reference in New Issue
Block a user