summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorRachel Bryk <RachelBryk@gmail.com>2013-04-06 01:48:00 -0400
committerRachel Bryk <RachelBryk@gmail.com>2013-04-06 01:49:13 -0400
commit4d81e0739d2cc7112d5167682fd0750836f691a9 (patch)
treecc9932a98b424110c83315d1a323ec8212d989fd /Source/Core/VideoCommon
parent518e7a763594909344170b50df891f0b0ef8c719 (diff)
Use an enum for efb scale values.
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/Src/EmuWindow.cpp2
-rw-r--r--Source/Core/VideoCommon/Src/RenderBase.cpp22
-rw-r--r--Source/Core/VideoCommon/Src/VideoConfig.cpp16
-rw-r--r--Source/Core/VideoCommon/Src/VideoConfig.h12
4 files changed, 32 insertions, 20 deletions
diff --git a/Source/Core/VideoCommon/Src/EmuWindow.cpp b/Source/Core/VideoCommon/Src/EmuWindow.cpp
index bf9da4190b..8952432789 100644
--- a/Source/Core/VideoCommon/Src/EmuWindow.cpp
+++ b/Source/Core/VideoCommon/Src/EmuWindow.cpp
@@ -247,7 +247,7 @@ void OSDMenu(WPARAM wParam)
OSDChoice = 1;
// Toggle native resolution
g_Config.iEFBScale = g_Config.iEFBScale + 1;
- if (g_Config.iEFBScale > 7) g_Config.iEFBScale = 0;
+ if (g_Config.iEFBScale > SCALE_4X) g_Config.iEFBScale = SCALE_AUTO;
break;
case '4':
OSDChoice = 2;
diff --git a/Source/Core/VideoCommon/Src/RenderBase.cpp b/Source/Core/VideoCommon/Src/RenderBase.cpp
index 90a09aec43..652a613b2a 100644
--- a/Source/Core/VideoCommon/Src/RenderBase.cpp
+++ b/Source/Core/VideoCommon/Src/RenderBase.cpp
@@ -144,7 +144,7 @@ int Renderer::EFBToScaledX(int x)
{
switch (g_ActiveConfig.iEFBScale)
{
- case 0: // fractional
+ case SCALE_AUTO: // fractional
return (int)ssaa_multiplier * FramebufferManagerBase::ScaleToVirtualXfbWidth(x, s_backbuffer_width);
default:
@@ -156,7 +156,7 @@ int Renderer::EFBToScaledY(int y)
{
switch (g_ActiveConfig.iEFBScale)
{
- case 0: // fractional
+ case SCALE_AUTO: // fractional
return (int)ssaa_multiplier * FramebufferManagerBase::ScaleToVirtualXfbHeight(y, s_backbuffer_height);
default:
@@ -166,7 +166,7 @@ int Renderer::EFBToScaledY(int y)
void Renderer::CalculateTargetScale(int x, int y, int &scaledX, int &scaledY)
{
- if (g_ActiveConfig.iEFBScale == 0 || g_ActiveConfig.iEFBScale == 1)
+ if (g_ActiveConfig.iEFBScale == SCALE_AUTO || g_ActiveConfig.iEFBScale == SCALE_AUTO_INTEGRAL)
{
scaledX = x;
scaledY = y;
@@ -283,28 +283,28 @@ void Renderer::DrawDebugText()
const char* res_text = "";
switch (g_ActiveConfig.iEFBScale)
{
- case 0:
+ case SCALE_AUTO:
res_text = "Auto (fractional)";
break;
- case 1:
+ case SCALE_AUTO_INTEGRAL:
res_text = "Auto (integral)";
break;
- case 2:
+ case SCALE_1X:
res_text = "Native";
break;
- case 3:
+ case SCALE_1_5X:
res_text = "1.5x";
break;
- case 4:
+ case SCALE_2X:
res_text = "2x";
break;
- case 5:
+ case SCALE_2_5X:
res_text = "2.5x";
break;
- case 6:
+ case SCALE_3X:
res_text = "3x";
break;
- case 7:
+ case SCALE_4X:
res_text = "4x";
break;
}
diff --git a/Source/Core/VideoCommon/Src/VideoConfig.cpp b/Source/Core/VideoCommon/Src/VideoConfig.cpp
index 5f10650747..a6139363e6 100644
--- a/Source/Core/VideoCommon/Src/VideoConfig.cpp
+++ b/Source/Core/VideoCommon/Src/VideoConfig.cpp
@@ -79,7 +79,7 @@ void VideoConfig::Load(const char *ini_file)
iniFile.Get("Settings", "HackedBufferUpload", &bHackedBufferUpload, 0);
iniFile.Get("Settings", "MSAA", &iMultisampleMode, 0);
- iniFile.Get("Settings", "EFBScale", &iEFBScale, 2); // native
+ iniFile.Get("Settings", "EFBScale", &iEFBScale, (int) SCALE_1X); // native
iniFile.Get("Settings", "DstAlphaPass", &bDstAlphaPass, false);
@@ -139,21 +139,21 @@ void VideoConfig::GameIniLoad(const char *ini_file)
iniFile.GetIfExists("Video_Settings", "MSAA", &iMultisampleMode);
int tmp = 0;
iniFile.GetIfExists("Video_Settings", "EFBScale", &tmp); // integral
- if (tmp != -1)
+ if (tmp != SCALE_FORCE_INTEGRAL)
iEFBScale = tmp;
// Round down to multiple of native IR
else
{
switch (iEFBScale)
{
- case 0:
- iEFBScale = 1;
+ case SCALE_AUTO:
+ iEFBScale = SCALE_AUTO_INTEGRAL;
break;
- case 3: // 1.5x
- iEFBScale = 2;
+ case SCALE_1_5X:
+ iEFBScale = SCALE_1X;
break;
- case 5: // 2.5x
- iEFBScale = 4;
+ case SCALE_2_5X:
+ iEFBScale = SCALE_2X;
break;
default:
break;
diff --git a/Source/Core/VideoCommon/Src/VideoConfig.h b/Source/Core/VideoCommon/Src/VideoConfig.h
index 1a76baa733..1670e47222 100644
--- a/Source/Core/VideoCommon/Src/VideoConfig.h
+++ b/Source/Core/VideoCommon/Src/VideoConfig.h
@@ -44,6 +44,18 @@ enum AspectMode {
ASPECT_STRETCH = 3,
};
+enum EFBScale {
+ SCALE_FORCE_INTEGRAL = -1,
+ SCALE_AUTO,
+ SCALE_AUTO_INTEGRAL,
+ SCALE_1X,
+ SCALE_1_5X,
+ SCALE_2X,
+ SCALE_2_5X,
+ SCALE_3X,
+ SCALE_4X,
+};
+
class IniFile;
// NEVER inherit from this class.