general: Convert use_docked_mode to an enumeration
Allows some special interactions with it in the Qt frontend.
This commit is contained in:
parent
8a4cb3f902
commit
387ede76d2
17 changed files with 74 additions and 35 deletions
|
@ -6,6 +6,7 @@
|
|||
#include <cinttypes>
|
||||
#include <cstring>
|
||||
#include "common/settings.h"
|
||||
#include "common/settings_enums.h"
|
||||
#include "core/core.h"
|
||||
#include "core/file_sys/control_metadata.h"
|
||||
#include "core/file_sys/patch_manager.h"
|
||||
|
@ -833,7 +834,7 @@ void ICommonStateGetter::GetDefaultDisplayResolution(HLERequestContext& ctx) {
|
|||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
if (Settings::values.use_docked_mode.GetValue()) {
|
||||
if (Settings::values.use_docked_mode.GetValue() == Settings::ConsoleMode::Docked) {
|
||||
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth));
|
||||
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight));
|
||||
} else {
|
||||
|
@ -921,7 +922,8 @@ void IStorage::Open(HLERequestContext& ctx) {
|
|||
}
|
||||
|
||||
void ICommonStateGetter::GetOperationMode(HLERequestContext& ctx) {
|
||||
const bool use_docked_mode{Settings::values.use_docked_mode.GetValue()};
|
||||
const bool use_docked_mode{Settings::values.use_docked_mode.GetValue() ==
|
||||
Settings::ConsoleMode::Docked};
|
||||
LOG_DEBUG(Service_AM, "called, use_docked_mode={}", use_docked_mode);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "common/logging/log.h"
|
||||
#include "common/settings.h"
|
||||
#include "common/settings_enums.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/hle/service/apm/apm_controller.h"
|
||||
|
||||
|
@ -67,8 +68,9 @@ void Controller::SetFromCpuBoostMode(CpuBoostMode mode) {
|
|||
}
|
||||
|
||||
PerformanceMode Controller::GetCurrentPerformanceMode() const {
|
||||
return Settings::values.use_docked_mode.GetValue() ? PerformanceMode::Boost
|
||||
: PerformanceMode::Normal;
|
||||
return Settings::values.use_docked_mode.GetValue() == Settings::ConsoleMode::Docked
|
||||
? PerformanceMode::Boost
|
||||
: PerformanceMode::Normal;
|
||||
}
|
||||
|
||||
PerformanceConfiguration Controller::GetCurrentPerformanceConfiguration(PerformanceMode mode) {
|
||||
|
|
|
@ -331,7 +331,7 @@ Controller_Gesture::GestureProperties Controller_Gesture::GetGestureProperties()
|
|||
};
|
||||
|
||||
// Hack: There is no touch in docked but games still allow it
|
||||
if (Settings::values.use_docked_mode.GetValue()) {
|
||||
if (Settings::values.use_docked_mode.GetValue() == Settings::ConsoleMode::Docked) {
|
||||
gesture.points[id] = {
|
||||
.x = static_cast<s32>(active_x * Layout::ScreenDocked::Width),
|
||||
.y = static_cast<s32>(active_y * Layout::ScreenDocked::Height),
|
||||
|
|
|
@ -1518,7 +1518,7 @@ bool Controller_NPad::IsControllerSupported(Core::HID::NpadStyleIndex controller
|
|||
return false;
|
||||
}
|
||||
// Handheld shouldn't be supported in docked mode
|
||||
if (Settings::values.use_docked_mode.GetValue()) {
|
||||
if (Settings::values.use_docked_mode.GetValue() == Settings::ConsoleMode::Docked) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ private:
|
|||
IPC::ResponseBuilder rb{ctx, 6};
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
if (Settings::values.use_docked_mode.GetValue()) {
|
||||
if (Settings::values.use_docked_mode.GetValue() == Settings::ConsoleMode::Docked) {
|
||||
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth));
|
||||
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight));
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue