Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions soh/soh/Enhancements/Fixes/FixDekuScrubFlowerFlash.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/ShipInit.hpp"

extern "C" {
#include "src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h"
}

#define CVAR_DEKU_SCRUB_FLOWER_FLASH_FIX_NAME CVAR_ENHANCEMENT("FixDekuScrubFlowerFlash")
#define CVAR_DEKU_SCRUB_FLOWER_FLASH_FIX_VALUE CVarGetInteger(CVAR_DEKU_SCRUB_FLOWER_FLASH_FIX_NAME, 0)

// https://github.com/HarbourMasters/Shipwright/issues/2796
//
// En_Dnt_Nomal enables its draw function in WaitForObject but doesn't set flowerPos until SetFlower (which waits for
// ground contact). Both draw functions use flowerPos with MTXMODE_NEW, so the flower renders at the zero-initialized
// origin for the intervening frames.
//
// Defaulting flowerPos to the actor's spawn position closes the gap.

static void FixDekuScrubFlowerFlash(void* actorRef) {
const auto enDntNomal = static_cast<EnDntNomal*>(actorRef);
enDntNomal->flowerPos = enDntNomal->actor.world.pos;
}

static void RegisterFixDekuScrubFlowerFlash() {
COND_ID_HOOK(OnActorInit, ACTOR_EN_DNT_NOMAL, CVAR_DEKU_SCRUB_FLOWER_FLASH_FIX_VALUE, FixDekuScrubFlowerFlash);
}

static RegisterShipInitFunc initFunc(RegisterFixDekuScrubFlowerFlash, { CVAR_DEKU_SCRUB_FLOWER_FLASH_FIX_NAME });
4 changes: 4 additions & 0 deletions soh/soh/SohGui/SohMenuEnhancements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,10 @@ void SohMenu::AddMenuEnhancements() {
.RaceDisable(false)
.Options(CheckboxOptions().Tooltip(
"Fixes Adult Link having a backwards Left hand when holding the Megaton Hammer."));
AddWidget(path, "Fix Deku Scrub Flower Flash", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("FixDekuScrubFlowerFlash"))
.Options(CheckboxOptions().Tooltip(
"Fixes the Deku Scrub flower flashing briefly at the Lost Woods entrance."));
AddWidget(path, "Fix Vanishing Paths", WIDGET_CVAR_COMBOBOX)
.CVar(CVAR_ENHANCEMENT("SceneSpecificDirtPathFix"))
.RaceDisable(false)
Expand Down