mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-07 02:40:30 -05:00
Re-add Custom GFX Patch
This commit is contained in:
parent
e1b35c7bfc
commit
e33fa05b6e
@ -52,12 +52,7 @@ extern "C" {
|
||||
#include "variables.h"
|
||||
#include "functions.h"
|
||||
#include "src/overlays/actors/ovl_En_Door/z_en_door.h"
|
||||
void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction);
|
||||
void ResourceMgr_PatchCustomGfxByName(const char* path, const char* patchName, int index, Gfx instruction);
|
||||
void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName);
|
||||
uint8_t ResourceGetIsCustomByName(const char* name);
|
||||
uint8_t Player_IsCustomLinkModel();
|
||||
uint8_t ResourceMgr_FileExists(const char* resName);
|
||||
extern SaveContext gSaveContext;
|
||||
extern PlayState* gPlayState;
|
||||
extern void Overlay_DisplayText(float duration, const char* text);
|
||||
|
@ -347,6 +347,19 @@ extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchNa
|
||||
*gfx = instruction;
|
||||
}
|
||||
|
||||
extern "C" void ResourceMgr_PatchCustomGfxByName(const char* path, const char* patchName, int index, Gfx instruction) {
|
||||
auto res = std::static_pointer_cast<Fast::DisplayList>(
|
||||
Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path));
|
||||
|
||||
Gfx* gfx = (Gfx*)&res->Instructions[index];
|
||||
|
||||
if (!originalGfx.contains(path) || !originalGfx[path].contains(patchName)) {
|
||||
originalGfx[path][patchName] = { index, *gfx };
|
||||
}
|
||||
|
||||
*gfx = instruction;
|
||||
}
|
||||
|
||||
extern "C" void ResourceMgr_PatchGfxCopyCommandByName(const char* path, const char* patchName, int destinationIndex, int sourceIndex) {
|
||||
auto res = std::static_pointer_cast<Fast::DisplayList>(
|
||||
Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path));
|
||||
|
@ -46,6 +46,7 @@ extern "C" {
|
||||
Gfx* ResourceMgr_LoadGfxByName(const char* path);
|
||||
uint8_t ResourceMgr_FileIsCustomByName(const char* path);
|
||||
void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction);
|
||||
void ResourceMgr_PatchCustomGfxByName(const char* path, const char* patchName, int index, Gfx instruction);
|
||||
void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName);
|
||||
char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path);
|
||||
Vtx* ResourceMgr_LoadVtxByCRC(uint64_t crc);
|
||||
|
Loading…
Reference in New Issue
Block a user