From f0a0773a1c0ae620bfe40bca28c49359b3ee11bd Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Thu, 16 Jan 2025 11:28:47 -0600 Subject: [PATCH] Added an option to disable gamma boost --- src/port/Engine.cpp | 6 +++++- src/port/ui/ImguiUI.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index f06eb4c8..8fa33ccf 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -47,6 +47,7 @@ namespace fs = std::filesystem; extern "C" { bool prevAltAssets = false; +bool gEnableGammaBoost = true; #include #include #include "sf64audio_provisional.h" @@ -214,6 +215,7 @@ GameEngine::GameEngine() { "SoundFont", static_cast(SF64::ResourceType::SoundFont), 0); prevAltAssets = CVarGetInteger("gEnhancements.Mods.AlternateAssets", 0); + gEnableGammaBoost = CVarGetInteger("gGraphics.GammaMode", 1) == 1; context->GetResourceManager()->SetAltAssetsEnabled(prevAltAssets); } @@ -405,7 +407,9 @@ void GameEngine::ProcessGfxCommands(Gfx* commands) { return; } - wnd->EnableSRGBMode(); + if(gEnableGammaBoost) { + wnd->EnableSRGBMode(); + } wnd->SetRendererUCode(UcodeHandlers::ucode_f3dex); std::vector> mtx_replacements; diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index b858cf47..b2330021 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -376,10 +376,10 @@ void DrawSettingsMenu(){ } UIWidgets::PaddedEnhancementCheckbox("Enable Alternative Assets", "gEnhancements.Mods.AlternateAssets"); + UIWidgets::EnhancementCheckbox("Enable Gamma Boost (Needs reload)", "gGraphics.GammaMode", false, "Gamma Boost is disabled in the current build of the game", UIWidgets::CheckboxGraphics::Cross, true); // If more filters are added to LUS, make sure to add them to the filters list here ImGui::Text("Texture Filter (Needs reload)"); - UIWidgets::EnhancementCombobox("gTextureFilter", filters, 0); UIWidgets::Spacer(0);