summaryrefslogtreecommitdiffstats
path: root/src/citra/config.cpp
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2017-01-21 12:04:00 +0100
committerwwylele <wwylele@gmail.com>2017-03-01 22:30:57 +0100
commita6bd7917cbc06f9b8f5a7ae24e75db776dc1cd6a (patch)
tree2ed60e602d520f80f57f88f879c4f50363432c17 /src/citra/config.cpp
parentInputCommon: add Keyboard (diff)
downloadyuzu-a6bd7917cbc06f9b8f5a7ae24e75db776dc1cd6a.tar
yuzu-a6bd7917cbc06f9b8f5a7ae24e75db776dc1cd6a.tar.gz
yuzu-a6bd7917cbc06f9b8f5a7ae24e75db776dc1cd6a.tar.bz2
yuzu-a6bd7917cbc06f9b8f5a7ae24e75db776dc1cd6a.tar.lz
yuzu-a6bd7917cbc06f9b8f5a7ae24e75db776dc1cd6a.tar.xz
yuzu-a6bd7917cbc06f9b8f5a7ae24e75db776dc1cd6a.tar.zst
yuzu-a6bd7917cbc06f9b8f5a7ae24e75db776dc1cd6a.zip
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 @@
#include "citra/default_ini.h"
#include "common/file_util.h"
#include "common/logging/log.h"
+#include "common/param_package.h"
#include "config.h"
#include "core/settings.h"
#include "input_common/main.h"
@@ -44,6 +45,15 @@ static const std::array<int, Settings::NativeButton::NumButtons> default_buttons
SDL_SCANCODE_M, SDL_SCANCODE_N, SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_B,
};
+static const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> default_analogs{{
+ {
+ SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_LEFT, SDL_SCANCODE_RIGHT, SDL_SCANCODE_D,
+ },
+ {
+ SDL_SCANCODE_I, SDL_SCANCODE_K, SDL_SCANCODE_J, SDL_SCANCODE_L, SDL_SCANCODE_D,
+ },
+}};
+
void Config::ReadValues() {
// Controls
for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) {
@@ -54,6 +64,16 @@ void Config::ReadValues() {
Settings::values.buttons[i] = default_param;
}
+ for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) {
+ std::string default_param = InputCommon::GenerateAnalogParamFromKeys(
+ default_analogs[i][0], default_analogs[i][1], default_analogs[i][2],
+ default_analogs[i][3], default_analogs[i][4], 0.5f);
+ Settings::values.analogs[i] =
+ sdl2_config->Get("Controls", Settings::NativeAnalog::mapping[i], default_param);
+ if (Settings::values.analogs[i].empty())
+ Settings::values.analogs[i] = default_param;
+ }
+
// Core
Settings::values.use_cpu_jit = sdl2_config->GetBoolean("Core", "use_cpu_jit", true);