From 0f8815572991511e490e87a50e4e57d1648702e0 Mon Sep 17 00:00:00 2001 From: iwubcode Date: Thu, 7 Apr 2022 00:00:38 -0500 Subject: [PATCH] Core / DolphinQt / VideoCommon: add setting for enabling graphic mods --- Source/Core/Core/Config/GraphicsSettings.cpp | 2 ++ Source/Core/Core/Config/GraphicsSettings.h | 2 ++ Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp | 8 +++++++- Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.h | 1 + Source/Core/VideoCommon/VideoConfig.cpp | 2 ++ Source/Core/VideoCommon/VideoConfig.h | 1 + 6 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/Config/GraphicsSettings.cpp b/Source/Core/Core/Config/GraphicsSettings.cpp index b5b4f369f8..4bbcf99413 100644 --- a/Source/Core/Core/Config/GraphicsSettings.cpp +++ b/Source/Core/Core/Config/GraphicsSettings.cpp @@ -101,6 +101,8 @@ const Info GFX_SW_DRAW_END{{System::GFX, "Settings", "SWDrawEnd"}, 100000}; const Info GFX_PREFER_GLES{{System::GFX, "Settings", "PreferGLES"}, false}; +const Info GFX_MODS_ENABLE{{System::GFX, "Settings", "EnableMods"}, false}; + // Graphics.Enhancements const Info GFX_ENHANCE_FORCE_FILTERING{{System::GFX, "Enhancements", "ForceFiltering"}, diff --git a/Source/Core/Core/Config/GraphicsSettings.h b/Source/Core/Core/Config/GraphicsSettings.h index 6895501cb0..cdac08a77b 100644 --- a/Source/Core/Core/Config/GraphicsSettings.h +++ b/Source/Core/Core/Config/GraphicsSettings.h @@ -82,6 +82,8 @@ extern const Info GFX_SW_DRAW_END; extern const Info GFX_PREFER_GLES; +extern const Info GFX_MODS_ENABLE; + // Graphics.Enhancements extern const Info GFX_ENHANCE_FORCE_FILTERING; diff --git a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp index e604f7277a..b9f81b4746 100644 --- a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp @@ -72,13 +72,15 @@ void AdvancedWidget::CreateWidgets() m_dump_xfb_target = new GraphicsBool(tr("Dump XFB Target"), Config::GFX_DUMP_XFB_TARGET); m_disable_vram_copies = new GraphicsBool(tr("Disable EFB VRAM Copies"), Config::GFX_HACK_DISABLE_COPY_TO_VRAM); + m_enable_graphics_mods = new GraphicsBool(tr("Enable Graphics Mods"), Config::GFX_MODS_ENABLE); utility_layout->addWidget(m_load_custom_textures, 0, 0); utility_layout->addWidget(m_prefetch_custom_textures, 0, 1); utility_layout->addWidget(m_disable_vram_copies, 1, 0); + utility_layout->addWidget(m_enable_graphics_mods, 1, 1); - utility_layout->addWidget(m_dump_efb_target, 1, 1); + utility_layout->addWidget(m_dump_efb_target, 2, 0); utility_layout->addWidget(m_dump_xfb_target, 2, 1); // Texture dumping @@ -245,6 +247,9 @@ void AdvancedWidget::AddDescriptions() QT_TR_NOOP("Disables the VRAM copy of the EFB, forcing a round-trip to RAM. Inhibits all " "upscaling.

If unsure, leave this " "unchecked."); + static const char TR_LOAD_GRAPHICS_MODS_DESCRIPTION[] = + QT_TR_NOOP("Loads graphics mods from User/Load/GraphicsMods/.

If " + "unsure, leave this unchecked."); static const char TR_INTERNAL_RESOLUTION_FRAME_DUMPING_DESCRIPTION[] = QT_TR_NOOP( "Creates frame dumps and screenshots at the internal resolution of the renderer, rather than " "the size of the window it is displayed within.

If the aspect ratio is widescreen, " @@ -316,6 +321,7 @@ void AdvancedWidget::AddDescriptions() m_dump_efb_target->SetDescription(tr(TR_DUMP_EFB_DESCRIPTION)); m_dump_xfb_target->SetDescription(tr(TR_DUMP_XFB_DESCRIPTION)); m_disable_vram_copies->SetDescription(tr(TR_DISABLE_VRAM_COPIES_DESCRIPTION)); + m_enable_graphics_mods->SetDescription(tr(TR_LOAD_GRAPHICS_MODS_DESCRIPTION)); m_use_fullres_framedumps->SetDescription(tr(TR_INTERNAL_RESOLUTION_FRAME_DUMPING_DESCRIPTION)); #ifdef HAVE_FFMPEG m_dump_use_ffv1->SetDescription(tr(TR_USE_FFV1_DESCRIPTION)); diff --git a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.h b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.h index 1148a2df1b..1c469cbc62 100644 --- a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.h +++ b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.h @@ -42,6 +42,7 @@ private: GraphicsBool* m_dump_xfb_target; GraphicsBool* m_disable_vram_copies; GraphicsBool* m_load_custom_textures; + GraphicsBool* m_enable_graphics_mods; // Texture dumping GraphicsBool* m_dump_textures; diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index 58893c9267..c1ff163f9c 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -145,6 +145,8 @@ void VideoConfig::Refresh() bFastTextureSampling = Config::Get(Config::GFX_HACK_FAST_TEXTURE_SAMPLING); bPerfQueriesEnable = Config::Get(Config::GFX_PERF_QUERIES_ENABLE); + + bGraphicMods = Config::Get(Config::GFX_MODS_ENABLE); } void VideoConfig::VerifyValidity() diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index f557f7bfe7..7be25a6d88 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -111,6 +111,7 @@ struct VideoConfig final bool bBorderlessFullscreen = false; bool bEnableGPUTextureDecoding = false; int iBitrateKbps = 0; + bool bGraphicMods = false; // Hacks bool bEFBAccessEnable = false;