From f4e4545180c7fb643f8a2012a36c6346c495f510 Mon Sep 17 00:00:00 2001 From: Adam Bird Date: Thu, 23 Nov 2023 09:07:30 -0500 Subject: 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 --- soh/src/code/z_room.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'soh/src/code') 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); -- cgit v1.2.3