Make destination alpha render pass an option.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2663 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
donkopunchstania 2009-03-16 05:04:59 +00:00
parent 90254bd924
commit 7ef5e5cd1e
5 changed files with 15 additions and 1 deletions

View File

@ -61,6 +61,7 @@ void Config::Load()
iniFile.Get("Settings", "DumpEFBTarget", &bDumpEFBTarget, 0);
iniFile.Get("Settings", "ShowShaderErrors", &bShowShaderErrors, 0);
iniFile.Get("Settings", "MSAA", &iMultisampleMode, 0);
iniFile.Get("Settings", "DstAlphaPass", &bDstAlphaPass, false);
iniFile.Get("Settings", "TexFmtOverlayEnable", &bTexFmtOverlayEnable, 0);
iniFile.Get("Settings", "TexFmtOverlayCenter", &bTexFmtOverlayCenter, 0);
@ -109,6 +110,7 @@ void Config::Save()
iniFile.Set("Settings", "Wireframe", bWireFrame);
iniFile.Set("Settings", "DisableLighting", bDisableLighting);
iniFile.Set("Settings", "DisableTexturing", bDisableTexturing);
iniFile.Set("Settings", "DstAlphaPass", bDstAlphaPass);
iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering);
iniFile.Set("Enhancements", "MaxAnisotropy", iMaxAnisotropy);

View File

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

View File

@ -58,6 +58,7 @@ BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
EVT_CHECKBOX(ID_EFBCOPYDISABLEHOTKEY, ConfigDialog::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_PROJECTIONHACK1,ConfigDialog::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_SAFETEXTURECACHE,ConfigDialog::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_DSTALPHAPASS,ConfigDialog::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_CHECKBOX_DISABLECOPYEFB, ConfigDialog::AdvancedSettingsChanged)
EVT_RADIOBUTTON(ID_RADIO_COPYEFBTORAM, ConfigDialog::AdvancedSettingsChanged)
EVT_RADIOBUTTON(ID_RADIO_COPYEFBTOGL, ConfigDialog::AdvancedSettingsChanged)
@ -300,6 +301,9 @@ void ConfigDialog::CreateGUIControls()
m_DisableTexturing = new wxCheckBox(m_PageAdvanced, ID_DISABLETEXTURING, wxT("Disable Texturing"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_DisableTexturing->SetValue(g_Config.bDisableTexturing);
m_DisableTexturing->Enable(true);
m_DstAlphaPass = new wxCheckBox(m_PageAdvanced, ID_DSTALPHAPASS, wxT("Destination Alpha Pass"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_DstAlphaPass->SetValue(g_Config.bDstAlphaPass);
m_DstAlphaPass->Enable(true);
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"));
@ -344,6 +348,7 @@ void ConfigDialog::CreateGUIControls()
" [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"));
// Sizers
sHacks = new wxGridBagSizer(0, 0);
@ -370,6 +375,7 @@ void ConfigDialog::CreateGUIControls()
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);
wxStaticBoxSizer *sSBox = new wxStaticBoxSizer(m_StaticBox_EFB, wxVERTICAL);
wxBoxSizer *sStrip1 = new wxBoxSizer(wxHORIZONTAL);
@ -503,6 +509,9 @@ void ConfigDialog::AdvancedSettingsChanged(wxCommandEvent& event)
case ID_DISABLETEXTURING:
g_Config.bDisableTexturing = m_DisableTexturing->IsChecked();
break;
case ID_DSTALPHAPASS:
g_Config.bDstAlphaPass = m_DstAlphaPass->IsChecked();
break;
case ID_DUMPTEXTURES:
g_Config.bDumpTextures = m_DumpTextures->IsChecked();
break;

View File

@ -102,6 +102,7 @@ class ConfigDialog : public wxDialog
wxCheckBox *m_Wireframe;
wxCheckBox *m_DisableLighting;
wxCheckBox *m_DisableTexturing;
wxCheckBox *m_DstAlphaPass;
wxCheckBox *m_DumpTextures;
wxCheckBox *m_DumpEFBTarget;
wxStaticBox * m_StaticBox_EFB;
@ -163,6 +164,7 @@ class ConfigDialog : public wxDialog
ID_CHECKBOX_DISABLECOPYEFB,
ID_EFBCOPYDISABLEHOTKEY,
ID_PROJECTIONHACK1,
ID_DSTALPHAPASS,
ID_RADIO_COPYEFBTORAM,
ID_RADIO_COPYEFBTOGL,
};

View File

@ -285,7 +285,7 @@ void Flush()
}
// run through vertex groups again to set alpha
if (bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate) {
if (g_Config.bDstAlphaPass && bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate) {
ps = PixelShaderCache::GetShader(true);
if (ps) glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, ps->glprogid);