Merge pull request #14618 from Dentomologist/stereomode_unabbreviate_variable_names

StereoMode: Unabbreviate enum names
This commit is contained in:
Jordan Woyak
2026-04-25 11:55:03 -05:00
committed by GitHub
7 changed files with 29 additions and 21 deletions
+1 -1
View File
@@ -314,7 +314,7 @@ constexpr std::array<HotkeyGroupInfo, NUM_HOTKEY_GROUPS> s_groups_info = {
{_trans("Internal Resolution"), HK_INCREASE_IR, HK_DECREASE_IR}, {_trans("Internal Resolution"), HK_INCREASE_IR, HK_DECREASE_IR},
{_trans("Freelook"), HK_FREELOOK_TOGGLE, HK_FREELOOK_TOGGLE}, {_trans("Freelook"), HK_FREELOOK_TOGGLE, HK_FREELOOK_TOGGLE},
// i18n: Stereoscopic 3D // i18n: Stereoscopic 3D
{_trans("3D"), HK_TOGGLE_STEREO_SBS, HK_TOGGLE_STEREO_ANAGLYPH}, {_trans("3D"), HK_TOGGLE_STEREO_SIDE_BY_SIDE, HK_TOGGLE_STEREO_ANAGLYPH},
// i18n: Stereoscopic 3D // i18n: Stereoscopic 3D
{_trans("3D Depth"), HK_DECREASE_DEPTH, HK_INCREASE_CONVERGENCE}, {_trans("3D Depth"), HK_DECREASE_DEPTH, HK_INCREASE_CONVERGENCE},
{_trans("Load State"), HK_LOAD_STATE_SLOT_1, HK_LOAD_STATE_SLOT_SELECTED}, {_trans("Load State"), HK_LOAD_STATE_SLOT_1, HK_LOAD_STATE_SLOT_SELECTED},
+2 -2
View File
@@ -107,8 +107,8 @@ enum Hotkey
HK_FREELOOK_TOGGLE, HK_FREELOOK_TOGGLE,
HK_TOGGLE_STEREO_SBS, HK_TOGGLE_STEREO_SIDE_BY_SIDE,
HK_TOGGLE_STEREO_TAB, HK_TOGGLE_STEREO_TOP_AND_BOTTOM,
HK_TOGGLE_STEREO_ANAGLYPH, HK_TOGGLE_STEREO_ANAGLYPH,
HK_DECREASE_DEPTH, HK_DECREASE_DEPTH,
@@ -241,8 +241,11 @@ void EnhancementsWidget::CreateWidgets()
m_3d_convergence_value->setText(QString::asprintf("%.2f", m_3d_convergence->GetValue())); m_3d_convergence_value->setText(QString::asprintf("%.2f", m_3d_convergence->GetValue()));
auto current_stereo_mode = Get(m_game_layer, Config::GFX_STEREO_MODE); auto current_stereo_mode = Get(m_game_layer, Config::GFX_STEREO_MODE);
if (current_stereo_mode != StereoMode::SBS && current_stereo_mode != StereoMode::TAB) if (current_stereo_mode != StereoMode::SideBySide &&
current_stereo_mode != StereoMode::TopAndBottom)
{
m_3d_per_eye_resolution->hide(); m_3d_per_eye_resolution->hide();
}
main_layout->addWidget(enhancements_box); main_layout->addWidget(enhancements_box);
main_layout->addWidget(stereoscopy_box); main_layout->addWidget(stereoscopy_box);
@@ -257,10 +260,15 @@ void EnhancementsWidget::ConnectWidgets()
auto current_stereo_mode = Get(m_game_layer, Config::GFX_STEREO_MODE); auto current_stereo_mode = Get(m_game_layer, Config::GFX_STEREO_MODE);
LoadPostProcessingShaders(); LoadPostProcessingShaders();
if (current_stereo_mode == StereoMode::SBS || current_stereo_mode == StereoMode::TAB) if (current_stereo_mode == StereoMode::SideBySide ||
current_stereo_mode == StereoMode::TopAndBottom)
{
m_3d_per_eye_resolution->show(); m_3d_per_eye_resolution->show();
}
else else
{
m_3d_per_eye_resolution->hide(); m_3d_per_eye_resolution->hide();
}
}); });
connect(m_post_processing_effect, &QComboBox::currentIndexChanged, this, connect(m_post_processing_effect, &QComboBox::currentIndexChanged, this,
+6 -6
View File
@@ -551,15 +551,15 @@ void HotkeyScheduler::Run()
emit DecrementSelectedStateSlotHotkey(); emit DecrementSelectedStateSlotHotkey();
// Stereoscopy // Stereoscopy
if (IsHotkey(HK_TOGGLE_STEREO_SBS)) if (IsHotkey(HK_TOGGLE_STEREO_SIDE_BY_SIDE))
{ {
if (Config::Get(Config::GFX_STEREO_MODE) != StereoMode::SBS) if (Config::Get(Config::GFX_STEREO_MODE) != StereoMode::SideBySide)
{ {
// Disable post-processing shader, as stereoscopy itself is currently a shader // Disable post-processing shader, as stereoscopy itself is currently a shader
if (Config::Get(Config::GFX_ENHANCE_POST_SHADER) == DUBOIS_ALGORITHM_SHADER) if (Config::Get(Config::GFX_ENHANCE_POST_SHADER) == DUBOIS_ALGORITHM_SHADER)
Config::SetCurrent(Config::GFX_ENHANCE_POST_SHADER, ""); Config::SetCurrent(Config::GFX_ENHANCE_POST_SHADER, "");
Config::SetCurrent(Config::GFX_STEREO_MODE, StereoMode::SBS); Config::SetCurrent(Config::GFX_STEREO_MODE, StereoMode::SideBySide);
} }
else else
{ {
@@ -567,15 +567,15 @@ void HotkeyScheduler::Run()
} }
} }
if (IsHotkey(HK_TOGGLE_STEREO_TAB)) if (IsHotkey(HK_TOGGLE_STEREO_TOP_AND_BOTTOM))
{ {
if (Config::Get(Config::GFX_STEREO_MODE) != StereoMode::TAB) if (Config::Get(Config::GFX_STEREO_MODE) != StereoMode::TopAndBottom)
{ {
// Disable post-processing shader, as stereoscopy itself is currently a shader // Disable post-processing shader, as stereoscopy itself is currently a shader
if (Config::Get(Config::GFX_ENHANCE_POST_SHADER) == DUBOIS_ALGORITHM_SHADER) if (Config::Get(Config::GFX_ENHANCE_POST_SHADER) == DUBOIS_ALGORITHM_SHADER)
Config::SetCurrent(Config::GFX_ENHANCE_POST_SHADER, ""); Config::SetCurrent(Config::GFX_ENHANCE_POST_SHADER, "");
Config::SetCurrent(Config::GFX_STEREO_MODE, StereoMode::TAB); Config::SetCurrent(Config::GFX_STEREO_MODE, StereoMode::TopAndBottom);
} }
else else
{ {
+2 -2
View File
@@ -1017,8 +1017,8 @@ static bool UseGeometryShaderForPostProcess(bool is_intermediary_buffer)
case StereoMode::Anaglyph: case StereoMode::Anaglyph:
case StereoMode::Passive: case StereoMode::Passive:
return is_intermediary_buffer; return is_intermediary_buffer;
case StereoMode::SBS: case StereoMode::SideBySide:
case StereoMode::TAB: case StereoMode::TopAndBottom:
case StereoMode::Off: case StereoMode::Off:
default: default:
return false; return false;
+6 -6
View File
@@ -392,7 +392,7 @@ Presenter::ConvertStereoRectangle(const MathUtil::Rectangle<int>& rc) const
{ {
// Resize target to half its original size // Resize target to half its original size
auto draw_rc = rc; auto draw_rc = rc;
if (g_ActiveConfig.stereo_mode == StereoMode::TAB) if (g_ActiveConfig.stereo_mode == StereoMode::TopAndBottom)
{ {
// The height may be negative due to flipped rectangles // The height may be negative due to flipped rectangles
int height = rc.bottom - rc.top; int height = rc.bottom - rc.top;
@@ -409,7 +409,7 @@ Presenter::ConvertStereoRectangle(const MathUtil::Rectangle<int>& rc) const
// Create two target rectangle offset to the sides of the backbuffer // Create two target rectangle offset to the sides of the backbuffer
auto left_rc = draw_rc; auto left_rc = draw_rc;
auto right_rc = draw_rc; auto right_rc = draw_rc;
if (g_ActiveConfig.stereo_mode == StereoMode::TAB) if (g_ActiveConfig.stereo_mode == StereoMode::TopAndBottom)
{ {
left_rc.top -= m_backbuffer_height / 4; left_rc.top -= m_backbuffer_height / 4;
left_rc.bottom -= m_backbuffer_height / 4; left_rc.bottom -= m_backbuffer_height / 4;
@@ -477,13 +477,13 @@ float Presenter::CalculateDrawAspectRatio(bool allow_stretch) const
if (g_ActiveConfig.stereo_per_eye_resolution_full) if (g_ActiveConfig.stereo_per_eye_resolution_full)
{ {
if (g_ActiveConfig.stereo_mode == StereoMode::SBS) if (g_ActiveConfig.stereo_mode == StereoMode::SideBySide)
{ {
// Render twice as wide if using side-by-side 3D, since the 3D will halve the horizontal // Render twice as wide if using side-by-side 3D, since the 3D will halve the horizontal
// resolution // resolution
resulting_aspect_ratio *= 2.0; resulting_aspect_ratio *= 2.0;
} }
else if (g_ActiveConfig.stereo_mode == StereoMode::TAB) else if (g_ActiveConfig.stereo_mode == StereoMode::TopAndBottom)
{ {
// Render twice as tall if using top-and-bottom 3D, since the 3D will halve the vertical // Render twice as tall if using top-and-bottom 3D, since the 3D will halve the vertical
// resolution // resolution
@@ -830,8 +830,8 @@ void Presenter::RenderXFBToScreen(const MathUtil::Rectangle<int>& target_rc,
g_gfx->SelectMainBuffer(); g_gfx->SelectMainBuffer();
} }
else if (g_ActiveConfig.stereo_mode == StereoMode::SBS || else if (g_ActiveConfig.stereo_mode == StereoMode::SideBySide ||
g_ActiveConfig.stereo_mode == StereoMode::TAB) g_ActiveConfig.stereo_mode == StereoMode::TopAndBottom)
{ {
const auto [left_rc, right_rc] = ConvertStereoRectangle(target_rc); const auto [left_rc, right_rc] = ConvertStereoRectangle(target_rc);
+2 -2
View File
@@ -33,8 +33,8 @@ enum class AspectMode : int
enum class StereoMode : int enum class StereoMode : int
{ {
Off, Off,
SBS, SideBySide,
TAB, TopAndBottom,
Anaglyph, Anaglyph,
QuadBuffer, QuadBuffer,
Passive Passive