Skip to content

Commit

Permalink
Update vc CFileLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
XMDS committed Jun 12, 2024
1 parent 8c1c840 commit 27b397b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
24 changes: 24 additions & 0 deletions plugin_vc/game_vc/CFileLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,27 @@
RpClump* CFileLoader::LoadAtomicFile2Return(const char* file) {
return plugin::CallAndReturn<RpClump*, 0x48D7C0, const char*>(file);
}

RpAtomic* CFileLoader::FindRelatedModelInfoCB(RpAtomic* atomic, void* data) {
return plugin::CallAndReturn<RpAtomic*, 0x48D810, RpAtomic*, void*>(atomic, data);
}

void CFileLoader::LoadLevel(const char* filename) {
return plugin::Call<0x48D950, const char*>(filename);
}

void CFileLoader::LoadCollisionFile(const char* filename, unsigned char colId) {
return plugin::Call<0x48AAA0, const char*, unsigned char>(filename, colId);
}

void CFileLoader::LoadClumpFile(const char* filename) {
return plugin::Call<0x48D710, const char*>(filename);
}

void CFileLoader::LoadObjectTypes(const char* filename) {
return plugin::Call<0x48C810, const char*>(filename);
}

void CFileLoader::LoadScene(const char* filename) {
return plugin::Call<0x48B050, const char*>(filename);
}
31 changes: 31 additions & 0 deletions plugin_vc/game_vc/CFileLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,36 @@ class PLUGIN_API CFileLoader {
return RwTexDictionaryCreate();
}

// save txd to file
static inline void SaveTexDictionary(const RwTexDictionary* dict, char const* filename) {
RwStream* stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMWRITE, filename);
if (stream) {
RwTexDictionaryStreamWrite(dict, stream);
RwStreamClose(stream, NULL);
}
}

static RwTexture* MoveTextureCB(RwTexture* texture, void* data) {
RwTexDictionaryAddTexture((RwTexDictionary*)data, texture);
return texture;
}

static inline void AddTexDictionaries(RwTexDictionary* dst, RwTexDictionary* src) {
RwTexDictionaryForAllTextures(src, MoveTextureCB, dst);
}

static RpClump* LoadAtomicFile2Return(const char* file);

static RpAtomic* FindRelatedModelInfoCB(RpAtomic* atomic, void* data);

static void LoadLevel(const char* filename);

static void LoadCollisionFile(const char* filename, unsigned char colId);

static void LoadClumpFile(const char* filename);

static void LoadObjectTypes(const char* filename);

static void LoadScene(const char* filename);

};

0 comments on commit 27b397b

Please sign in to comment.