Config: Fix template deduction for implicit conversions
This excludes the second argument from template deduction.
Otherwise, it is required to manually cast the second argument to
the ConfigInfo type (because implicit conversions won't work).
e.g. to set the value for a ConfigInfo<std::string> from a string
literal, you'd need a ugly `std::string("yourstring")`.
This commit is contained in:
@@ -1524,7 +1524,7 @@ void CFrame::ParseHotkeys()
|
||||
// turned off when selecting other stereoscopy modes.
|
||||
if (g_Config.sPostProcessingShader == "dubois")
|
||||
{
|
||||
Config::SetCurrent(Config::GFX_ENHANCE_POST_SHADER, std::string(""));
|
||||
Config::SetCurrent(Config::GFX_ENHANCE_POST_SHADER, "");
|
||||
}
|
||||
Config::SetCurrent(Config::GFX_STEREO_MODE, static_cast<int>(StereoMode::SBS));
|
||||
}
|
||||
@@ -1539,7 +1539,7 @@ void CFrame::ParseHotkeys()
|
||||
{
|
||||
if (g_Config.sPostProcessingShader == "dubois")
|
||||
{
|
||||
Config::SetCurrent(Config::GFX_ENHANCE_POST_SHADER, std::string(""));
|
||||
Config::SetCurrent(Config::GFX_ENHANCE_POST_SHADER, "");
|
||||
}
|
||||
Config::SetCurrent(Config::GFX_STEREO_MODE, static_cast<int>(StereoMode::TAB));
|
||||
}
|
||||
@@ -1555,12 +1555,12 @@ void CFrame::ParseHotkeys()
|
||||
// Setting the anaglyph mode also requires a specific
|
||||
// post-processing shader to be activated.
|
||||
Config::SetCurrent(Config::GFX_STEREO_MODE, static_cast<int>(StereoMode::Anaglyph));
|
||||
Config::SetCurrent(Config::GFX_ENHANCE_POST_SHADER, std::string("dubois"));
|
||||
Config::SetCurrent(Config::GFX_ENHANCE_POST_SHADER, "dubois");
|
||||
}
|
||||
else
|
||||
{
|
||||
Config::SetCurrent(Config::GFX_STEREO_MODE, static_cast<int>(StereoMode::Off));
|
||||
Config::SetCurrent(Config::GFX_ENHANCE_POST_SHADER, std::string(""));
|
||||
Config::SetCurrent(Config::GFX_ENHANCE_POST_SHADER, "");
|
||||
}
|
||||
}
|
||||
if (IsHotkey(HK_TOGGLE_STEREO_3DVISION))
|
||||
@@ -1569,7 +1569,7 @@ void CFrame::ParseHotkeys()
|
||||
{
|
||||
if (g_Config.sPostProcessingShader == "dubois")
|
||||
{
|
||||
Config::SetCurrent(Config::GFX_ENHANCE_POST_SHADER, std::string(""));
|
||||
Config::SetCurrent(Config::GFX_ENHANCE_POST_SHADER, "");
|
||||
}
|
||||
Config::SetCurrent(Config::GFX_STEREO_MODE, static_cast<int>(StereoMode::Nvidia3DVision));
|
||||
}
|
||||
|
||||
@@ -1233,11 +1233,11 @@ void VideoConfigDiag::PopulatePostProcessingShaders()
|
||||
|
||||
if (vconfig.stereo_mode == StereoMode::Anaglyph)
|
||||
{
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_POST_SHADER, std::string("dubois"));
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_POST_SHADER, "dubois");
|
||||
choice_ppshader->SetStringSelection(StrToWxStr(vconfig.sPostProcessingShader));
|
||||
}
|
||||
else
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_POST_SHADER, std::string(""));
|
||||
Config::SetBaseOrCurrent(Config::GFX_ENHANCE_POST_SHADER, "");
|
||||
}
|
||||
|
||||
// Should the configuration button be loaded by default?
|
||||
|
||||
Reference in New Issue
Block a user