From e8b943968bb242aed049cc8d69cde16db098871b Mon Sep 17 00:00:00 2001 From: Jameriquiah <42100286+Jameriquiah@users.noreply.github.com> Date: Sat, 22 Aug 2026 12:39:52 -0400 Subject: [PATCH] Disable2DBackgrounds Fixes (#7102) --- .../Graphics/Disable2DBackgrounds.cpp | 36 +++++++------------ .../type/scenecommand/SetTimeSettings.h | 1 - 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/soh/soh/Enhancements/Graphics/Disable2DBackgrounds.cpp b/soh/soh/Enhancements/Graphics/Disable2DBackgrounds.cpp index 59d66bab77..9bf42d5c7b 100644 --- a/soh/soh/Enhancements/Graphics/Disable2DBackgrounds.cpp +++ b/soh/soh/Enhancements/Graphics/Disable2DBackgrounds.cpp @@ -1,5 +1,8 @@ #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/ShipInit.hpp" +#include "soh/resource/type/scenecommand/SetTimeSettings.h" + +bool Scene_CommandTimeSettings(PlayState* play, SOH::ISceneCommand* cmd); extern "C" { #include "variables.h" @@ -23,25 +26,6 @@ std::set fogControlList = { SCENE_TEMPLE_OF_TIME_EXTERIOR_DAY, SCENE_TEMPLE_OF_TIME_EXTERIOR_NIGHT, SCENE_TEMPLE_OF_TIME_EXTERIOR_RUINS, - SCENE_KNOW_IT_ALL_BROS_HOUSE, - SCENE_TWINS_HOUSE, - SCENE_MIDOS_HOUSE, - SCENE_SARIAS_HOUSE, - SCENE_BACK_ALLEY_HOUSE, - SCENE_BAZAAR, - SCENE_KOKIRI_SHOP, - SCENE_GORON_SHOP, - SCENE_ZORA_SHOP, - SCENE_POTION_SHOP_KAKARIKO, - SCENE_POTION_SHOP_MARKET, - SCENE_BOMBCHU_SHOP, - SCENE_HAPPY_MASK_SHOP, - SCENE_LINKS_HOUSE, - SCENE_DOG_LADY_HOUSE, - SCENE_STABLE, - SCENE_IMPAS_HOUSE, - SCENE_CARPENTERS_TENT, - SCENE_GRAVEKEEPERS_HUT, }; std::set skyboxSceneControlList = { @@ -84,6 +68,12 @@ std::set skyboxIdControlList = { SKYBOX_HOUSE_ALLEY, }; +static void SyncSkyboxTimeToCurrentTime() { + SOH::SetTimeSettings cmd; + cmd.settings = { 0xFF, 0xFF, static_cast(gPlayState->envCtx.timeIncrement) }; + Scene_CommandTimeSettings(gPlayState, &cmd); +} + void Register3DPreRenderedScenes() { // Runs after the scene commands have set play->skyboxId, but before Play_InitEnvironment builds the // skybox. Overriding the id here means Skybox_Setup loads a real sky; overriding it any later would @@ -98,11 +88,13 @@ void Register3DPreRenderedScenes() { gPlayState->envCtx.skyboxDisabled = false; // Replace skybox with normal sky + SyncSkyboxTimeToCurrentTime(); gPlayState->skyboxId = SKYBOX_NORMAL_SKY; // Apply the always cloudy skybox as an adult for Temple of Time and the Market if (sceneNum == SCENE_TEMPLE_OF_TIME_EXTERIOR_RUINS || sceneNum == SCENE_MARKET_RUINS || sceneNum == SCENE_MARKET_ENTRANCE_RUINS) { gWeatherMode = 3; + gSaveContext.retainWeatherMode = 1; } }); @@ -114,12 +106,8 @@ void Register3DPreRenderedScenes() { if ((HREG(80) != 10) || (HREG(82) != 0)) { // Furthest possible fog and zFar gPlayState->view.zFar = 12800; - gPlayState->lightCtx.fogNear = 996; // Set to 1000 to complete disable fog entirely + gPlayState->lightCtx.fogNear = 1000; gPlayState->lightCtx.fogFar = 12800; - // General gray fog color - gPlayState->lightCtx.fogColor[0] = 100; - gPlayState->lightCtx.fogColor[1] = 100; - gPlayState->lightCtx.fogColor[2] = 100; } }); diff --git a/soh/soh/resource/type/scenecommand/SetTimeSettings.h b/soh/soh/resource/type/scenecommand/SetTimeSettings.h index 13dc2c6364..53c5dd79ac 100644 --- a/soh/soh/resource/type/scenecommand/SetTimeSettings.h +++ b/soh/soh/resource/type/scenecommand/SetTimeSettings.h @@ -1,7 +1,6 @@ #pragma once #include -#include #include "SceneCommand.h" namespace SOH {