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
This commit is contained in:
Adam Bird
2023-11-23 09:07:30 -05:00
committed by GitHub
parent 0ddb0711ad
commit f4e4545180
8 changed files with 261 additions and 31 deletions

View File

@@ -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);