summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorAdam Bird <Archez@users.noreply.github.com>2023-11-23 09:07:30 -0500
committerGitHub <noreply@github.com>2023-11-23 09:07:30 -0500
commitf4e4545180c7fb643f8a2012a36c6346c495f510 (patch)
tree54aef7539436722902517c6e9b121d92c9c9b02a /soh/src/code
parent0ddb0711ad1b46e434e1587003f1c749b9a222e7 (diff)
Re-implement King Dodongo's Lava texture effects (#3434)
* fix alt backgrounds not always loading * include gfx lookup with the original unload * Add hook for alt toggle * handle cpu modified texture for kd lava * malloc array instead of illegal initialize
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_room.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/soh/src/code/z_room.c b/soh/src/code/z_room.c
index ccbc93d0d..772978f09 100644
--- a/soh/src/code/z_room.c
+++ b/soh/src/code/z_room.c
@@ -277,6 +277,11 @@ void func_8009638C(Gfx** displayList, void* source, void* tlut, u16 width, u16 h
bg->b.imagePal = 0;
bg->b.imageFlip = CVarGetInteger("gMirroredWorld", 0) ? G_BG_FLAG_FLIPS : 0;
+ // When an alt resource exists for the background, we need to unload the original asset
+ // to clear the cache so the alt asset will be loaded instead
+ // OTRTODO: If Alt loading over original cache is fixed, this line can most likely be removed
+ ResourceMgr_UnloadOriginalWhenAltExists((char*) source);
+
if (ResourceMgr_ResourceIsBackground((char*) source)) {
char* blob = (char*) ResourceGetDataByName((char *) source);
swapAndConvertJPEG(blob);