mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 07:09:48 -06:00
Added "Hacks" tab to OGL plugin config window and the hack option "Invert Depth". Use hacks to figure out some graphics bugs like the logo in ZWW is not a glDepth problem as I would figured it was. These hacks should be temp until the problem has been solved correctly. Also more hacks can help us figure out graphics problems we do not understand faster.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@971 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -72,6 +72,8 @@ void Config::Load()
|
|||||||
iniFile.Get("Enhancements", "ForceMaxAniso", &bForceMaxAniso, 0);
|
iniFile.Get("Enhancements", "ForceMaxAniso", &bForceMaxAniso, 0);
|
||||||
iniFile.Get("Enhancements", "StretchToFit", &bStretchToFit, false);
|
iniFile.Get("Enhancements", "StretchToFit", &bStretchToFit, false);
|
||||||
iniFile.Get("Enhancements", "KeepAR", &bKeepAR, false);
|
iniFile.Get("Enhancements", "KeepAR", &bKeepAR, false);
|
||||||
|
|
||||||
|
iniFile.Get("Hacks", "InvertDepth", &bInvertDepth, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::Save()
|
void Config::Save()
|
||||||
@ -100,5 +102,7 @@ void Config::Save()
|
|||||||
iniFile.Set("Enhancements", "StretchToFit", bStretchToFit);
|
iniFile.Set("Enhancements", "StretchToFit", bStretchToFit);
|
||||||
iniFile.Set("Enhancements", "KeepAR", bKeepAR);
|
iniFile.Set("Enhancements", "KeepAR", bKeepAR);
|
||||||
|
|
||||||
|
iniFile.Set("Hacks", "InvertDepth", bInvertDepth);
|
||||||
|
|
||||||
iniFile.Save("gfx_opengl.ini");
|
iniFile.Save("gfx_opengl.ini");
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,9 @@ struct Config
|
|||||||
bool bDumpTextures;
|
bool bDumpTextures;
|
||||||
char texDumpPath[280];
|
char texDumpPath[280];
|
||||||
|
|
||||||
|
// Hacks
|
||||||
|
bool bInvertDepth;
|
||||||
|
|
||||||
int iLog; // CONF_ bits
|
int iLog; // CONF_ bits
|
||||||
int iSaveTargetId;
|
int iSaveTargetId;
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
|
|||||||
EVT_CHECKBOX(ID_TEXFMTCENTER,ConfigDialog::TexFmtOverlayChange)
|
EVT_CHECKBOX(ID_TEXFMTCENTER,ConfigDialog::TexFmtOverlayChange)
|
||||||
EVT_CHECKBOX(ID_USEXFB,ConfigDialog::UseXFBChange)
|
EVT_CHECKBOX(ID_USEXFB,ConfigDialog::UseXFBChange)
|
||||||
EVT_CHECKBOX(ID_DUMPTEXTURES,ConfigDialog::DumpTexturesChange)
|
EVT_CHECKBOX(ID_DUMPTEXTURES,ConfigDialog::DumpTexturesChange)
|
||||||
|
EVT_CHECKBOX(ID_INVERTDEPTH,ConfigDialog::InvertDepth)
|
||||||
EVT_DIRPICKER_CHANGED(ID_TEXTUREPATH,ConfigDialog::TexturePathChange)
|
EVT_DIRPICKER_CHANGED(ID_TEXTUREPATH,ConfigDialog::TexturePathChange)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
@ -71,6 +72,9 @@ void ConfigDialog::CreateGUIControls()
|
|||||||
m_PageAdvanced = new wxPanel(m_Notebook, ID_PAGEADVANCED, wxDefaultPosition, wxDefaultSize);
|
m_PageAdvanced = new wxPanel(m_Notebook, ID_PAGEADVANCED, wxDefaultPosition, wxDefaultSize);
|
||||||
m_Notebook->AddPage(m_PageAdvanced, wxT("Advanced"));
|
m_Notebook->AddPage(m_PageAdvanced, wxT("Advanced"));
|
||||||
|
|
||||||
|
m_PageHacks = new wxPanel(m_Notebook, ID_PAGEHACKS, wxDefaultPosition, wxDefaultSize);
|
||||||
|
m_Notebook->AddPage(m_PageHacks, wxT("Hacks"));
|
||||||
|
|
||||||
//buttons
|
//buttons
|
||||||
m_About = new wxButton(this, ID_GRAPHIC_ABOUT, wxT("About"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
m_About = new wxButton(this, ID_GRAPHIC_ABOUT, wxT("About"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
m_OK = new wxButton(this, ID_OK, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
m_OK = new wxButton(this, ID_OK, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
@ -164,6 +168,11 @@ void ConfigDialog::CreateGUIControls()
|
|||||||
//m_ShaderErrors->SetValue(g_Config.bShowShaderErrors);
|
//m_ShaderErrors->SetValue(g_Config.bShowShaderErrors);
|
||||||
m_ShaderErrors->Enable(false);
|
m_ShaderErrors->Enable(false);
|
||||||
|
|
||||||
|
// Page 4 (hacks)
|
||||||
|
m_InvertDepth = new wxCheckBox(m_PageHacks, ID_INVERTDEPTH, wxT("Invert Depth"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
|
m_InvertDepth->Enable(true);
|
||||||
|
m_InvertDepth->SetValue(g_Config.bInvertDepth);
|
||||||
|
|
||||||
//Put options in sizers within the notebook
|
//Put options in sizers within the notebook
|
||||||
wxGridBagSizer* sPage1;
|
wxGridBagSizer* sPage1;
|
||||||
sPage1 = new wxGridBagSizer(0, 0);
|
sPage1 = new wxGridBagSizer(0, 0);
|
||||||
@ -206,6 +215,14 @@ void ConfigDialog::CreateGUIControls()
|
|||||||
m_PageAdvanced->SetSizer(sPage3);
|
m_PageAdvanced->SetSizer(sPage3);
|
||||||
sPage3->Layout();
|
sPage3->Layout();
|
||||||
|
|
||||||
|
wxGridBagSizer* sPage4;
|
||||||
|
sPage4 = new wxGridBagSizer(0, 0);
|
||||||
|
sPage4->SetFlexibleDirection(wxBOTH);
|
||||||
|
sPage4->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
|
||||||
|
sPage4->Add(m_InvertDepth, wxGBPosition(0, 0), wxGBSpan(1, 2), wxALL, 5);
|
||||||
|
m_PageHacks->SetSizer(sPage4);
|
||||||
|
sPage4->Layout();
|
||||||
|
|
||||||
SetIcon(wxNullIcon);
|
SetIcon(wxNullIcon);
|
||||||
Fit();
|
Fit();
|
||||||
}
|
}
|
||||||
@ -348,3 +365,7 @@ void ConfigDialog::DllAbout(wxCommandEvent& event)
|
|||||||
info.SetDescription(_T("Vertex/Pixel Shader 2.0 or higher, framebuffer objects, multiple render targets"));
|
info.SetDescription(_T("Vertex/Pixel Shader 2.0 or higher, framebuffer objects, multiple render targets"));
|
||||||
wxAboutBox(info);
|
wxAboutBox(info);
|
||||||
}
|
}
|
||||||
|
void ConfigDialog::InvertDepth(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
g_Config.bInvertDepth = m_InvertDepth->IsChecked();
|
||||||
|
}
|
||||||
|
@ -46,7 +46,8 @@ class ConfigDialog : public wxDialog
|
|||||||
virtual ~ConfigDialog();
|
virtual ~ConfigDialog();
|
||||||
void OKClick(wxCommandEvent& event);
|
void OKClick(wxCommandEvent& event);
|
||||||
|
|
||||||
void FullScreenCheck(wxCommandEvent& event); // video
|
// Video
|
||||||
|
void FullScreenCheck(wxCommandEvent& event);
|
||||||
void RenderMainCheck(wxCommandEvent& event);
|
void RenderMainCheck(wxCommandEvent& event);
|
||||||
void AddFSReso(char *reso);
|
void AddFSReso(char *reso);
|
||||||
void FSCB(wxCommandEvent& event);
|
void FSCB(wxCommandEvent& event);
|
||||||
@ -55,12 +56,14 @@ class ConfigDialog : public wxDialog
|
|||||||
void AddAAMode(int mode);
|
void AddAAMode(int mode);
|
||||||
void AACB(wxCommandEvent& event);
|
void AACB(wxCommandEvent& event);
|
||||||
|
|
||||||
void ForceFilteringCheck(wxCommandEvent& event); // enhancements
|
// Enhancements
|
||||||
|
void ForceFilteringCheck(wxCommandEvent& event);
|
||||||
void ForceAnisotropyCheck(wxCommandEvent& event);
|
void ForceAnisotropyCheck(wxCommandEvent& event);
|
||||||
void StretchToFitCheck(wxCommandEvent& event);
|
void StretchToFitCheck(wxCommandEvent& event);
|
||||||
void KeepARCheck(wxCommandEvent& event);
|
void KeepARCheck(wxCommandEvent& event);
|
||||||
|
|
||||||
void WireframeCheck(wxCommandEvent& event); // advanced
|
// Advanced
|
||||||
|
void WireframeCheck(wxCommandEvent& event);
|
||||||
void ShowFPSCheck(wxCommandEvent& event);
|
void ShowFPSCheck(wxCommandEvent& event);
|
||||||
void OverlayCheck(wxCommandEvent& event);
|
void OverlayCheck(wxCommandEvent& event);
|
||||||
void ShowShaderErrorsCheck(wxCommandEvent& event);
|
void ShowShaderErrorsCheck(wxCommandEvent& event);
|
||||||
@ -70,6 +73,9 @@ class ConfigDialog : public wxDialog
|
|||||||
void TexturePathChange(wxFileDirPickerEvent& event);
|
void TexturePathChange(wxFileDirPickerEvent& event);
|
||||||
void DllAbout(wxCommandEvent& event);
|
void DllAbout(wxCommandEvent& event);
|
||||||
|
|
||||||
|
// Hacks
|
||||||
|
void InvertDepth(wxCommandEvent& event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
wxButton* m_About;
|
wxButton* m_About;
|
||||||
@ -93,9 +99,11 @@ class ConfigDialog : public wxDialog
|
|||||||
wxComboBox *m_FullscreenCB;
|
wxComboBox *m_FullscreenCB;
|
||||||
wxCheckBox *m_RenderToMainWindow;
|
wxCheckBox *m_RenderToMainWindow;
|
||||||
wxCheckBox *m_Fullscreen;
|
wxCheckBox *m_Fullscreen;
|
||||||
|
wxCheckBox *m_InvertDepth;
|
||||||
wxPanel *m_PageAdvanced;
|
wxPanel *m_PageAdvanced;
|
||||||
wxPanel *m_PageEnhancements;
|
wxPanel *m_PageEnhancements;
|
||||||
wxPanel *m_PageVideo;
|
wxPanel *m_PageVideo;
|
||||||
|
wxPanel *m_PageHacks;
|
||||||
wxNotebook *m_Notebook;
|
wxNotebook *m_Notebook;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -130,6 +138,8 @@ class ConfigDialog : public wxDialog
|
|||||||
ID_NOTEBOOK,
|
ID_NOTEBOOK,
|
||||||
ID_PAGEVIDEO,
|
ID_PAGEVIDEO,
|
||||||
ID_PAGEENHANCEMENTS,
|
ID_PAGEENHANCEMENTS,
|
||||||
|
ID_INVERTDEPTH,
|
||||||
|
ID_PAGEHACKS,
|
||||||
ID_GRAPHIC_ABOUT,
|
ID_GRAPHIC_ABOUT,
|
||||||
////GUI Enum Control ID End
|
////GUI Enum Control ID End
|
||||||
ID_DUMMY_VALUE_ //don't remove this value unless you have other enum values
|
ID_DUMMY_VALUE_ //don't remove this value unless you have other enum values
|
||||||
|
@ -425,7 +425,7 @@ void VertexShaderMngr::SetConstants()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Metroid Prime 1 & 2 likes this
|
// Metroid Prime 1 & 2 likes this
|
||||||
glDepthRange(-(0.0f - (rawViewport[5]-rawViewport[2])/16777215.0f), rawViewport[5]/16777215.0f);
|
glDepthRange((g_Config.bInvertDepth ? -1 : 1) * -(0.0f - (rawViewport[5]-rawViewport[2])/16777215.0f), rawViewport[5]/16777215.0f);
|
||||||
|
|
||||||
// FZero stage likes this (a sonic hack)
|
// FZero stage likes this (a sonic hack)
|
||||||
// glDepthRange(-(0.0f - (rawViewport[5]-rawViewport[2])/-16777215.0f), rawViewport[5]/16777215.0f);
|
// glDepthRange(-(0.0f - (rawViewport[5]-rawViewport[2])/-16777215.0f), rawViewport[5]/16777215.0f);
|
||||||
|
Reference in New Issue
Block a user