From f8e80a317e9efee879d76fda8393e435ab3ba224 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Sun, 6 Sep 2009 15:39:06 +0000 Subject: [PATCH] OpenGL: Added fog and lighting to the OSD menu. GUI: Removed old and removed Gfx setting from ISOProperties. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4213 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/Frame.cpp | 2 +- Source/Core/DolphinWX/Src/ISOProperties.cpp | 12 -------- Source/Core/DolphinWX/Src/ISOProperties.h | 3 +- .../Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp | 8 ++++- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 29 +++++++++++++------ 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index d6387176c8..dcd1cbb415 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -658,7 +658,7 @@ void CFrame::OnKeyDown(wxKeyEvent& event) DoFullscreen(!IsFullScreen()); } #ifdef _WIN32 - if(event.GetKeyCode() == 'M', '3', '4', '5', '6') // Send this to the video plugin WndProc + if(event.GetKeyCode() == 'M', '3', '4', '5', '6', '7') // Send this to the video plugin WndProc { PostMessage((HWND)Core::GetWindowHandle(), WM_USER, OPENGL_WM_USER_KEYDOWN, event.GetKeyCode()); } diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index 7c3afc8a51..e3c60c9612 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -315,7 +315,6 @@ void CISOProperties::CreateGUIControls(bool IsWad) sbVideoOverrides = new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Video")); ForceFiltering = new wxCheckBox(m_GameConfig, ID_FORCEFILTERING, _("Force Filtering"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); EFBCopyDisable = new wxCheckBox(m_GameConfig, ID_EFBCOPYDISABLE, _("Disable Copy to EFB"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); - EFBCopyDisableHotKey = new wxCheckBox(m_GameConfig, ID_EFBCOPYDISABLEHOTKEY, _("With Hotkey E"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); EFBToTextureEnable = new wxCheckBox(m_GameConfig, ID_EFBTOTEXTUREENABLE, _("Enable EFB To RAM"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); SafeTextureCache = new wxCheckBox(m_GameConfig, ID_SAFETEXTURECACHE, _("Safe Texture Cache"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); DstAlphaPass = new wxCheckBox(m_GameConfig, ID_DSTALPHAPASS, _("Distance Alpha Pass"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER, wxDefaultValidator); @@ -361,7 +360,6 @@ void CISOProperties::CreateGUIControls(bool IsWad) sbWiiOverrides->Add(EnableWideScreen, 0, wxEXPAND|wxLEFT, 5); sbVideoOverrides->Add(ForceFiltering, 0, wxEXPAND|wxLEFT, 5); sbVideoOverrides->Add(EFBCopyDisable, 0, wxEXPAND|wxLEFT, 5); - sbVideoOverrides->Add(EFBCopyDisableHotKey, 0, wxEXPAND|wxLEFT, 5); sbVideoOverrides->Add(EFBToTextureEnable, 0, wxEXPAND|wxLEFT, 5); sbVideoOverrides->Add(SafeTextureCache, 0, wxEXPAND|wxLEFT, 5); sbVideoOverrides->Add(DstAlphaPass, 0, wxEXPAND|wxLEFT, 5); @@ -671,11 +669,6 @@ void CISOProperties::LoadGameConfig() else EFBCopyDisable->Set3StateValue(wxCHK_UNDETERMINED); - if (GameIni.Get("Video", "EFBCopyDisableHotKey", &bTemp)) - EFBCopyDisableHotKey->Set3StateValue((wxCheckBoxState)bTemp); - else - EFBCopyDisableHotKey->Set3StateValue(wxCHK_UNDETERMINED); - if (GameIni.Get("Video", "EFBToTextureEnable", &bTemp)) EFBToTextureEnable->Set3StateValue((wxCheckBoxState)bTemp); else @@ -761,11 +754,6 @@ bool CISOProperties::SaveGameConfig() else GameIni.Set("Video", "EFBCopyDisable", EFBCopyDisable->Get3StateValue()); - if (EFBCopyDisableHotKey->Get3StateValue() == wxCHK_UNDETERMINED) - GameIni.DeleteKey("Video", "EFBCopyDisableHotKey"); - else - GameIni.Set("Video", "EFBCopyDisableHotKey", EFBCopyDisableHotKey->Get3StateValue()); - if (EFBToTextureEnable->Get3StateValue() == wxCHK_UNDETERMINED) GameIni.DeleteKey("Video", "EFBToTextureEnable"); else diff --git a/Source/Core/DolphinWX/Src/ISOProperties.h b/Source/Core/DolphinWX/Src/ISOProperties.h index 1b044c25c8..df2ea3cb1f 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.h +++ b/Source/Core/DolphinWX/Src/ISOProperties.h @@ -86,7 +86,7 @@ class CISOProperties : public wxDialog wxCheckBox *EnableProgressiveScan, *EnableWideScreen; // Video wxCheckBox *ForceFiltering, - *EFBCopyDisable, *EFBCopyDisableHotKey, *EFBToTextureEnable, + *EFBCopyDisable, *EFBToTextureEnable, *SafeTextureCache, *DstAlphaPass, *UseXFB; wxStaticText *Hacktext; wxArrayString arrayStringFor_Hack; @@ -161,7 +161,6 @@ class CISOProperties : public wxDialog ID_TLBHACK, ID_FORCEFILTERING, ID_EFBCOPYDISABLE, - ID_EFBCOPYDISABLEHOTKEY, ID_EFBTOTEXTUREENABLE, ID_SAFETEXTURECACHE, ID_DSTALPHAPASS, diff --git a/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp b/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp index 34d59c62be..53f403b291 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp @@ -127,8 +127,13 @@ void OSDMenu(WPARAM wParam) g_Config.bEFBCopyDisable = !g_Config.bEFBCopyDisable; break; case '6': - //OSDChoice = 4; + OSDChoice = 4; + g_Config.bDisableFog = !g_Config.bDisableFog; break; + case '7': + OSDChoice = 5; + g_Config.bDisableLighting = !g_Config.bDisableLighting; + break; } } // --------------------------------------------------------------------- @@ -259,6 +264,7 @@ void OnKeyDown(WPARAM wParam) case '4': case '5': case '6': + case '7': OSDMenu(wParam); break; } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 3791c6a979..d7233e2970 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -1266,8 +1266,8 @@ void Renderer::DrawDebugText() } if ((u32)OSDTime > timeGetTime() && g_Config.bEFBCopyDisableHotKey) { - std::string T1 = ""; - std::string T2 = ""; + std::string T1 = "", T2 = ""; + std::vector T0; int W, H; sscanf(g_Config.iInternalRes, "%dx%d", &W, &H); @@ -1291,15 +1291,26 @@ void Renderer::DrawDebugText() if (g_Config.bShowFPS) { T1 += "\n\n"; T2 += "\n\n"; } + // The rows + T0.push_back(StringFromFormat("3: Internal Resolution: %s\n", OSDM1.c_str())); + T0.push_back(StringFromFormat("4: Lock Aspect Ratio: %s%s\n", OSDM21.c_str(), OSDM22.c_str())); + T0.push_back(StringFromFormat("5: Copy Embedded Framebuffer to %s: %s\n", OSDM31.c_str(), OSDM32.c_str())); + T0.push_back(StringFromFormat("6: Fog: %s\n", g_Config.bDisableFog ? "Disabled" : "Enabled")); + T0.push_back(StringFromFormat("7: Material Lighting: %s\n", g_Config.bDisableLighting ? "Disabled" : "Enabled")); + // The latest changed setting in yellow - T1 += (OSDChoice == -1) ? StringFromFormat("3: Internal Resolution: %s\n", OSDM1.c_str()) : "\n"; - T1 += (OSDChoice == -2) ? StringFromFormat("4: Lock Aspect Ratio: %s%s\n", OSDM21.c_str(), OSDM22.c_str()) : "\n"; - T1 += (OSDChoice == -3) ? StringFromFormat("5: Copy Embedded Framebuffer to %s: %s\n", OSDM31.c_str(), OSDM32.c_str()) : "\n"; - + T1 += (OSDChoice == -1) ? T0.at(0) : "\n"; + T1 += (OSDChoice == -2) ? T0.at(1) : "\n"; + T1 += (OSDChoice == -3) ? T0.at(2) : "\n"; + T1 += (OSDChoice == -4) ? T0.at(3) : "\n"; + T1 += (OSDChoice == -5) ? T0.at(4) : "\n"; + // The other settings in cyan - T2 += !(OSDChoice == -1) ? StringFromFormat("3: Internal Resolution: %s\n", OSDM1.c_str()) : "\n"; - T2 += !(OSDChoice == -2) ? StringFromFormat("4: Lock Aspect Ratio: %s\n", OSDM21.c_str(), OSDM22.c_str()) : "\n"; - T2 += !(OSDChoice == -3) ? StringFromFormat("5: Copy Embedded Framebuffer to %s: %s\n", OSDM31.c_str(), OSDM32.c_str()) : "\n"; + T2 += !(OSDChoice == -1) ? T0.at(0) : "\n"; + T2 += !(OSDChoice == -2) ? T0.at(1) : "\n"; + T2 += !(OSDChoice == -3) ? T0.at(2) : "\n"; + T2 += !(OSDChoice == -4) ? T0.at(3) : "\n"; + T2 += !(OSDChoice == -5) ? T0.at(4) : "\n"; // Render a shadow, and then the text Renderer::RenderText(T1.c_str(), 21, 21, 0xDD000000);