From 08611c3f363b67e9a9aedef43d9e18bab1d232cf Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 3 May 2014 15:08:11 -0400 Subject: [PATCH] PixelShaderManager: Fizzle out fog changes when disabled here This lets us remove a use of GetConfig. --- Source/Core/VideoCommon/BPFunctions.cpp | 2 -- Source/Core/VideoCommon/BPFunctions.h | 1 - Source/Core/VideoCommon/BPStructs.cpp | 6 +++--- Source/Core/VideoCommon/PixelShaderManager.cpp | 6 ++++++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/Core/VideoCommon/BPFunctions.cpp b/Source/Core/VideoCommon/BPFunctions.cpp index 4d3be45498..89ace7baa5 100644 --- a/Source/Core/VideoCommon/BPFunctions.cpp +++ b/Source/Core/VideoCommon/BPFunctions.cpp @@ -229,8 +229,6 @@ bool GetConfig(const int &type) { case CONFIG_ISWII: return SConfig::GetInstance().m_LocalCoreStartupParameter.bWii; - case CONFIG_DISABLEFOG: - return g_ActiveConfig.bDisableFog; case CONFIG_SHOWEFBREGIONS: return g_ActiveConfig.bShowEFBCopyRegions; default: diff --git a/Source/Core/VideoCommon/BPFunctions.h b/Source/Core/VideoCommon/BPFunctions.h index d409a02a2f..888b469203 100644 --- a/Source/Core/VideoCommon/BPFunctions.h +++ b/Source/Core/VideoCommon/BPFunctions.h @@ -18,7 +18,6 @@ namespace BPFunctions enum { CONFIG_ISWII = 0, - CONFIG_DISABLEFOG, CONFIG_SHOWEFBREGIONS }; diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp index 2b6fe8441a..0194eb4ca7 100644 --- a/Source/Core/VideoCommon/BPStructs.cpp +++ b/Source/Core/VideoCommon/BPStructs.cpp @@ -290,18 +290,18 @@ void BPWritten(const BPCmd& bp) case BPMEM_FOGRANGE+3: case BPMEM_FOGRANGE+4: case BPMEM_FOGRANGE+5: - if (!GetConfig(CONFIG_DISABLEFOG) && bp.changes) + if (bp.changes) PixelShaderManager::SetFogRangeAdjustChanged(); break; case BPMEM_FOGPARAM0: case BPMEM_FOGBMAGNITUDE: case BPMEM_FOGBEXPONENT: case BPMEM_FOGPARAM3: - if (!GetConfig(CONFIG_DISABLEFOG) && bp.changes) + if (bp.changes) PixelShaderManager::SetFogParamChanged(); break; case BPMEM_FOGCOLOR: // Fog Color - if (!GetConfig(CONFIG_DISABLEFOG) && bp.changes) + if (bp.changes) PixelShaderManager::SetFogColorChanged(); break; case BPMEM_ALPHACOMPARE: // Compare Alpha Values diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp index 4ca5d38f81..551f881c3e 100644 --- a/Source/Core/VideoCommon/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/PixelShaderManager.cpp @@ -268,6 +268,9 @@ void PixelShaderManager::SetTexCoordChanged(u8 texmapid) void PixelShaderManager::SetFogColorChanged() { + if (g_ActiveConfig.bDisableFog) + return; + constants.fogcolor[0] = bpmem.fog.color.r; constants.fogcolor[1] = bpmem.fog.color.g; constants.fogcolor[2] = bpmem.fog.color.b; @@ -295,6 +298,9 @@ void PixelShaderManager::SetFogParamChanged() void PixelShaderManager::SetFogRangeAdjustChanged() { + if (g_ActiveConfig.bDisableFog) + return; + s_bFogRangeAdjustChanged = true; }