mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 09:39:46 -06:00
finish proper window handling, fix the modal state of the config dialogs, plus some minor cleanup/changes :p
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5129 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -34,8 +34,8 @@
|
||||
|
||||
BEGIN_EVENT_TABLE(GFXConfigDialogOGL,wxDialog)
|
||||
EVT_CLOSE(GFXConfigDialogOGL::OnClose)
|
||||
EVT_BUTTON(ID_CLOSE, GFXConfigDialogOGL::CloseClick)
|
||||
EVT_BUTTON(ID_ABOUTOGL, GFXConfigDialogOGL::AboutClick)
|
||||
EVT_BUTTON(wxID_CLOSE, GFXConfigDialogOGL::CloseClick)
|
||||
EVT_BUTTON(wxID_ABOUT, GFXConfigDialogOGL::AboutClick)
|
||||
EVT_CHECKBOX(ID_FULLSCREEN, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_VSYNC, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
EVT_CHECKBOX(ID_RENDERTOMAINWINDOW, GFXConfigDialogOGL::GeneralSettingsChanged)
|
||||
@ -65,7 +65,7 @@ BEGIN_EVENT_TABLE(GFXConfigDialogOGL,wxDialog)
|
||||
EVT_CHECKBOX(ID_DUMPTEXTURES, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_HIRESTEXTURES, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DUMPEFBTARGET, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DUMPFRAMES, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DUMPFRAMES, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_FREELOOK, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DISABLELIGHTING, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DISABLETEXTURING, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
@ -73,7 +73,7 @@ BEGIN_EVENT_TABLE(GFXConfigDialogOGL,wxDialog)
|
||||
EVT_CHECKBOX(ID_OSDHOTKEY, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_HACK, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_SAFETEXTURECACHE,GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DSTALPHAPASS,GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_DSTALPHAPASS,GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_CHECKBOX(ID_CHECKBOX_DISABLECOPYEFB, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_RADIOBUTTON(ID_RADIO_COPYEFBTORAM, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
EVT_RADIOBUTTON(ID_RADIO_COPYEFBTOGL, GFXConfigDialogOGL::AdvancedSettingsChanged)
|
||||
@ -86,6 +86,7 @@ END_EVENT_TABLE()
|
||||
GFXConfigDialogOGL::GFXConfigDialogOGL(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
|
||||
: wxDialog(parent, id, title, position, size, style)
|
||||
{
|
||||
CreateGUIControls();
|
||||
}
|
||||
|
||||
|
||||
@ -95,6 +96,7 @@ GFXConfigDialogOGL::~GFXConfigDialogOGL()
|
||||
{
|
||||
INFO_LOG(CONSOLE, "GFXConfigDialogOGL Closed");
|
||||
}
|
||||
|
||||
void GFXConfigDialogOGL::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
//INFO_LOG(CONSOLE, "OnClose");
|
||||
@ -161,6 +163,7 @@ void GFXConfigDialogOGL::LoadShaders()
|
||||
File::CreateDir(File::GetUserPath(D_SHADERS_IDX));
|
||||
}
|
||||
}
|
||||
|
||||
void GFXConfigDialogOGL::InitializeGUILists()
|
||||
{
|
||||
// Resolutions
|
||||
@ -206,6 +209,7 @@ void GFXConfigDialogOGL::InitializeGUILists()
|
||||
arrayStringFor_PhackvalueCB.Add(wxT("Baten Kaitos Origin"));
|
||||
arrayStringFor_PhackvalueCB.Add(wxT("Skies of Arcadia"));
|
||||
}
|
||||
|
||||
void GFXConfigDialogOGL::InitializeGUIValues()
|
||||
{
|
||||
// General Display Settings
|
||||
@ -257,8 +261,8 @@ void GFXConfigDialogOGL::InitializeGUIValues()
|
||||
m_Wireframe->SetValue(g_Config.bWireFrame);
|
||||
m_DisableLighting->SetValue(g_Config.bDisableLighting);
|
||||
m_DisableTexturing->SetValue(g_Config.bDisableTexturing);
|
||||
m_DstAlphaPass->SetValue(g_Config.bDstAlphaPass);
|
||||
m_DisableFog->SetValue(g_Config.bDisableFog);
|
||||
m_DstAlphaPass->SetValue(g_Config.bDstAlphaPass);
|
||||
m_DisableFog->SetValue(g_Config.bDisableFog);
|
||||
|
||||
m_CheckBox_DisableCopyEFB->SetValue(g_Config.bEFBCopyDisable);
|
||||
g_Config.bCopyEFBToTexture ? m_Radio_CopyEFBToGL->SetValue(true) : m_Radio_CopyEFBToRAM->SetValue(true);
|
||||
@ -274,6 +278,7 @@ void GFXConfigDialogOGL::InitializeGUIValues()
|
||||
m_PhackvalueCB->SetSelection(g_Config.iPhackvalue);
|
||||
m_SafeTextureCache->SetValue(g_Config.bSafeTextureCache);
|
||||
}
|
||||
|
||||
void GFXConfigDialogOGL::InitializeGUITooltips()
|
||||
{
|
||||
// Tool tips
|
||||
@ -343,6 +348,7 @@ void GFXConfigDialogOGL::InitializeGUITooltips()
|
||||
wxT("\n[This option will apply immediately and does not require a restart. However it may not")
|
||||
wxT(" be entirely safe to change it midgames.]"));
|
||||
}
|
||||
|
||||
void GFXConfigDialogOGL::CreateGUIControls()
|
||||
{
|
||||
InitializeGUILists();
|
||||
@ -355,8 +361,8 @@ void GFXConfigDialogOGL::CreateGUIControls()
|
||||
m_Notebook->AddPage(m_PageAdvanced, wxT("Advanced"));
|
||||
|
||||
// Buttons
|
||||
m_About = new wxButton(this, ID_ABOUTOGL, wxT("About"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Close = new wxButton(this, ID_CLOSE, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_About = new wxButton(this, wxID_ABOUT, wxT("About"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Close = new wxButton(this, wxID_CLOSE, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
|
||||
// Put notebook and buttons in sizers
|
||||
wxBoxSizer* sButtons;
|
||||
@ -418,7 +424,7 @@ void GFXConfigDialogOGL::CreateGUIControls()
|
||||
|
||||
// Sizers
|
||||
sGeneral = new wxBoxSizer(wxVERTICAL);
|
||||
sBasic = new wxGridBagSizer(0, 0);
|
||||
sBasic = new wxGridBagSizer(0, 0);
|
||||
|
||||
sBasic->Add(IRText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL | wxALL, 5);
|
||||
sBasic->Add(m_NativeResolution, wxGBPosition(0, 1), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL | wxALL, 5);
|
||||
@ -428,7 +434,7 @@ void GFXConfigDialogOGL::CreateGUIControls()
|
||||
sBasic->Add(WMText, wxGBPosition(1, 1), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL | wxALL, 5);
|
||||
sBasic->Add(m_WindowResolutionCB, wxGBPosition(2, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
sBasic->Add(m_Fullscreen, wxGBPosition(1, 2), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL | wxALL, 5);
|
||||
sBasic->Add(m_WindowFSResolutionCB, wxGBPosition(2, 2), wxGBSpan(1, 1), wxALL, 5);
|
||||
sBasic->Add(m_WindowFSResolutionCB, wxGBPosition(2, 2), wxGBSpan(1, 1), wxALL, 5);
|
||||
|
||||
sBasic->Add(KeepARText, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL | wxALL, 5);
|
||||
sBasic->Add(m_KeepAR, wxGBPosition(3, 1), wxGBSpan(1, 1), wxALL, 5);
|
||||
@ -485,8 +491,8 @@ void GFXConfigDialogOGL::CreateGUIControls()
|
||||
m_Wireframe = new wxCheckBox(m_PageAdvanced, ID_WIREFRAME, wxT("Enable Wireframe"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_DisableLighting = new wxCheckBox(m_PageAdvanced, ID_DISABLELIGHTING, wxT("Disable Material Lighting"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_DisableTexturing = new wxCheckBox(m_PageAdvanced, ID_DISABLETEXTURING, wxT("Disable Texturing"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_DstAlphaPass = new wxCheckBox(m_PageAdvanced, ID_DSTALPHAPASS, wxT("Disable Destination Alpha Pass"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_DisableFog = new wxCheckBox(m_PageAdvanced, ID_DISABLEFOG, wxT("Disable Fog"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_DstAlphaPass = new wxCheckBox(m_PageAdvanced, ID_DSTALPHAPASS, wxT("Disable Destination Alpha Pass"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_DisableFog = new wxCheckBox(m_PageAdvanced, ID_DISABLEFOG, wxT("Disable Fog"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
|
||||
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"));
|
||||
@ -506,7 +512,6 @@ void GFXConfigDialogOGL::CreateGUIControls()
|
||||
m_SafeTextureCache = new wxCheckBox(m_PageAdvanced, ID_SAFETEXTURECACHE, wxT("Use Safe texture cache"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_PhackvalueCB = new wxChoice(m_PageAdvanced, ID_PHACKVALUE, wxDefaultPosition, wxDefaultSize, arrayStringFor_PhackvalueCB, 0, wxDefaultValidator);
|
||||
|
||||
|
||||
// Sizers
|
||||
sHacks = new wxGridBagSizer(0, 0);
|
||||
sHacks->Add(m_SafeTextureCache, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5);
|
||||
@ -530,7 +535,7 @@ void GFXConfigDialogOGL::CreateGUIControls()
|
||||
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_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);
|
||||
@ -542,12 +547,12 @@ void GFXConfigDialogOGL::CreateGUIControls()
|
||||
sRenderBoxRow1->Add(sSBox, 0, wxALL|wxEXPAND, 5);
|
||||
sbRendering->Add(sRenderBoxRow1);
|
||||
|
||||
sUtilities = new wxGridBagSizer(0, 0);
|
||||
sUtilities = new wxGridBagSizer(0, 0);
|
||||
sUtilities->Add(m_DumpTextures, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sUtilities->Add(m_HiresTextures, wxGBPosition(0, 1), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sUtilities->Add(m_DumpEFBTarget, wxGBPosition(0, 2), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sUtilities->Add(m_DumpFrames, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sUtilities->Add(m_FreeLook, wxGBPosition(1, 1), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sUtilities->Add(m_FreeLook, wxGBPosition(1, 1), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
sbUtilities->Add(sUtilities, 1, wxEXPAND);
|
||||
|
||||
// Sizers
|
||||
@ -567,7 +572,6 @@ void GFXConfigDialogOGL::CreateGUIControls()
|
||||
UpdateGUI();
|
||||
}
|
||||
|
||||
|
||||
void GFXConfigDialogOGL::AboutClick(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
wxMessageBox(wxT("Dolphin OpenGL Plugin\nBy zerofrog(@gmail.com)\n\n")
|
||||
@ -645,10 +649,10 @@ void GFXConfigDialogOGL::GeneralSettingsChanged(wxCommandEvent& event)
|
||||
g_Config.bWidescreenHack = m_WidescreenHack->IsChecked();
|
||||
break;
|
||||
case ID_CROP:
|
||||
g_Config.bCrop = m_Crop->IsChecked();
|
||||
g_Config.bCrop = m_Crop->IsChecked();
|
||||
break;
|
||||
case ID_FORCEFILTERING:
|
||||
g_Config.bForceFiltering = m_ForceFiltering->IsChecked();
|
||||
g_Config.bForceFiltering = m_ForceFiltering->IsChecked();
|
||||
break;
|
||||
#ifndef _WIN32
|
||||
case ID_HIDECURSOR:
|
||||
@ -684,7 +688,6 @@ void GFXConfigDialogOGL::GeneralSettingsChanged(wxCommandEvent& event)
|
||||
UpdateGUI();
|
||||
}
|
||||
|
||||
|
||||
void GFXConfigDialogOGL::AdvancedSettingsChanged(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
@ -721,8 +724,8 @@ void GFXConfigDialogOGL::AdvancedSettingsChanged(wxCommandEvent& event)
|
||||
break;
|
||||
case ID_DISABLEFOG:
|
||||
g_Config.bDisableFog = m_DisableFog->IsChecked();
|
||||
break;
|
||||
case ID_DSTALPHAPASS:
|
||||
break;
|
||||
case ID_DSTALPHAPASS:
|
||||
g_Config.bDstAlphaPass = m_DstAlphaPass->IsChecked();
|
||||
break;
|
||||
case ID_DUMPTEXTURES:
|
||||
@ -737,7 +740,7 @@ void GFXConfigDialogOGL::AdvancedSettingsChanged(wxCommandEvent& event)
|
||||
case ID_DUMPFRAMES:
|
||||
g_Config.bDumpFrames = m_DumpFrames->IsChecked();
|
||||
break;
|
||||
case ID_FREELOOK:
|
||||
case ID_FREELOOK:
|
||||
g_Config.bFreeLook = m_FreeLook->IsChecked();
|
||||
break;
|
||||
case ID_TEXTUREPATH:
|
||||
@ -809,8 +812,6 @@ void GFXConfigDialogOGL::UpdateGUI()
|
||||
|
||||
// Disable the Copy to options when EFBCopy is disabled
|
||||
m_Radio_CopyEFBToRAM->Enable(!(g_Config.bEFBCopyDisable));
|
||||
m_Radio_CopyEFBToGL->Enable(!(g_Config.bEFBCopyDisable));
|
||||
m_Radio_CopyEFBToGL->Enable(!(g_Config.bEFBCopyDisable));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -48,7 +48,7 @@ enum
|
||||
class GFXConfigDialogOGL : public wxDialog
|
||||
{
|
||||
public:
|
||||
GFXConfigDialogOGL(wxWindow *parent, wxWindowID id = 1,
|
||||
GFXConfigDialogOGL(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||
#ifdef DEBUGFAST
|
||||
const wxString &title = wxT("OpenGL (DEBUGFAST) Plugin Configuration"),
|
||||
#else
|
||||
@ -123,12 +123,12 @@ class GFXConfigDialogOGL : public wxDialog
|
||||
wxCheckBox *m_DisableLighting;
|
||||
wxCheckBox *m_DisableTexturing;
|
||||
wxCheckBox *m_DisableFog;
|
||||
wxCheckBox *m_DstAlphaPass;
|
||||
wxCheckBox *m_DstAlphaPass;
|
||||
wxCheckBox *m_DumpTextures;
|
||||
wxCheckBox *m_HiresTextures;
|
||||
wxCheckBox *m_DumpEFBTarget;
|
||||
wxCheckBox *m_DumpFrames;
|
||||
wxCheckBox *m_FreeLook;
|
||||
wxCheckBox *m_FreeLook;
|
||||
wxStaticBox * m_StaticBox_EFB;
|
||||
wxCheckBox *m_CheckBox_DisableCopyEFB;
|
||||
wxRadioButton *m_Radio_CopyEFBToRAM, *m_Radio_CopyEFBToGL;
|
||||
@ -150,10 +150,7 @@ class GFXConfigDialogOGL : public wxDialog
|
||||
|
||||
enum
|
||||
{
|
||||
ID_CLOSE = 1000,
|
||||
ID_ABOUTOGL,
|
||||
|
||||
ID_NOTEBOOK,
|
||||
ID_NOTEBOOK = 1000,
|
||||
ID_PAGEGENERAL,
|
||||
ID_PAGEADVANCED,
|
||||
|
||||
@ -204,13 +201,13 @@ class GFXConfigDialogOGL : public wxDialog
|
||||
ID_HIRESTEXTURES,
|
||||
ID_DUMPEFBTARGET,
|
||||
ID_DUMPFRAMES,
|
||||
ID_FREELOOK,
|
||||
ID_FREELOOK,
|
||||
ID_TEXTUREPATH,
|
||||
|
||||
ID_CHECKBOX_DISABLECOPYEFB,
|
||||
ID_OSDHOTKEY,
|
||||
//ID_PROJECTIONHACK1,
|
||||
ID_DSTALPHAPASS,
|
||||
ID_DSTALPHAPASS,
|
||||
ID_RADIO_COPYEFBTORAM,
|
||||
ID_RADIO_COPYEFBTOGL,
|
||||
ID_POSTSHADER,
|
||||
|
@ -69,8 +69,6 @@ BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
|
||||
wxUninitialize();
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
g_hInstance = hinstDLL;
|
||||
@ -125,7 +123,7 @@ void OSDMenu(WPARAM wParam)
|
||||
case '7':
|
||||
OSDChoice = 5;
|
||||
g_Config.bDisableLighting = !g_Config.bDisableLighting;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// ---------------------------------------------------------------------
|
||||
@ -166,14 +164,14 @@ HWND GetWnd()
|
||||
}
|
||||
HWND GetParentWnd()
|
||||
{
|
||||
return m_hParent;
|
||||
return m_hParent;
|
||||
}
|
||||
|
||||
void FreeLookInput( UINT iMsg, WPARAM wParam )
|
||||
{
|
||||
static float debugSpeed = 1.0f;
|
||||
static bool mouseLookEnabled = false;
|
||||
static float lastMouse[2];
|
||||
static float debugSpeed = 1.0f;
|
||||
static bool mouseLookEnabled = false;
|
||||
static float lastMouse[2];
|
||||
|
||||
switch( iMsg )
|
||||
{
|
||||
@ -181,51 +179,51 @@ void FreeLookInput( UINT iMsg, WPARAM wParam )
|
||||
case WM_KEYDOWN:
|
||||
switch( LOWORD( wParam ))
|
||||
{
|
||||
case '9':
|
||||
debugSpeed /= 2.0f;
|
||||
break;
|
||||
case '0':
|
||||
debugSpeed *= 2.0f;
|
||||
break;
|
||||
case 'W':
|
||||
VertexShaderManager::TranslateView(0.0f, debugSpeed);
|
||||
break;
|
||||
case 'S':
|
||||
VertexShaderManager::TranslateView(0.0f, -debugSpeed);
|
||||
break;
|
||||
case 'A':
|
||||
VertexShaderManager::TranslateView(debugSpeed, 0.0f);
|
||||
break;
|
||||
case 'D':
|
||||
VertexShaderManager::TranslateView(-debugSpeed, 0.0f);
|
||||
break;
|
||||
case 'R':
|
||||
VertexShaderManager::ResetView();
|
||||
break;
|
||||
case '9':
|
||||
debugSpeed /= 2.0f;
|
||||
break;
|
||||
case '0':
|
||||
debugSpeed *= 2.0f;
|
||||
break;
|
||||
case 'W':
|
||||
VertexShaderManager::TranslateView(0.0f, debugSpeed);
|
||||
break;
|
||||
case 'S':
|
||||
VertexShaderManager::TranslateView(0.0f, -debugSpeed);
|
||||
break;
|
||||
case 'A':
|
||||
VertexShaderManager::TranslateView(debugSpeed, 0.0f);
|
||||
break;
|
||||
case 'D':
|
||||
VertexShaderManager::TranslateView(-debugSpeed, 0.0f);
|
||||
break;
|
||||
case 'R':
|
||||
VertexShaderManager::ResetView();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_MOUSEMOVE:
|
||||
if (mouseLookEnabled) {
|
||||
POINT point;
|
||||
GetCursorPos(&point);
|
||||
VertexShaderManager::RotateView((point.x - lastMouse[0]) / 200.0f, (point.y - lastMouse[1]) / 200.0f);
|
||||
lastMouse[0] = point.x;
|
||||
lastMouse[1] = point.y;
|
||||
}
|
||||
if (mouseLookEnabled) {
|
||||
POINT point;
|
||||
GetCursorPos(&point);
|
||||
VertexShaderManager::RotateView((point.x - lastMouse[0]) / 200.0f, (point.y - lastMouse[1]) / 200.0f);
|
||||
lastMouse[0] = point.x;
|
||||
lastMouse[1] = point.y;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_RBUTTONDOWN:
|
||||
POINT point;
|
||||
GetCursorPos(&point);
|
||||
lastMouse[0] = point.x;
|
||||
lastMouse[1] = point.y;
|
||||
mouseLookEnabled= true;
|
||||
break;
|
||||
case WM_RBUTTONDOWN:
|
||||
POINT point;
|
||||
GetCursorPos(&point);
|
||||
lastMouse[0] = point.x;
|
||||
lastMouse[1] = point.y;
|
||||
mouseLookEnabled= true;
|
||||
break;
|
||||
case WM_RBUTTONUP:
|
||||
mouseLookEnabled = false;
|
||||
break;
|
||||
}
|
||||
mouseLookEnabled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
@ -277,7 +275,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||
hdc = BeginPaint(hWnd, &ps);
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case WM_SYSKEYDOWN:
|
||||
switch (LOWORD(wParam))
|
||||
@ -287,12 +285,13 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||
if (m_hParent == NULL && !g_Config.RenderToMainframe)
|
||||
{
|
||||
ToggleFullscreen(hWnd);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case VK_F5: case VK_F6: case VK_F7: case VK_F8:
|
||||
PostMessage(m_hMain, WM_SYSKEYDOWN, wParam, lParam);
|
||||
return 0;
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, iMsg, wParam, lParam);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -300,6 +299,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||
// Don't process this as a child window to avoid double events
|
||||
if (!g_Config.RenderToMainframe)
|
||||
OnKeyDown(wParam);
|
||||
|
||||
if (g_Config.bFreeLook)
|
||||
FreeLookInput( iMsg, wParam );
|
||||
break;
|
||||
|
||||
/* Post these mouse events to the main window, it's nessesary becase in difference to the
|
||||
@ -328,8 +330,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
|
||||
/* To support the separate window rendering we get the message back here. So we basically
|
||||
only let it pass through Dolphin > Frame.cpp to determine if it should be on or off
|
||||
and coordinate it with the other settings if nessesary */
|
||||
only let it pass through Dolphin > Frame.cpp to determine if it should be on or off
|
||||
and coordinate it with the other settings if nessesary */
|
||||
case WM_USER:
|
||||
if (wParam == WM_USER_STOP)
|
||||
SetCursor((lParam) ? hCursor : hCursorBlank);
|
||||
@ -340,7 +342,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
else if (wParam == TOGGLE_FULLSCREEN)
|
||||
{
|
||||
if(!g_Config.RenderToMainframe)
|
||||
if(!g_Config.RenderToMainframe)
|
||||
ToggleFullscreen(m_hWnd);
|
||||
}
|
||||
else if (wParam == WIIMOTE_DISCONNECT)
|
||||
@ -357,8 +359,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||
if( g_Config.bFullscreen )
|
||||
ToggleFullscreen(m_hParent);
|
||||
PostMessage(m_hMain, WM_USER, WM_USER_STOP, 0);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
Shutdown();
|
||||
@ -370,16 +372,16 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
case SC_SCREENSAVE:
|
||||
case SC_MONITORPOWER:
|
||||
return 0;
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, iMsg, wParam, lParam);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, iMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
if (g_Config.bFreeLook) {
|
||||
FreeLookInput( iMsg, wParam );
|
||||
}
|
||||
|
||||
return DefWindowProc(hWnd, iMsg, wParam, lParam);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -407,35 +409,35 @@ HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const T
|
||||
CreateCursors(m_hInstance);
|
||||
|
||||
// Create child window
|
||||
if (g_Config.RenderToMainframe)
|
||||
{
|
||||
if (g_Config.RenderToMainframe)
|
||||
{
|
||||
m_hParent = m_hMain = parent;
|
||||
|
||||
m_hWnd = CreateWindow(m_szClassName, title, WS_CHILD,
|
||||
0, 0, width, height, parent, NULL, hInstance, NULL);
|
||||
}
|
||||
0, 0, width, height, parent, NULL, hInstance, NULL);
|
||||
}
|
||||
// Create new separate window
|
||||
else
|
||||
{
|
||||
else
|
||||
{
|
||||
// Don't forget to make it NULL, or a broken window will be created in case we
|
||||
// render to main, stop, then render to separate window, as the GUI will still
|
||||
// think we're rendering to main because m_hParent will still contain the old HWND...
|
||||
// think we're rendering to main because m_hParent will still contain the old HWND
|
||||
m_hParent = NULL;
|
||||
m_hMain = parent;
|
||||
|
||||
DWORD style = g_Config.bFullscreen ? WS_POPUP : WS_OVERLAPPEDWINDOW;
|
||||
RECT rc = {0, 0, width, height};
|
||||
AdjustWindowRect(&rc, style, false);
|
||||
RECT rc = {0, 0, width, height};
|
||||
AdjustWindowRect(&rc, style, false);
|
||||
RECT rcdesktop;
|
||||
GetWindowRect(GetDesktopWindow(), &rcdesktop);
|
||||
|
||||
int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/2;
|
||||
int Y = (rcdesktop.bottom-rcdesktop.top)/2 - (rc.bottom-rc.top)/2;
|
||||
|
||||
m_hWnd = CreateWindow(m_szClassName, title, style,
|
||||
m_hWnd = CreateWindow(m_szClassName, title, style,
|
||||
X, Y, rc.right-rc.left, rc.bottom-rc.top,
|
||||
NULL, NULL, hInstance, NULL);
|
||||
}
|
||||
NULL, NULL, hInstance, NULL);
|
||||
}
|
||||
|
||||
return m_hWnd;
|
||||
}
|
||||
@ -485,7 +487,7 @@ void ToggleFullscreen(HWND hParent, bool bForceFull)
|
||||
RECT rc = {0, 0, w_fs, h_fs};
|
||||
AdjustWindowRect(&rc, style, false);
|
||||
RECT rcdesktop;
|
||||
GetWindowRect(GetDesktopWindow(), &rcdesktop);
|
||||
GetWindowRect(GetDesktopWindow(), &rcdesktop);
|
||||
|
||||
// SetWindowPos to the center of the screen
|
||||
int X = (rcdesktop.right-rcdesktop.left)/2 - (rc.right-rc.left)/2;
|
||||
|
@ -98,8 +98,6 @@ GFXDebuggerOGL *m_DebuggerFrame = NULL;
|
||||
SVideoInitialize g_VideoInitialize;
|
||||
PLUGIN_GLOBALS* globals = NULL;
|
||||
|
||||
bool allowConfigShow = true;
|
||||
|
||||
// Logging
|
||||
int GLScissorX, GLScissorY, GLScissorW, GLScissorH;
|
||||
|
||||
@ -117,14 +115,14 @@ bool IsD3D()
|
||||
|
||||
void GetDllInfo (PLUGIN_INFO* _PluginInfo)
|
||||
{
|
||||
_PluginInfo->Version = 0x0100;
|
||||
_PluginInfo->Type = PLUGIN_TYPE_VIDEO;
|
||||
_PluginInfo->Version = 0x0100;
|
||||
_PluginInfo->Type = PLUGIN_TYPE_VIDEO;
|
||||
#ifdef DEBUGFAST
|
||||
sprintf(_PluginInfo->Name, "Dolphin OpenGL (DebugFast)");
|
||||
sprintf_s(_PluginInfo->Name, "Dolphin OpenGL (DebugFast)");
|
||||
#elif defined _DEBUG
|
||||
sprintf(_PluginInfo->Name, "Dolphin OpenGL (Debug)");
|
||||
sprintf_s(_PluginInfo->Name, "Dolphin OpenGL (Debug)");
|
||||
#else
|
||||
sprintf(_PluginInfo->Name, "Dolphin OpenGL");
|
||||
sprintf_s(_PluginInfo->Name, "Dolphin OpenGL");
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -169,7 +167,8 @@ void DllDebugger(HWND _hParent, bool Show)
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
void Win32AddResolutions() {
|
||||
void Win32AddResolutions()
|
||||
{
|
||||
// Search for avaliable resolutions
|
||||
|
||||
DWORD iModeNum = 0;
|
||||
@ -204,7 +203,7 @@ void Win32AddResolutions() {
|
||||
m_ConfigFrame->AddFSReso(szBuffer);
|
||||
m_ConfigFrame->AddWindowReso(szBuffer);
|
||||
}
|
||||
ZeroMemory(&dmi, sizeof(dmi));
|
||||
ZeroMemory(&dmi, sizeof(dmi));
|
||||
}
|
||||
}
|
||||
#elif defined(HAVE_X11) && HAVE_X11 && defined(HAVE_XRANDR) && HAVE_XRANDR
|
||||
@ -226,10 +225,10 @@ void X11AddResolutions() {
|
||||
m_ConfigFrame->AddFSReso(temp);
|
||||
//Add same to window resolutions, since
|
||||
//they should be nearly all that's needed
|
||||
m_ConfigFrame->AddWindowReso(temp);
|
||||
m_ConfigFrame->AddWindowReso(temp);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#elif defined(HAVE_COCOA) && HAVE_COCOA
|
||||
void CocoaAddResolutions() {
|
||||
@ -245,7 +244,6 @@ void CocoaAddResolutions() {
|
||||
int modeIndex;
|
||||
int px = 0, py = 0;
|
||||
|
||||
|
||||
modes = CGDisplayAvailableModes(CGMainDisplayID());
|
||||
|
||||
range.location = 0;
|
||||
@ -281,42 +279,40 @@ void DllConfig(HWND _hParent)
|
||||
g_Config.UpdateProjectionHack();
|
||||
UpdateActiveConfig();
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
// Prevent user to show more than 1 config window at same time
|
||||
if (allowConfigShow)
|
||||
{
|
||||
wxWindow *frame = GetParentedWxWindow(_hParent);
|
||||
m_ConfigFrame = new GFXConfigDialogOGL(frame);
|
||||
wxWindow *frame = GetParentedWxWindow(_hParent);
|
||||
m_ConfigFrame = new GFXConfigDialogOGL(frame);
|
||||
|
||||
#if defined(_WIN32)
|
||||
Win32AddResolutions();
|
||||
Win32AddResolutions();
|
||||
#elif defined(HAVE_X11) && HAVE_X11 && defined(HAVE_XRANDR) && HAVE_XRANDR
|
||||
X11AddResolutions();
|
||||
X11AddResolutions();
|
||||
#elif defined(HAVE_COCOA) && HAVE_COCOA
|
||||
CocoaAddResolutions();
|
||||
CocoaAddResolutions();
|
||||
#endif
|
||||
|
||||
allowConfigShow = false;
|
||||
m_ConfigFrame->CreateGUIControls();
|
||||
allowConfigShow = m_ConfigFrame->ShowModal() == 1 ? true : false;
|
||||
m_ConfigFrame->Destroy();
|
||||
m_ConfigFrame = NULL;
|
||||
// Prevent user to show more than 1 config window at same time
|
||||
frame->Disable();
|
||||
m_ConfigFrame->ShowModal();
|
||||
frame->Enable();
|
||||
|
||||
m_ConfigFrame->Destroy();
|
||||
m_ConfigFrame = NULL;
|
||||
#ifdef _WIN32
|
||||
frame->SetHWND(NULL);
|
||||
frame->SetHWND(NULL);
|
||||
#endif
|
||||
delete frame;
|
||||
}
|
||||
frame->Destroy();
|
||||
#endif
|
||||
}
|
||||
|
||||
void Initialize(void *init)
|
||||
{
|
||||
frameCount = 0;
|
||||
SVideoInitialize *_pVideoInitialize = (SVideoInitialize*)init;
|
||||
frameCount = 0;
|
||||
SVideoInitialize *_pVideoInitialize = (SVideoInitialize*)init;
|
||||
// Create a shortcut to _pVideoInitialize that can also update it
|
||||
g_VideoInitialize = *(_pVideoInitialize);
|
||||
g_VideoInitialize = *(_pVideoInitialize);
|
||||
InitXFBConvTables();
|
||||
|
||||
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_opengl.ini").c_str());
|
||||
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_opengl.ini").c_str());
|
||||
g_Config.GameIniLoad(globals->game_ini);
|
||||
|
||||
g_Config.UpdateProjectionHack();
|
||||
@ -326,19 +322,19 @@ void Initialize(void *init)
|
||||
#endif
|
||||
UpdateActiveConfig();
|
||||
|
||||
if (!OpenGL_Create(g_VideoInitialize, 640, 480))
|
||||
if (!OpenGL_Create(g_VideoInitialize, 640, 480))
|
||||
{
|
||||
g_VideoInitialize.pLog("Renderer::Create failed\n", TRUE);
|
||||
return;
|
||||
}
|
||||
g_VideoInitialize.pLog("Renderer::Create failed\n", TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
_pVideoInitialize->pPeekMessages = g_VideoInitialize.pPeekMessages;
|
||||
_pVideoInitialize->pUpdateFPSDisplay = g_VideoInitialize.pUpdateFPSDisplay;
|
||||
_pVideoInitialize->pUpdateFPSDisplay = g_VideoInitialize.pUpdateFPSDisplay;
|
||||
|
||||
// Now the window handle is written
|
||||
_pVideoInitialize->pWindowHandle = g_VideoInitialize.pWindowHandle;
|
||||
_pVideoInitialize->pWindowHandle = g_VideoInitialize.pWindowHandle;
|
||||
#if defined(HAVE_X11) && HAVE_X11
|
||||
_pVideoInitialize->pXWindow = g_VideoInitialize.pXWindow;
|
||||
_pVideoInitialize->pXWindow = g_VideoInitialize.pXWindow;
|
||||
#endif
|
||||
|
||||
OSD::AddMessage("Dolphin OpenGL Video Plugin" ,5000);
|
||||
@ -349,17 +345,17 @@ void DoState(unsigned char **ptr, int mode) {
|
||||
// WHY is this here??
|
||||
OpenGL_MakeCurrent();
|
||||
#endif
|
||||
// Clear all caches that touch RAM
|
||||
TextureMngr::Invalidate(false);
|
||||
VertexLoaderManager::MarkAllDirty();
|
||||
|
||||
PointerWrap p(ptr, mode);
|
||||
VideoCommon_DoState(p);
|
||||
|
||||
// Refresh state.
|
||||
// Clear all caches that touch RAM
|
||||
TextureMngr::Invalidate(false);
|
||||
VertexLoaderManager::MarkAllDirty();
|
||||
|
||||
PointerWrap p(ptr, mode);
|
||||
VideoCommon_DoState(p);
|
||||
|
||||
// Refresh state.
|
||||
if (mode == PointerWrap::MODE_READ)
|
||||
{
|
||||
BPReload();
|
||||
BPReload();
|
||||
RecomputeCachedArraybases();
|
||||
}
|
||||
}
|
||||
@ -372,34 +368,34 @@ void EmuStateChange(PLUGIN_EMUSTATE newState)
|
||||
// This is called after Video_Initialize() from the Core
|
||||
void Video_Prepare(void)
|
||||
{
|
||||
OpenGL_MakeCurrent();
|
||||
if (!Renderer::Init()) {
|
||||
g_VideoInitialize.pLog("Renderer::Create failed\n", TRUE);
|
||||
PanicAlert("Can't create opengl renderer. You might be missing some required opengl extensions, check the logs for more info");
|
||||
exit(1);
|
||||
}
|
||||
OpenGL_MakeCurrent();
|
||||
if (!Renderer::Init()) {
|
||||
g_VideoInitialize.pLog("Renderer::Create failed\n", TRUE);
|
||||
PanicAlert("Can't create opengl renderer. You might be missing some required opengl extensions, check the logs for more info");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
s_swapRequested = FALSE;
|
||||
s_efbAccessRequested = FALSE;
|
||||
s_FifoShuttingDown = FALSE;
|
||||
|
||||
CommandProcessor::Init();
|
||||
PixelEngine::Init();
|
||||
CommandProcessor::Init();
|
||||
PixelEngine::Init();
|
||||
|
||||
TextureMngr::Init();
|
||||
TextureMngr::Init();
|
||||
|
||||
BPInit();
|
||||
VertexManager::Init();
|
||||
Fifo_Init(); // must be done before OpcodeDecoder_Init()
|
||||
OpcodeDecoder_Init();
|
||||
VertexShaderCache::Init();
|
||||
VertexShaderManager::Init();
|
||||
PixelShaderCache::Init();
|
||||
PixelShaderManager::Init();
|
||||
BPInit();
|
||||
VertexManager::Init();
|
||||
Fifo_Init(); // must be done before OpcodeDecoder_Init()
|
||||
OpcodeDecoder_Init();
|
||||
VertexShaderCache::Init();
|
||||
VertexShaderManager::Init();
|
||||
PixelShaderCache::Init();
|
||||
PixelShaderManager::Init();
|
||||
PostProcessing::Init();
|
||||
GL_REPORT_ERRORD();
|
||||
VertexLoaderManager::Init();
|
||||
TextureConverter::Init();
|
||||
GL_REPORT_ERRORD();
|
||||
VertexLoaderManager::Init();
|
||||
TextureConverter::Init();
|
||||
DLCache::Init();
|
||||
|
||||
s_PluginInitialized = true;
|
||||
@ -584,37 +580,36 @@ u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y)
|
||||
|
||||
void Video_CommandProcessorRead16(u16& _rReturnValue, const u32 _Address)
|
||||
{
|
||||
CommandProcessor::Read16(_rReturnValue, _Address);
|
||||
CommandProcessor::Read16(_rReturnValue, _Address);
|
||||
}
|
||||
|
||||
void Video_CommandProcessorWrite16(const u16 _Data, const u32 _Address)
|
||||
{
|
||||
CommandProcessor::Write16(_Data, _Address);
|
||||
CommandProcessor::Write16(_Data, _Address);
|
||||
}
|
||||
|
||||
void Video_PixelEngineRead16(u16& _rReturnValue, const u32 _Address)
|
||||
{
|
||||
PixelEngine::Read16(_rReturnValue, _Address);
|
||||
PixelEngine::Read16(_rReturnValue, _Address);
|
||||
}
|
||||
|
||||
void Video_PixelEngineWrite16(const u16 _Data, const u32 _Address)
|
||||
{
|
||||
PixelEngine::Write16(_Data, _Address);
|
||||
PixelEngine::Write16(_Data, _Address);
|
||||
}
|
||||
|
||||
void Video_PixelEngineWrite32(const u32 _Data, const u32 _Address)
|
||||
{
|
||||
PixelEngine::Write32(_Data, _Address);
|
||||
PixelEngine::Write32(_Data, _Address);
|
||||
}
|
||||
|
||||
void Video_GatherPipeBursted(void)
|
||||
{
|
||||
CommandProcessor::GatherPipeBursted();
|
||||
CommandProcessor::GatherPipeBursted();
|
||||
}
|
||||
|
||||
void Video_WaitForFrameFinish(void)
|
||||
{
|
||||
CommandProcessor::WaitForFrameFinish();
|
||||
CommandProcessor::WaitForFrameFinish();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user