Merge pull request #6186 from lioncash/enum-class

VideoConfig: Make AspectMode and StereoMode enum classes
This commit is contained in:
Leo Lam
2017-11-19 15:08:16 +01:00
committed by GitHub
26 changed files with 123 additions and 115 deletions

View File

@ -146,7 +146,7 @@ void EnhancementsWidget::LoadSettings()
// Post Processing Shader
std::vector<std::string> shaders =
g_Config.iStereoMode == STEREO_ANAGLYPH ?
g_Config.stereo_mode == StereoMode::Anaglyph ?
PostProcessingShaderImplementation::GetAnaglyphShaderList(
g_Config.backend_info.api_type) :
PostProcessingShaderImplementation::GetShaderList(g_Config.backend_info.api_type);

View File

@ -221,7 +221,10 @@ void HotkeyScheduler::Run()
if (IsHotkey(HK_TOGGLE_CROP))
g_Config.bCrop = !g_Config.bCrop;
if (IsHotkey(HK_TOGGLE_AR))
g_Config.iAspectRatio = (g_Config.iAspectRatio + 1) & 3;
{
g_Config.aspect_mode =
static_cast<AspectMode>((static_cast<int>(g_Config.aspect_mode) + 1) & 3);
}
if (IsHotkey(HK_TOGGLE_EFBCOPIES))
g_Config.bSkipEFBCopyToRam = !g_Config.bSkipEFBCopyToRam;
if (IsHotkey(HK_TOGGLE_XFBCOPIES))
@ -261,46 +264,46 @@ void HotkeyScheduler::Run()
// Stereoscopy
if (IsHotkey(HK_TOGGLE_STEREO_SBS) || IsHotkey(HK_TOGGLE_STEREO_TAB))
{
if (g_Config.iStereoMode != STEREO_SBS)
if (g_Config.stereo_mode != StereoMode::SBS)
{
// Disable post-processing shader, as stereoscopy itself is currently a shader
if (g_Config.sPostProcessingShader == DUBOIS_ALGORITHM_SHADER)
g_Config.sPostProcessingShader = "";
g_Config.iStereoMode = IsHotkey(HK_TOGGLE_STEREO_SBS) ? STEREO_SBS : STEREO_TAB;
g_Config.stereo_mode = IsHotkey(HK_TOGGLE_STEREO_SBS) ? StereoMode::SBS : StereoMode::TAB;
}
else
{
g_Config.iStereoMode = STEREO_OFF;
g_Config.stereo_mode = StereoMode::Off;
}
}
if (IsHotkey(HK_TOGGLE_STEREO_ANAGLYPH))
{
if (g_Config.iStereoMode != STEREO_ANAGLYPH)
if (g_Config.stereo_mode != StereoMode::Anaglyph)
{
g_Config.iStereoMode = STEREO_ANAGLYPH;
g_Config.stereo_mode = StereoMode::Anaglyph;
g_Config.sPostProcessingShader = DUBOIS_ALGORITHM_SHADER;
}
else
{
g_Config.iStereoMode = STEREO_OFF;
g_Config.stereo_mode = StereoMode::Off;
g_Config.sPostProcessingShader = "";
}
}
if (IsHotkey(HK_TOGGLE_STEREO_3DVISION))
{
if (g_Config.iStereoMode != STEREO_3DVISION)
if (g_Config.stereo_mode != StereoMode::Nvidia3DVision)
{
if (g_Config.sPostProcessingShader == DUBOIS_ALGORITHM_SHADER)
g_Config.sPostProcessingShader = "";
g_Config.iStereoMode = STEREO_3DVISION;
g_Config.stereo_mode = StereoMode::Nvidia3DVision;
}
else
{
g_Config.iStereoMode = STEREO_OFF;
g_Config.stereo_mode = StereoMode::Off;
}
}
}