summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbriaguya <70942617+briaguya-ai@users.noreply.github.com>2024-03-04 23:36:23 -0500
committerGitHub <noreply@github.com>2024-03-04 23:36:23 -0500
commit375349e4f72ce4e4609dc88c6ff8e6a4d69d681c (patch)
tree49fa331cde668bf974df06119b95ee0880ba1801
parentebde648c5976f39c8f1aabcc1d0ce1190404b6f5 (diff)
Support font as resource LUS changes (#3993)
m---------libultraship0
-rw-r--r--soh/soh/GbiWrap.cpp2
-rw-r--r--soh/soh/OTRGlobals.cpp18
-rw-r--r--soh/soh/OTRGlobals.h2
-rw-r--r--soh/soh/z_scene_otr.cpp11
5 files changed, 0 insertions, 33 deletions
diff --git a/libultraship b/libultraship
-Subproject be3a87eefc4b0637adf6fff1a3fa5cc9b826519
+Subproject ec01bc79860c55fe3562dafb4b4cb0aa2ce50a2
diff --git a/soh/soh/GbiWrap.cpp b/soh/soh/GbiWrap.cpp
index 46f4c877c..2399051f5 100644
--- a/soh/soh/GbiWrap.cpp
+++ b/soh/soh/GbiWrap.cpp
@@ -14,8 +14,6 @@ void OTRGetPixelDepthPrepare(float x, float y);
uint16_t OTRGetPixelDepth(float x, float y);
int32_t OTRGetLastScancode();
void ResourceMgr_LoadDirectory(const char* resName);
-void ResourceMgr_LoadFile(const char* resName);
-char* ResourceMgr_LoadFileFromDisk(const char* filePath);
uint16_t ResourceMgr_LoadTexWidthByName(char* texPath);
uint16_t ResourceMgr_LoadTexHeightByName(char* texPath);
size_t ResourceGetTexSizeByName(const char* name);
diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp
index 38fc5afd7..61f0e2b93 100644
--- a/soh/soh/OTRGlobals.cpp
+++ b/soh/soh/OTRGlobals.cpp
@@ -1581,10 +1581,6 @@ extern "C" void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName) {
}
}
-extern "C" void ResourceMgr_LoadFile(const char* resName) {
- LUS::Context::GetInstance()->GetResourceManager()->LoadResource(resName);
-}
-
std::shared_ptr<LUS::IResource> GetResourceByNameHandlingMQ(const char* path) {
std::string Path = path;
if (ResourceMgr_IsGameMasterQuest()) {
@@ -1606,20 +1602,6 @@ extern "C" char* GetResourceDataByNameHandlingMQ(const char* path) {
return (char*)res->GetRawPointer();
}
-extern "C" char* ResourceMgr_LoadFileFromDisk(const char* filePath) {
- FILE* file = fopen(filePath, "r");
- fseek(file, 0, SEEK_END);
- int fSize = ftell(file);
- fseek(file, 0, SEEK_SET);
-
- char* data = (char*)malloc(fSize);
- fread(data, 1, fSize, file);
-
- fclose(file);
-
- return data;
-}
-
extern "C" uint8_t ResourceMgr_TexIsRaw(const char* texPath) {
auto res = std::static_pointer_cast<LUS::Texture>(GetResourceByNameHandlingMQ(texPath));
return res->Flags & TEX_FLAG_LOAD_AS_RAW;
diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h
index db42341c2..a4af676e0 100644
--- a/soh/soh/OTRGlobals.h
+++ b/soh/soh/OTRGlobals.h
@@ -95,8 +95,6 @@ uint8_t ResourceMgr_FileExists(const char* resName);
uint8_t ResourceMgr_FileAltExists(const char* resName);
void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName);
char* GetResourceDataByNameHandlingMQ(const char* path);
-void ResourceMgr_LoadFile(const char* resName);
-char* ResourceMgr_LoadFileFromDisk(const char* filePath);
uint8_t ResourceMgr_TexIsRaw(const char* texPath);
uint8_t ResourceMgr_ResourceIsBackground(char* texPath);
char* ResourceMgr_LoadJPEG(char* data, size_t dataSize);
diff --git a/soh/soh/z_scene_otr.cpp b/soh/soh/z_scene_otr.cpp
index 3d7889807..0b9ba98f9 100644
--- a/soh/soh/z_scene_otr.cpp
+++ b/soh/soh/z_scene_otr.cpp
@@ -39,17 +39,6 @@ extern "C" s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId);
extern "C" RomFile sNaviMsgFiles[];
s32 OTRScene_ExecuteCommands(PlayState* play, SOH::Scene* scene);
-std::shared_ptr<LUS::File> ResourceMgr_LoadFile(const char* path) {
- std::string Path = path;
- if (IsGameMasterQuest()) {
- size_t pos = 0;
- if ((pos = Path.find("/nonmq/", 0)) != std::string::npos) {
- Path.replace(pos, 7, "/mq/");
- }
- }
- return LUS::Context::GetInstance()->GetResourceManager()->LoadFile(Path.c_str());
-}
-
// Forward Declaration of function declared in OTRGlobals.cpp
std::shared_ptr<LUS::IResource> GetResourceByNameHandlingMQ(const char* path);