mirror of
https://github.com/zeldaret/ss
synced 2026-06-11 21:18:40 -04:00
d_rawarchive followups (#42)
* d_rawarchive followups * symbols hygiene * Add Egg function
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user