mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 17:19:44 -06:00
VideoConfig: Make StereoMode an enum class
Makes for more strongly-typed identifiers (and doesn't pollute surrounding namespaces)
This commit is contained in:
@ -20,7 +20,7 @@ constexpr std::array<const char*, 4> primitives_d3d = {{"point", "line", "triang
|
||||
|
||||
bool geometry_shader_uid_data::IsPassthrough() const
|
||||
{
|
||||
const bool stereo = g_ActiveConfig.iStereoMode > 0;
|
||||
const bool stereo = g_ActiveConfig.stereo_mode != StereoMode::Off;
|
||||
const bool wireframe = g_ActiveConfig.bWireFrame;
|
||||
return primitive_type >= static_cast<u32>(PrimitiveType::Triangles) && !stereo && !wireframe;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ void GeometryShaderManager::Dirty()
|
||||
|
||||
void GeometryShaderManager::SetConstants()
|
||||
{
|
||||
if (s_projection_changed && g_ActiveConfig.iStereoMode > 0)
|
||||
if (s_projection_changed && g_ActiveConfig.stereo_mode != StereoMode::Off)
|
||||
{
|
||||
s_projection_changed = false;
|
||||
|
||||
|
@ -70,7 +70,8 @@ std::string PostProcessingShaderConfiguration::LoadShader(std::string shader)
|
||||
shader = g_ActiveConfig.sPostProcessingShader;
|
||||
m_current_shader = shader;
|
||||
|
||||
const std::string sub_dir = (g_Config.iStereoMode == STEREO_ANAGLYPH) ? ANAGLYPH_DIR DIR_SEP : "";
|
||||
const std::string sub_dir =
|
||||
(g_Config.stereo_mode == StereoMode::Anaglyph) ? ANAGLYPH_DIR DIR_SEP : "";
|
||||
|
||||
// loading shader code
|
||||
std::string code;
|
||||
|
@ -185,7 +185,7 @@ Renderer::ConvertStereoRectangle(const TargetRectangle& rc) const
|
||||
{
|
||||
// Resize target to half its original size
|
||||
TargetRectangle draw_rc = rc;
|
||||
if (g_ActiveConfig.iStereoMode == STEREO_TAB)
|
||||
if (g_ActiveConfig.stereo_mode == StereoMode::TAB)
|
||||
{
|
||||
// The height may be negative due to flipped rectangles
|
||||
int height = rc.bottom - rc.top;
|
||||
@ -202,7 +202,7 @@ Renderer::ConvertStereoRectangle(const TargetRectangle& rc) const
|
||||
// Create two target rectangle offset to the sides of the backbuffer
|
||||
TargetRectangle left_rc = draw_rc;
|
||||
TargetRectangle right_rc = draw_rc;
|
||||
if (g_ActiveConfig.iStereoMode == STEREO_TAB)
|
||||
if (g_ActiveConfig.stereo_mode == StereoMode::TAB)
|
||||
{
|
||||
left_rc.top -= m_backbuffer_height / 4;
|
||||
left_rc.bottom -= m_backbuffer_height / 4;
|
||||
|
@ -13,7 +13,7 @@ ShaderHostConfig ShaderHostConfig::GetCurrent()
|
||||
bits.msaa = g_ActiveConfig.iMultisamples > 1;
|
||||
bits.ssaa = g_ActiveConfig.iMultisamples > 1 && g_ActiveConfig.bSSAA &&
|
||||
g_ActiveConfig.backend_info.bSupportsSSAA;
|
||||
bits.stereo = g_ActiveConfig.iStereoMode > 0;
|
||||
bits.stereo = g_ActiveConfig.stereo_mode != StereoMode::Off;
|
||||
bits.wireframe = g_ActiveConfig.bWireFrame;
|
||||
bits.per_pixel_lighting = g_ActiveConfig.bEnablePixelLighting;
|
||||
bits.vertex_rounding = g_ActiveConfig.UseVertexRounding();
|
||||
|
@ -130,7 +130,7 @@ void TextureCacheBase::OnConfigChanged(VideoConfig& config)
|
||||
g_ActiveConfig.bTexFmtOverlayCenter);
|
||||
}
|
||||
|
||||
if ((config.iStereoMode > 0) != backup_config.stereo_3d ||
|
||||
if ((config.stereo_mode != StereoMode::Off) != backup_config.stereo_3d ||
|
||||
config.bStereoEFBMonoDepth != backup_config.efb_mono_depth)
|
||||
{
|
||||
g_texture_cache->DeleteShaders();
|
||||
@ -222,7 +222,7 @@ void TextureCacheBase::SetBackupConfig(const VideoConfig& config)
|
||||
backup_config.texfmt_overlay_center = config.bTexFmtOverlayCenter;
|
||||
backup_config.hires_textures = config.bHiresTextures;
|
||||
backup_config.cache_hires_textures = config.bCacheHiresTextures;
|
||||
backup_config.stereo_3d = config.iStereoMode > 0;
|
||||
backup_config.stereo_3d = config.stereo_mode != StereoMode::Off;
|
||||
backup_config.efb_mono_depth = config.bStereoEFBMonoDepth;
|
||||
backup_config.gpu_texture_decoding = config.bEnableGPUTextureDecoding;
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ void VideoConfig::Refresh()
|
||||
sPostProcessingShader = Config::Get(Config::GFX_ENHANCE_POST_SHADER);
|
||||
bForceTrueColor = Config::Get(Config::GFX_ENHANCE_FORCE_TRUE_COLOR);
|
||||
|
||||
iStereoMode = Config::Get(Config::GFX_STEREO_MODE);
|
||||
stereo_mode = static_cast<StereoMode>(Config::Get(Config::GFX_STEREO_MODE));
|
||||
iStereoDepth = Config::Get(Config::GFX_STEREO_DEPTH);
|
||||
iStereoConvergencePercentage = Config::Get(Config::GFX_STEREO_CONVERGENCE_PERCENTAGE);
|
||||
bStereoSwapEyes = Config::Get(Config::GFX_STEREO_SWAP_EYES);
|
||||
@ -162,14 +162,14 @@ void VideoConfig::VerifyValidity()
|
||||
backend_info.AAModes.end())
|
||||
iMultisamples = 1;
|
||||
|
||||
if (iStereoMode > 0)
|
||||
if (stereo_mode != StereoMode::Off)
|
||||
{
|
||||
if (!backend_info.bSupportsGeometryShaders)
|
||||
{
|
||||
OSD::AddMessage(
|
||||
"Stereoscopic 3D isn't supported by your GPU, support for OpenGL 3.2 is required.",
|
||||
10000);
|
||||
iStereoMode = 0;
|
||||
stereo_mode = StereoMode::Off;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,14 +32,14 @@ enum class AspectMode
|
||||
Stretch,
|
||||
};
|
||||
|
||||
enum StereoMode
|
||||
enum class StereoMode
|
||||
{
|
||||
STEREO_OFF = 0,
|
||||
STEREO_SBS,
|
||||
STEREO_TAB,
|
||||
STEREO_ANAGLYPH,
|
||||
STEREO_QUADBUFFER,
|
||||
STEREO_3DVISION
|
||||
Off,
|
||||
SBS,
|
||||
TAB,
|
||||
Anaglyph,
|
||||
QuadBuffer,
|
||||
Nvidia3DVision
|
||||
};
|
||||
|
||||
struct ProjectionHackConfig final
|
||||
@ -130,7 +130,7 @@ struct VideoConfig final
|
||||
int iSaveTargetId; // TODO: Should be dropped
|
||||
|
||||
// Stereoscopy
|
||||
int iStereoMode;
|
||||
StereoMode stereo_mode;
|
||||
int iStereoDepth;
|
||||
int iStereoConvergence;
|
||||
int iStereoConvergencePercentage;
|
||||
|
Reference in New Issue
Block a user