From d4adddcaaf0a97d1a06d2939d4f20decffdc403a Mon Sep 17 00:00:00 2001 From: Vague Rant Date: Sat, 13 Aug 2022 18:06:20 +1000 Subject: [PATCH 1/2] Fix killer door textures --- .../actors/ovl_Door_Killer/z_door_killer.c | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index 324bbbc95a9..9f7f118a5b1 100644 --- a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -103,12 +103,34 @@ void DoorKiller_Init(Actor* thisx, GlobalContext* globalCtx2) { s32 bankIndex; s32 i; + /* // Look in the object bank for one of the four objects containing door textures bankIndex = -1; for (i = 0; bankIndex < 0; i++) { bankIndex = Object_GetIndex(&globalCtx->objectCtx, sDoorTextures[i].objectId); this->textureEntryIndex = i; } + */ + + // For SoH where all objects are loaded, hardcode the index to match the current map. + // OTRTODO: This is a workaround. The proper solution to fix the textures is to manage + // object loading / unloading the same as N64. + switch (globalCtx->sceneNum) { + case SCENE_HIDAN: + this->textureEntryIndex = 0; + break; + case SCENE_MIZUSIN: + this->textureEntryIndex = 1; + break; + case SCENE_HAKADAN: + case SCENE_HAKADANCH: + this->textureEntryIndex = 2; + break; + default: + this->textureEntryIndex = 3; + } + bankIndex = Object_GetIndex(&globalCtx->objectCtx, sDoorTextures[this->textureEntryIndex].objectId); + osSyncPrintf("bank_ID = %d\n", bankIndex); osSyncPrintf("status = %d\n", this->textureEntryIndex); this->doorObjBankIndex = bankIndex; From b5acfb4e7c24ac15fb5bc03295daca58be010fb6 Mon Sep 17 00:00:00 2001 From: vaguerant Date: Mon, 17 Oct 2022 19:45:25 +1100 Subject: [PATCH 2/2] Remove todo as requested by @Rozelette --- soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index 9f7f118a5b1..10757ba17dc 100644 --- a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -113,8 +113,6 @@ void DoorKiller_Init(Actor* thisx, GlobalContext* globalCtx2) { */ // For SoH where all objects are loaded, hardcode the index to match the current map. - // OTRTODO: This is a workaround. The proper solution to fix the textures is to manage - // object loading / unloading the same as N64. switch (globalCtx->sceneNum) { case SCENE_HIDAN: this->textureEntryIndex = 0;