summaryrefslogtreecommitdiff
path: root/src/citra/config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra/config.cpp')
-rw-r--r--src/citra/config.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/citra/config.cpp b/src/citra/config.cpp
index 818824596..ef1229912 100644
--- a/src/citra/config.cpp
+++ b/src/citra/config.cpp
@@ -8,6 +8,7 @@
8#include "citra/default_ini.h" 8#include "citra/default_ini.h"
9#include "common/file_util.h" 9#include "common/file_util.h"
10#include "common/logging/log.h" 10#include "common/logging/log.h"
11#include "common/param_package.h"
11#include "config.h" 12#include "config.h"
12#include "core/settings.h" 13#include "core/settings.h"
13#include "input_common/main.h" 14#include "input_common/main.h"
@@ -44,6 +45,15 @@ static const std::array<int, Settings::NativeButton::NumButtons> default_buttons
44 SDL_SCANCODE_M, SDL_SCANCODE_N, SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_B, 45 SDL_SCANCODE_M, SDL_SCANCODE_N, SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_B,
45}; 46};
46 47
48static const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> default_analogs{{
49 {
50 SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_LEFT, SDL_SCANCODE_RIGHT, SDL_SCANCODE_D,
51 },
52 {
53 SDL_SCANCODE_I, SDL_SCANCODE_K, SDL_SCANCODE_J, SDL_SCANCODE_L, SDL_SCANCODE_D,
54 },
55}};
56
47void Config::ReadValues() { 57void Config::ReadValues() {
48 // Controls 58 // Controls
49 for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) { 59 for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) {
@@ -54,6 +64,16 @@ void Config::ReadValues() {
54 Settings::values.buttons[i] = default_param; 64 Settings::values.buttons[i] = default_param;
55 } 65 }
56 66
67 for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) {
68 std::string default_param = InputCommon::GenerateAnalogParamFromKeys(
69 default_analogs[i][0], default_analogs[i][1], default_analogs[i][2],
70 default_analogs[i][3], default_analogs[i][4], 0.5f);
71 Settings::values.analogs[i] =
72 sdl2_config->Get("Controls", Settings::NativeAnalog::mapping[i], default_param);
73 if (Settings::values.analogs[i].empty())
74 Settings::values.analogs[i] = default_param;
75 }
76
57 // Core 77 // Core
58 Settings::values.use_cpu_jit = sdl2_config->GetBoolean("Core", "use_cpu_jit", true); 78 Settings::values.use_cpu_jit = sdl2_config->GetBoolean("Core", "use_cpu_jit", true);
59 79