From f8335271cde44b817e8d7287606db5304a8aece7 Mon Sep 17 00:00:00 2001 From: "sl1nk3.s" Date: Wed, 1 Apr 2009 12:31:18 +0000 Subject: [PATCH] Added option to disable fog as it's been requested a few times (mainly for RE games, see issue 715 and issue 181) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2814 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugins/Plugin_VideoOGL/Src/BPStructs.cpp | 11 +++++---- Source/Plugins/Plugin_VideoOGL/Src/Config.cpp | 2 ++ Source/Plugins/Plugin_VideoOGL/Src/Config.h | 1 + .../Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp | 24 +++++++++++++------ .../Plugin_VideoOGL/Src/GUI/ConfigDlg.h | 2 ++ 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp b/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp index 8faade3df2..40ef1070ac 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp @@ -247,11 +247,12 @@ void BPWritten(int addr, int changes, int newval) case BPMEM_FOGBEXPONENT: case BPMEM_FOGBMAGNITUDE: case BPMEM_FOGPARAM3: - if (changes) { - VertexManager::Flush(); - ((u32*)&bpmem)[addr] = newval; - PixelShaderManager::SetFogParamChanged(); - } + if (!g_Config.bDisableFog) + if (changes) { + VertexManager::Flush(); + ((u32*)&bpmem)[addr] = newval; + PixelShaderManager::SetFogParamChanged(); + } break; case BPMEM_FOGCOLOR: diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Config.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Config.cpp index 32e9cc5d8c..cc5de6ae71 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Config.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Config.cpp @@ -71,6 +71,7 @@ void Config::Load() iniFile.Get("Settings", "WireFrame", &bWireFrame, 0); iniFile.Get("Settings", "DisableLighting", &bDisableLighting, 0); iniFile.Get("Settings", "DisableTexturing", &bDisableTexturing, 0); + iniFile.Get("Settings", "DisableFog", &bDisableFog, 0); iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0); iniFile.Get("Enhancements", "MaxAnisotropy", &iMaxAnisotropy, 3); // NOTE - this is x in (1 << x) @@ -154,6 +155,7 @@ void Config::Save() iniFile.Set("Settings", "DisableLighting", bDisableLighting); iniFile.Set("Settings", "DisableTexturing", bDisableTexturing); iniFile.Set("Settings", "DstAlphaPass", bDstAlphaPass); + iniFile.Set("Settings", "DisableFog", bDisableFog); iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering); iniFile.Set("Enhancements", "MaxAnisotropy", iMaxAnisotropy); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Config.h b/Source/Plugins/Plugin_VideoOGL/Src/Config.h index 4d3b5c90ca..f834c67df7 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Config.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/Config.h @@ -80,6 +80,7 @@ struct Config bool bDisableLighting; bool bDisableTexturing; bool bDstAlphaPass; + bool bDisableFog; // Utility bool bDumpTextures; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp index 029c3e8780..33651c7193 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp @@ -57,6 +57,7 @@ BEGIN_EVENT_TABLE(ConfigDialog,wxDialog) EVT_CHECKBOX(ID_DUMPFRAMES, ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_DISABLELIGHTING, ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_DISABLETEXTURING, ConfigDialog::AdvancedSettingsChanged) + EVT_CHECKBOX(ID_DISABLEFOG, ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_EFBCOPYDISABLEHOTKEY, ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_PROJECTIONHACK1,ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_SAFETEXTURECACHE,ConfigDialog::AdvancedSettingsChanged) @@ -308,6 +309,8 @@ void ConfigDialog::CreateGUIControls() m_DstAlphaPass = new wxCheckBox(m_PageAdvanced, ID_DSTALPHAPASS, wxT("Disable Destination Alpha Pass"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_DstAlphaPass->SetValue(g_Config.bDstAlphaPass); m_DstAlphaPass->Enable(true); + m_DisableFog = new wxCheckBox(m_PageAdvanced, ID_DISABLEFOG, wxT("Disable Fog"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + m_DisableFog->SetValue(g_Config.bDisableFog); m_StaticBox_EFB = new wxStaticBox(m_PageAdvanced, ID_STATICBOX_EFB, wxT("EFB Copy")); m_CheckBox_DisableCopyEFB = new wxCheckBox(m_PageAdvanced, ID_CHECKBOX_DISABLECOPYEFB, wxT("Disable")); @@ -361,10 +364,12 @@ void ConfigDialog::CreateGUIControls() // Tool tips m_SafeTextureCache->SetToolTip(wxT("This is useful to prevent Metroid Prime from crashing, but can cause problems in other games." - " [This option will apply immediately and does not require a restart. However it may not" + "\n[This option will apply immediately and does not require a restart. However it may not" " be entirely safe to change it midgames.]")); m_ProjectionHax1->SetToolTip(wxT("This should get ZTP's Bloom to show")); - m_DstAlphaPass->SetToolTip(wxT("This renders a second time to set alpha to a constant value")); + m_DstAlphaPass->SetToolTip(wxT("This renders a second time to set alpha to a constant value," + "\nDisabling it may speed up some games, but could also cause glitches.")); + m_DisableFog->SetToolTip(wxT("This option should not require a restart.")); // Sizers sHacks = new wxGridBagSizer(0, 0); @@ -389,11 +394,12 @@ void ConfigDialog::CreateGUIControls() wxBoxSizer *sRenderBoxRow1 = new wxBoxSizer(wxHORIZONTAL); sRendering = new wxGridBagSizer(0, 0); - sRendering->Add(m_Wireframe, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 5); - sRendering->Add(m_DisableLighting, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5); - sRendering->Add(m_DisableTexturing, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALL, 5); - sRendering->Add(m_DstAlphaPass, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALL, 5); - sRenderBoxRow1->Add(sRendering, 0, wxALL|wxEXPAND, 5); + sRendering->Add(m_Wireframe, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 4); + sRendering->Add(m_DisableLighting, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 4); + sRendering->Add(m_DisableTexturing, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALL, 4); + sRendering->Add(m_DstAlphaPass, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALL, 4); + sRendering->Add(m_DisableFog, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALL, 4); + sRenderBoxRow1->Add(sRendering, 0, wxALL|wxEXPAND, 1); wxStaticBoxSizer *sSBox = new wxStaticBoxSizer(m_StaticBox_EFB, wxVERTICAL); wxBoxSizer *sStrip1 = new wxBoxSizer(wxHORIZONTAL); sStrip1->Add(m_CheckBox_DisableCopyEFB, 0, wxALL|wxEXPAND, 5); @@ -530,6 +536,10 @@ void ConfigDialog::AdvancedSettingsChanged(wxCommandEvent& event) case ID_DISABLETEXTURING: g_Config.bDisableTexturing = m_DisableTexturing->IsChecked(); break; + case ID_DISABLEFOG: + g_Config.bDisableFog = m_DisableFog->IsChecked(); + break; + case ID_DSTALPHAPASS: g_Config.bDstAlphaPass = m_DstAlphaPass->IsChecked(); break; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h index edd7fe5fd3..fb883d3c78 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h @@ -103,6 +103,7 @@ class ConfigDialog : public wxDialog wxCheckBox *m_Wireframe; wxCheckBox *m_DisableLighting; wxCheckBox *m_DisableTexturing; + wxCheckBox *m_DisableFog; wxCheckBox *m_DstAlphaPass; wxCheckBox *m_DumpTextures; wxCheckBox *m_DumpEFBTarget; @@ -157,6 +158,7 @@ class ConfigDialog : public wxDialog ID_WIREFRAME, ID_DISABLELIGHTING, ID_DISABLETEXTURING, + ID_DISABLEFOG, ID_STATICBOX_EFB, ID_SAFETEXTURECACHE,