summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Frame.cpp
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2016-10-03 20:09:35 -0700
committerGitHub <noreply@github.com>2016-10-03 20:09:35 -0700
commit5c0fa4db4fa4a2533c190825e83675f074eaf50c (patch)
treef012c83d0f2ed32f49d2b43fa1c877d629cbdfee /Source/Core/DolphinWX/Frame.cpp
parentb8731eb8180d76b4663eaf4188f985b9c5fa6fb2 (diff)
parentfa5fa8e09473fb8750af2a21fa24dff76970a681 (diff)
Merge pull request #4286 from shuffle2/Aestek-clean-osd
Clean OSD messages code
Diffstat (limited to 'Source/Core/DolphinWX/Frame.cpp')
-rw-r--r--Source/Core/DolphinWX/Frame.cpp96
1 files changed, 87 insertions, 9 deletions
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp
index 5cfbc79937..92f4fac8fb 100644
--- a/Source/Core/DolphinWX/Frame.cpp
+++ b/Source/Core/DolphinWX/Frame.cpp
@@ -1446,14 +1446,16 @@ void CFrame::ParseHotkeys()
if (IsHotkey(HK_INCREASE_IR))
{
- OSDChoice = 1;
++g_Config.iEFBScale;
+ OSDPrintInternalResolution();
}
if (IsHotkey(HK_DECREASE_IR))
{
- OSDChoice = 1;
if (--g_Config.iEFBScale < SCALE_AUTO)
+ {
g_Config.iEFBScale = SCALE_AUTO;
+ }
+ OSDPrintInternalResolution();
}
if (IsHotkey(HK_TOGGLE_CROP))
{
@@ -1461,28 +1463,26 @@ void CFrame::ParseHotkeys()
}
if (IsHotkey(HK_TOGGLE_AR))
{
- OSDChoice = 2;
// Toggle aspect ratio
g_Config.iAspectRatio = (g_Config.iAspectRatio + 1) & 3;
+ OSDPrintAspectRatio();
}
if (IsHotkey(HK_TOGGLE_EFBCOPIES))
{
- OSDChoice = 3;
// Toggle EFB copies between EFB2RAM and EFB2Texture
g_Config.bSkipEFBCopyToRam = !g_Config.bSkipEFBCopyToRam;
+ OSDPrintEFB();
}
if (IsHotkey(HK_TOGGLE_FOG))
{
- OSDChoice = 4;
g_Config.bDisableFog = !g_Config.bDisableFog;
+ OSDPrintFog();
}
if (IsHotkey(HK_TOGGLE_TEXTURES))
g_Config.bHiresTextures = !g_Config.bHiresTextures;
Core::SetIsThrottlerTempDisabled(IsHotkey(HK_TOGGLE_THROTTLE, true));
if (IsHotkey(HK_DECREASE_EMULATION_SPEED))
{
- OSDChoice = 5;
-
if (SConfig::GetInstance().m_EmulationSpeed <= 0.0f)
SConfig::GetInstance().m_EmulationSpeed = 1.0f;
else if (SConfig::GetInstance().m_EmulationSpeed >= 0.2f)
@@ -1493,17 +1493,19 @@ void CFrame::ParseHotkeys()
if (SConfig::GetInstance().m_EmulationSpeed >= 0.95f &&
SConfig::GetInstance().m_EmulationSpeed <= 1.05f)
SConfig::GetInstance().m_EmulationSpeed = 1.0f;
+
+ OSDPrintEmulationSpeed();
}
if (IsHotkey(HK_INCREASE_EMULATION_SPEED))
{
- OSDChoice = 5;
-
if (SConfig::GetInstance().m_EmulationSpeed > 0.0f)
SConfig::GetInstance().m_EmulationSpeed += 0.1f;
if (SConfig::GetInstance().m_EmulationSpeed >= 0.95f &&
SConfig::GetInstance().m_EmulationSpeed <= 1.05f)
SConfig::GetInstance().m_EmulationSpeed = 1.0f;
+
+ OSDPrintEmulationSpeed();
}
if (IsHotkey(HK_SAVE_STATE_SLOT_SELECTED))
{
@@ -1718,3 +1720,79 @@ void CFrame::HandleSignal(wxTimerEvent& event)
return;
Close();
}
+
+void CFrame::OSDPrintInternalResolution()
+{
+ std::string text;
+ switch (g_Config.iEFBScale)
+ {
+ case SCALE_AUTO:
+ text = "Auto (fractional)";
+ break;
+ case SCALE_AUTO_INTEGRAL:
+ text = "Auto (integral)";
+ break;
+ case SCALE_1X:
+ text = "Native";
+ break;
+ case SCALE_1_5X:
+ text = "1.5x";
+ break;
+ case SCALE_2X:
+ text = "2x";
+ break;
+ case SCALE_2_5X:
+ text = "2.5x";
+ break;
+ default:
+ text = StringFromFormat("%dx", g_Config.iEFBScale - 3);
+ break;
+ }
+
+ OSD::AddMessage("Internal Resolution: " + text);
+}
+
+void CFrame::OSDPrintAspectRatio()
+{
+ std::string text;
+ switch (g_Config.iAspectRatio)
+ {
+ case ASPECT_AUTO:
+ text = "Auto";
+ break;
+ case ASPECT_STRETCH:
+ text = "Stretch";
+ break;
+ case ASPECT_ANALOG:
+ text = "Force 4:3";
+ break;
+ case ASPECT_ANALOG_WIDE:
+ text = "Force 16:9";
+ break;
+ }
+
+ OSD::AddMessage("Aspect Ratio: " + text + (g_Config.bCrop ? " (crop)" : ""));
+}
+
+void CFrame::OSDPrintEFB()
+{
+ OSD::AddMessage(std::string("Copy EFB: ") +
+ (g_Config.bSkipEFBCopyToRam ? "to Texture" : "to RAM"));
+}
+
+void CFrame::OSDPrintFog()
+{
+ OSD::AddMessage(std::string("Fog: ") + (g_Config.bDisableFog ? "Disabled" : "Enabled"));
+}
+
+void CFrame::OSDPrintEmulationSpeed()
+{
+ std::string text = "Speed Limit: ";
+
+ if (SConfig::GetInstance().m_EmulationSpeed <= 0)
+ text += "Unlimited";
+ else
+ text += StringFromFormat("%li%%", std::lround(SConfig::GetInstance().m_EmulationSpeed * 100.f));
+
+ OSD::AddMessage(text);
+}