From ac2127094b0ba1d2c99850a32eb8fe1cd5003055 Mon Sep 17 00:00:00 2001 From: PurpleHato Date: Thu, 9 Jun 2022 00:00:10 +0200 Subject: [PATCH] ADDED: Draw Distance toggle under Experimental enhancement + Bugfix (#398) * ADDED: Draw Distance toggle under Experimental enhancement * FIXED: Dark Link Apparition + Kokiri NPC spawn * Added a Toggle for Kokiri NPC since they are mystics * TWKEA: Desciription got the Kokiri draw distance * FIXED: Horses behavior Fixed Epona shout on title screen + Epona call from songFixed Zelda and Ganon horses that could still be seen on camera pan on the castle escape cinematic --- libultraship/libultraship/SohImGuiImpl.cpp | 6 ++++++ soh/src/code/z_actor.c | 8 ++++++-- soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 104d300bc..f7b8d6b77 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -994,6 +994,12 @@ namespace SohImGui { } EnhancementCheckbox("Disable LOD", "gDisableLOD"); Tooltip("Turns off the level of detail setting, making models always use their higher poly variants"); + EnhancementCheckbox("Disable Draw Distance", "gDisableDrawDistance"); + Tooltip("Turns off the objects draw distance, making objects being visible from a longer range"); + if (CVar_GetS32("gDisableDrawDistance", 0) == 1) { + EnhancementCheckbox("Kokiri Draw Distance", "gDisableKokiriDrawDistance"); + Tooltip("Kokiris are mystical being that appear from a certain distance\nEnable this will remove their draw distance\nNeeds to reload the map to take effect"); + } ImGui::EndMenu(); } diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 702ab622a..79a3f4032 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -1163,7 +1163,9 @@ void Actor_Init(Actor* actor, GlobalContext* globalCtx) { actor->uncullZoneForward = 1000.0f; actor->uncullZoneScale = 350.0f; actor->uncullZoneDownward = 700.0f; - if (CVar_GetS32("gDisableDrawDistance", 0) != 0) { + if (CVar_GetS32("gDisableDrawDistance", 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room + && actor->id != ACTOR_EN_HORSE // Check for Epona, else if we call her she will spawn at the other side of the map + we can hear her during the title screen sequence + && actor->id != ACTOR_EN_HORSE_GANON && actor->id != ACTOR_EN_HORSE_ZELDA) { // check for Zelda's and Ganondorf's horses that will always be scene during cinematic whith camera paning actor->uncullZoneForward = 32767.0f; actor->uncullZoneScale = 32767.0f; actor->uncullZoneDownward = 32767.0f; @@ -2690,7 +2692,9 @@ s32 func_800314B0(GlobalContext* globalCtx, Actor* actor) { s32 func_800314D4(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3) { f32 var; - if (CVar_GetS32("gDisableDrawDistance", 0) != 0) { + if (CVar_GetS32("gDisableDrawDistance", 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room + && actor->id != ACTOR_EN_HORSE // Check for Epona, else if we call her she will spawn at the other side of the map + we can hear her during the title screen sequence + && actor->id != ACTOR_EN_HORSE_GANON && actor->id != ACTOR_EN_HORSE_ZELDA) { // check for Zelda's and Ganondorf's horses that will always be scene during cinematic whith camera paning return true; } diff --git a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 533c23637..27b118879 100644 --- a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -1053,7 +1053,7 @@ void func_80A98CD8(EnKo* this) { this->actor.targetMode = info->targetMode; this->lookDist = info->lookDist; this->lookDist += this->collider.dim.radius; - this->appearDist = info->appearDist; + this->appearDist = CVar_GetS32("gDisableKokiriDrawDistance", 0) != 0 ? 32767 : info->appearDist; } // Used to fetch actor animation?