summaryrefslogtreecommitdiff
path: root/src/core/frontend
diff options
context:
space:
mode:
authorGravatar lat9nq2023-08-21 16:03:30 -0400
committerGravatar lat9nq2023-08-22 16:07:52 -0400
commit387ede76d2e1e427f6722cbe19a018c95d762748 (patch)
tree49f5a327eac0238c0e5197550f4753da592212b7 /src/core/frontend
parentshared_widget: Implement radio groups (diff)
downloadyuzu-387ede76d2e1e427f6722cbe19a018c95d762748.tar.gz
yuzu-387ede76d2e1e427f6722cbe19a018c95d762748.tar.xz
yuzu-387ede76d2e1e427f6722cbe19a018c95d762748.zip
general: Convert use_docked_mode to an enumeration
Allows some special interactions with it in the Qt frontend.
Diffstat (limited to 'src/core/frontend')
-rw-r--r--src/core/frontend/applets/controller.cpp3
-rw-r--r--src/core/frontend/framebuffer_layout.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/core/frontend/applets/controller.cpp b/src/core/frontend/applets/controller.cpp
index 3300d4f79..4c0c5434c 100644
--- a/src/core/frontend/applets/controller.cpp
+++ b/src/core/frontend/applets/controller.cpp
@@ -3,6 +3,7 @@
3 3
4#include "common/assert.h" 4#include "common/assert.h"
5#include "common/logging/log.h" 5#include "common/logging/log.h"
6#include "common/settings_enums.h"
6#include "core/frontend/applets/controller.h" 7#include "core/frontend/applets/controller.h"
7#include "core/hid/emulated_controller.h" 8#include "core/hid/emulated_controller.h"
8#include "core/hid/hid_core.h" 9#include "core/hid/hid_core.h"
@@ -62,7 +63,7 @@ void DefaultControllerApplet::ReconfigureControllers(ReconfigureCallback callbac
62 controller->Connect(true); 63 controller->Connect(true);
63 } 64 }
64 } else if (index == 0 && parameters.enable_single_mode && parameters.allow_handheld && 65 } else if (index == 0 && parameters.enable_single_mode && parameters.allow_handheld &&
65 !Settings::values.use_docked_mode.GetValue()) { 66 Settings::values.use_docked_mode.GetValue() == Settings::ConsoleMode::Handheld) {
66 // We should *never* reach here under any normal circumstances. 67 // We should *never* reach here under any normal circumstances.
67 controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::Handheld); 68 controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::Handheld);
68 controller->Connect(true); 69 controller->Connect(true);
diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp
index b4081fc39..ae0a44f12 100644
--- a/src/core/frontend/framebuffer_layout.cpp
+++ b/src/core/frontend/framebuffer_layout.cpp
@@ -5,6 +5,7 @@
5 5
6#include "common/assert.h" 6#include "common/assert.h"
7#include "common/settings.h" 7#include "common/settings.h"
8#include "common/settings_enums.h"
8#include "core/frontend/framebuffer_layout.h" 9#include "core/frontend/framebuffer_layout.h"
9 10
10namespace Layout { 11namespace Layout {
@@ -49,7 +50,8 @@ FramebufferLayout DefaultFrameLayout(u32 width, u32 height) {
49} 50}
50 51
51FramebufferLayout FrameLayoutFromResolutionScale(f32 res_scale) { 52FramebufferLayout FrameLayoutFromResolutionScale(f32 res_scale) {
52 const bool is_docked = Settings::values.use_docked_mode.GetValue(); 53 const bool is_docked =
54 Settings::values.use_docked_mode.GetValue() == Settings::ConsoleMode::Docked;
53 const u32 screen_width = is_docked ? ScreenDocked::Width : ScreenUndocked::Width; 55 const u32 screen_width = is_docked ? ScreenDocked::Width : ScreenUndocked::Width;
54 const u32 screen_height = is_docked ? ScreenDocked::Height : ScreenUndocked::Height; 56 const u32 screen_height = is_docked ? ScreenDocked::Height : ScreenUndocked::Height;
55 57