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
This commit is contained in:
sl1nk3.s 2009-04-01 12:31:18 +00:00
parent d8dfcf2a4b
commit f8335271cd
5 changed files with 28 additions and 12 deletions

View File

@ -247,6 +247,7 @@ void BPWritten(int addr, int changes, int newval)
case BPMEM_FOGBEXPONENT: case BPMEM_FOGBEXPONENT:
case BPMEM_FOGBMAGNITUDE: case BPMEM_FOGBMAGNITUDE:
case BPMEM_FOGPARAM3: case BPMEM_FOGPARAM3:
if (!g_Config.bDisableFog)
if (changes) { if (changes) {
VertexManager::Flush(); VertexManager::Flush();
((u32*)&bpmem)[addr] = newval; ((u32*)&bpmem)[addr] = newval;

View File

@ -71,6 +71,7 @@ void Config::Load()
iniFile.Get("Settings", "WireFrame", &bWireFrame, 0); iniFile.Get("Settings", "WireFrame", &bWireFrame, 0);
iniFile.Get("Settings", "DisableLighting", &bDisableLighting, 0); iniFile.Get("Settings", "DisableLighting", &bDisableLighting, 0);
iniFile.Get("Settings", "DisableTexturing", &bDisableTexturing, 0); iniFile.Get("Settings", "DisableTexturing", &bDisableTexturing, 0);
iniFile.Get("Settings", "DisableFog", &bDisableFog, 0);
iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0); iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
iniFile.Get("Enhancements", "MaxAnisotropy", &iMaxAnisotropy, 3); // NOTE - this is x in (1 << x) 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", "DisableLighting", bDisableLighting);
iniFile.Set("Settings", "DisableTexturing", bDisableTexturing); iniFile.Set("Settings", "DisableTexturing", bDisableTexturing);
iniFile.Set("Settings", "DstAlphaPass", bDstAlphaPass); iniFile.Set("Settings", "DstAlphaPass", bDstAlphaPass);
iniFile.Set("Settings", "DisableFog", bDisableFog);
iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering); iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering);
iniFile.Set("Enhancements", "MaxAnisotropy", iMaxAnisotropy); iniFile.Set("Enhancements", "MaxAnisotropy", iMaxAnisotropy);

View File

@ -80,6 +80,7 @@ struct Config
bool bDisableLighting; bool bDisableLighting;
bool bDisableTexturing; bool bDisableTexturing;
bool bDstAlphaPass; bool bDstAlphaPass;
bool bDisableFog;
// Utility // Utility
bool bDumpTextures; bool bDumpTextures;

View File

@ -57,6 +57,7 @@ BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
EVT_CHECKBOX(ID_DUMPFRAMES, ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_DUMPFRAMES, ConfigDialog::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_DISABLELIGHTING, ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_DISABLELIGHTING, ConfigDialog::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_DISABLETEXTURING, ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_DISABLETEXTURING, ConfigDialog::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_DISABLEFOG, ConfigDialog::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_EFBCOPYDISABLEHOTKEY, ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_EFBCOPYDISABLEHOTKEY, ConfigDialog::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_PROJECTIONHACK1,ConfigDialog::AdvancedSettingsChanged) EVT_CHECKBOX(ID_PROJECTIONHACK1,ConfigDialog::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_SAFETEXTURECACHE,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 = new wxCheckBox(m_PageAdvanced, ID_DSTALPHAPASS, wxT("Disable Destination Alpha Pass"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_DstAlphaPass->SetValue(g_Config.bDstAlphaPass); m_DstAlphaPass->SetValue(g_Config.bDstAlphaPass);
m_DstAlphaPass->Enable(true); 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_StaticBox_EFB = new wxStaticBox(m_PageAdvanced, ID_STATICBOX_EFB, wxT("EFB Copy"));
m_CheckBox_DisableCopyEFB = new wxCheckBox(m_PageAdvanced, ID_CHECKBOX_DISABLECOPYEFB, wxT("Disable")); m_CheckBox_DisableCopyEFB = new wxCheckBox(m_PageAdvanced, ID_CHECKBOX_DISABLECOPYEFB, wxT("Disable"));
@ -361,10 +364,12 @@ void ConfigDialog::CreateGUIControls()
// Tool tips // Tool tips
m_SafeTextureCache->SetToolTip(wxT("This is useful to prevent Metroid Prime from crashing, but can cause problems in other games." 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.]")); " be entirely safe to change it midgames.]"));
m_ProjectionHax1->SetToolTip(wxT("This should get ZTP's Bloom to show")); 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 // Sizers
sHacks = new wxGridBagSizer(0, 0); sHacks = new wxGridBagSizer(0, 0);
@ -389,11 +394,12 @@ void ConfigDialog::CreateGUIControls()
wxBoxSizer *sRenderBoxRow1 = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *sRenderBoxRow1 = new wxBoxSizer(wxHORIZONTAL);
sRendering = new wxGridBagSizer(0, 0); sRendering = new wxGridBagSizer(0, 0);
sRendering->Add(m_Wireframe, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 5); sRendering->Add(m_Wireframe, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 4);
sRendering->Add(m_DisableLighting, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5); sRendering->Add(m_DisableLighting, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 4);
sRendering->Add(m_DisableTexturing, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALL, 5); sRendering->Add(m_DisableTexturing, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALL, 4);
sRendering->Add(m_DstAlphaPass, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALL, 5); sRendering->Add(m_DstAlphaPass, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALL, 4);
sRenderBoxRow1->Add(sRendering, 0, wxALL|wxEXPAND, 5); 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); wxStaticBoxSizer *sSBox = new wxStaticBoxSizer(m_StaticBox_EFB, wxVERTICAL);
wxBoxSizer *sStrip1 = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *sStrip1 = new wxBoxSizer(wxHORIZONTAL);
sStrip1->Add(m_CheckBox_DisableCopyEFB, 0, wxALL|wxEXPAND, 5); sStrip1->Add(m_CheckBox_DisableCopyEFB, 0, wxALL|wxEXPAND, 5);
@ -530,6 +536,10 @@ void ConfigDialog::AdvancedSettingsChanged(wxCommandEvent& event)
case ID_DISABLETEXTURING: case ID_DISABLETEXTURING:
g_Config.bDisableTexturing = m_DisableTexturing->IsChecked(); g_Config.bDisableTexturing = m_DisableTexturing->IsChecked();
break; break;
case ID_DISABLEFOG:
g_Config.bDisableFog = m_DisableFog->IsChecked();
break;
case ID_DSTALPHAPASS: case ID_DSTALPHAPASS:
g_Config.bDstAlphaPass = m_DstAlphaPass->IsChecked(); g_Config.bDstAlphaPass = m_DstAlphaPass->IsChecked();
break; break;

View File

@ -103,6 +103,7 @@ class ConfigDialog : public wxDialog
wxCheckBox *m_Wireframe; wxCheckBox *m_Wireframe;
wxCheckBox *m_DisableLighting; wxCheckBox *m_DisableLighting;
wxCheckBox *m_DisableTexturing; wxCheckBox *m_DisableTexturing;
wxCheckBox *m_DisableFog;
wxCheckBox *m_DstAlphaPass; wxCheckBox *m_DstAlphaPass;
wxCheckBox *m_DumpTextures; wxCheckBox *m_DumpTextures;
wxCheckBox *m_DumpEFBTarget; wxCheckBox *m_DumpEFBTarget;
@ -157,6 +158,7 @@ class ConfigDialog : public wxDialog
ID_WIREFRAME, ID_WIREFRAME,
ID_DISABLELIGHTING, ID_DISABLELIGHTING,
ID_DISABLETEXTURING, ID_DISABLETEXTURING,
ID_DISABLEFOG,
ID_STATICBOX_EFB, ID_STATICBOX_EFB,
ID_SAFETEXTURECACHE, ID_SAFETEXTURECACHE,