mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 15:55:31 +01:00
Merge pull request #8608 from jordan-woyak/stereoscopy-hotkeys
DolphinQt: Fix stereoscopy hotkeys.
This commit is contained in:
commit
3b0b264c84
@ -99,6 +99,10 @@ extern const ConfigInfo<int> GFX_STEREO_CONVERGENCE;
|
|||||||
extern const ConfigInfo<bool> GFX_STEREO_EFB_MONO_DEPTH;
|
extern const ConfigInfo<bool> GFX_STEREO_EFB_MONO_DEPTH;
|
||||||
extern const ConfigInfo<int> GFX_STEREO_DEPTH_PERCENTAGE;
|
extern const ConfigInfo<int> GFX_STEREO_DEPTH_PERCENTAGE;
|
||||||
|
|
||||||
|
// Stereoscopy pseudo-limits for consistent behavior between enhancements tab and hotkeys.
|
||||||
|
static constexpr int GFX_STEREO_DEPTH_MAXIMUM = 100;
|
||||||
|
static constexpr int GFX_STEREO_CONVERGENCE_MAXIMUM = 200;
|
||||||
|
|
||||||
// Graphics.Hacks
|
// Graphics.Hacks
|
||||||
|
|
||||||
extern const ConfigInfo<bool> GFX_HACK_EFB_ACCESS_ENABLE;
|
extern const ConfigInfo<bool> GFX_HACK_EFB_ACCESS_ENABLE;
|
||||||
|
@ -113,8 +113,9 @@ void EnhancementsWidget::CreateWidgets()
|
|||||||
m_3d_mode = new GraphicsChoice({tr("Off"), tr("Side-by-Side"), tr("Top-and-Bottom"),
|
m_3d_mode = new GraphicsChoice({tr("Off"), tr("Side-by-Side"), tr("Top-and-Bottom"),
|
||||||
tr("Anaglyph"), tr("HDMI 3D"), tr("Passive")},
|
tr("Anaglyph"), tr("HDMI 3D"), tr("Passive")},
|
||||||
Config::GFX_STEREO_MODE);
|
Config::GFX_STEREO_MODE);
|
||||||
m_3d_depth = new GraphicsSlider(0, 100, Config::GFX_STEREO_DEPTH);
|
m_3d_depth = new GraphicsSlider(0, Config::GFX_STEREO_DEPTH_MAXIMUM, Config::GFX_STEREO_DEPTH);
|
||||||
m_3d_convergence = new GraphicsSlider(0, 200, Config::GFX_STEREO_CONVERGENCE, 100);
|
m_3d_convergence = new GraphicsSlider(0, Config::GFX_STEREO_CONVERGENCE_MAXIMUM,
|
||||||
|
Config::GFX_STEREO_CONVERGENCE, 100);
|
||||||
m_3d_swap_eyes = new GraphicsBool(tr("Swap Eyes"), Config::GFX_STEREO_SWAP_EYES);
|
m_3d_swap_eyes = new GraphicsBool(tr("Swap Eyes"), Config::GFX_STEREO_SWAP_EYES);
|
||||||
|
|
||||||
stereoscopy_layout->addWidget(new QLabel(tr("Stereoscopic 3D Mode:")), 0, 0);
|
stereoscopy_layout->addWidget(new QLabel(tr("Stereoscopic 3D Mode:")), 0, 0);
|
||||||
|
@ -508,10 +508,11 @@ void HotkeyScheduler::Run()
|
|||||||
const auto stereo_depth = Config::Get(Config::GFX_STEREO_DEPTH);
|
const auto stereo_depth = Config::Get(Config::GFX_STEREO_DEPTH);
|
||||||
|
|
||||||
if (IsHotkey(HK_DECREASE_DEPTH, true))
|
if (IsHotkey(HK_DECREASE_DEPTH, true))
|
||||||
Config::SetCurrent(Config::GFX_STEREO_DEPTH, std::min(stereo_depth - 1, 0));
|
Config::SetCurrent(Config::GFX_STEREO_DEPTH, std::max(stereo_depth - 1, 0));
|
||||||
|
|
||||||
if (IsHotkey(HK_INCREASE_DEPTH, true))
|
if (IsHotkey(HK_INCREASE_DEPTH, true))
|
||||||
Config::SetCurrent(Config::GFX_STEREO_DEPTH, std::min(stereo_depth + 1, 100));
|
Config::SetCurrent(Config::GFX_STEREO_DEPTH,
|
||||||
|
std::min(stereo_depth + 1, Config::GFX_STEREO_DEPTH_MAXIMUM));
|
||||||
|
|
||||||
const auto stereo_convergence = Config::Get(Config::GFX_STEREO_CONVERGENCE);
|
const auto stereo_convergence = Config::Get(Config::GFX_STEREO_CONVERGENCE);
|
||||||
|
|
||||||
@ -519,7 +520,8 @@ void HotkeyScheduler::Run()
|
|||||||
Config::SetCurrent(Config::GFX_STEREO_CONVERGENCE, std::max(stereo_convergence - 5, 0));
|
Config::SetCurrent(Config::GFX_STEREO_CONVERGENCE, std::max(stereo_convergence - 5, 0));
|
||||||
|
|
||||||
if (IsHotkey(HK_INCREASE_CONVERGENCE, true))
|
if (IsHotkey(HK_INCREASE_CONVERGENCE, true))
|
||||||
Config::SetCurrent(Config::GFX_STEREO_CONVERGENCE, std::min(stereo_convergence + 5, 500));
|
Config::SetCurrent(Config::GFX_STEREO_CONVERGENCE,
|
||||||
|
std::min(stereo_convergence + 5, Config::GFX_STEREO_CONVERGENCE_MAXIMUM));
|
||||||
|
|
||||||
// Freelook
|
// Freelook
|
||||||
static float fl_speed = 1.0;
|
static float fl_speed = 1.0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user