diff options
Diffstat (limited to 'src/citra/config.cpp')
| -rw-r--r-- | src/citra/config.cpp | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/src/citra/config.cpp b/src/citra/config.cpp index 1a09f0e55..05eabfa3d 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp | |||
| @@ -3,19 +3,13 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <memory> | 5 | #include <memory> |
| 6 | |||
| 7 | #include <inih/cpp/INIReader.h> | ||
| 8 | |||
| 9 | #include <SDL.h> | 6 | #include <SDL.h> |
| 10 | 7 | #include <inih/cpp/INIReader.h> | |
| 11 | #include "citra/default_ini.h" | 8 | #include "citra/default_ini.h" |
| 12 | |||
| 13 | #include "common/file_util.h" | 9 | #include "common/file_util.h" |
| 14 | #include "common/logging/log.h" | 10 | #include "common/logging/log.h" |
| 15 | |||
| 16 | #include "core/settings.h" | ||
| 17 | |||
| 18 | #include "config.h" | 11 | #include "config.h" |
| 12 | #include "core/settings.h" | ||
| 19 | 13 | ||
| 20 | Config::Config() { | 14 | Config::Config() { |
| 21 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. | 15 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. |
| @@ -45,15 +39,13 @@ bool Config::LoadINI(const std::string& default_contents, bool retry) { | |||
| 45 | 39 | ||
| 46 | static const std::array<int, Settings::NativeInput::NUM_INPUTS> defaults = { | 40 | static const std::array<int, Settings::NativeInput::NUM_INPUTS> defaults = { |
| 47 | // directly mapped keys | 41 | // directly mapped keys |
| 48 | SDL_SCANCODE_A, SDL_SCANCODE_S, SDL_SCANCODE_Z, SDL_SCANCODE_X, | 42 | SDL_SCANCODE_A, SDL_SCANCODE_S, SDL_SCANCODE_Z, SDL_SCANCODE_X, SDL_SCANCODE_Q, SDL_SCANCODE_W, |
| 49 | SDL_SCANCODE_Q, SDL_SCANCODE_W, SDL_SCANCODE_1, SDL_SCANCODE_2, | 43 | SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_M, SDL_SCANCODE_N, SDL_SCANCODE_B, SDL_SCANCODE_T, |
| 50 | SDL_SCANCODE_M, SDL_SCANCODE_N, SDL_SCANCODE_B, | 44 | SDL_SCANCODE_G, SDL_SCANCODE_F, SDL_SCANCODE_H, SDL_SCANCODE_I, SDL_SCANCODE_K, SDL_SCANCODE_J, |
| 51 | SDL_SCANCODE_T, SDL_SCANCODE_G, SDL_SCANCODE_F, SDL_SCANCODE_H, | 45 | SDL_SCANCODE_L, |
| 52 | SDL_SCANCODE_I, SDL_SCANCODE_K, SDL_SCANCODE_J, SDL_SCANCODE_L, | ||
| 53 | 46 | ||
| 54 | // indirectly mapped keys | 47 | // indirectly mapped keys |
| 55 | SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_LEFT, SDL_SCANCODE_RIGHT, | 48 | SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_LEFT, SDL_SCANCODE_RIGHT, SDL_SCANCODE_D, |
| 56 | SDL_SCANCODE_D, | ||
| 57 | }; | 49 | }; |
| 58 | 50 | ||
| 59 | void Config::ReadValues() { | 51 | void Config::ReadValues() { |
| @@ -62,7 +54,8 @@ void Config::ReadValues() { | |||
| 62 | Settings::values.input_mappings[Settings::NativeInput::All[i]] = | 54 | Settings::values.input_mappings[Settings::NativeInput::All[i]] = |
| 63 | sdl2_config->GetInteger("Controls", Settings::NativeInput::Mapping[i], defaults[i]); | 55 | sdl2_config->GetInteger("Controls", Settings::NativeInput::Mapping[i], defaults[i]); |
| 64 | } | 56 | } |
| 65 | Settings::values.pad_circle_modifier_scale = (float)sdl2_config->GetReal("Controls", "pad_circle_modifier_scale", 0.5); | 57 | Settings::values.pad_circle_modifier_scale = |
| 58 | (float)sdl2_config->GetReal("Controls", "pad_circle_modifier_scale", 0.5); | ||
| 66 | 59 | ||
| 67 | // Core | 60 | // Core |
| 68 | Settings::values.use_cpu_jit = sdl2_config->GetBoolean("Core", "use_cpu_jit", true); | 61 | Settings::values.use_cpu_jit = sdl2_config->GetBoolean("Core", "use_cpu_jit", true); |
| @@ -71,19 +64,22 @@ void Config::ReadValues() { | |||
| 71 | // Renderer | 64 | // Renderer |
| 72 | Settings::values.use_hw_renderer = sdl2_config->GetBoolean("Renderer", "use_hw_renderer", true); | 65 | Settings::values.use_hw_renderer = sdl2_config->GetBoolean("Renderer", "use_hw_renderer", true); |
| 73 | Settings::values.use_shader_jit = sdl2_config->GetBoolean("Renderer", "use_shader_jit", true); | 66 | Settings::values.use_shader_jit = sdl2_config->GetBoolean("Renderer", "use_shader_jit", true); |
| 74 | Settings::values.use_scaled_resolution = sdl2_config->GetBoolean("Renderer", "use_scaled_resolution", false); | 67 | Settings::values.use_scaled_resolution = |
| 68 | sdl2_config->GetBoolean("Renderer", "use_scaled_resolution", false); | ||
| 75 | Settings::values.use_vsync = sdl2_config->GetBoolean("Renderer", "use_vsync", false); | 69 | Settings::values.use_vsync = sdl2_config->GetBoolean("Renderer", "use_vsync", false); |
| 76 | 70 | ||
| 77 | Settings::values.bg_red = (float)sdl2_config->GetReal("Renderer", "bg_red", 1.0); | 71 | Settings::values.bg_red = (float)sdl2_config->GetReal("Renderer", "bg_red", 1.0); |
| 78 | Settings::values.bg_green = (float)sdl2_config->GetReal("Renderer", "bg_green", 1.0); | 72 | Settings::values.bg_green = (float)sdl2_config->GetReal("Renderer", "bg_green", 1.0); |
| 79 | Settings::values.bg_blue = (float)sdl2_config->GetReal("Renderer", "bg_blue", 1.0); | 73 | Settings::values.bg_blue = (float)sdl2_config->GetReal("Renderer", "bg_blue", 1.0); |
| 80 | 74 | ||
| 81 | // Audio | 75 | // Audio |
| 82 | Settings::values.sink_id = sdl2_config->Get("Audio", "output_engine", "auto"); | 76 | Settings::values.sink_id = sdl2_config->Get("Audio", "output_engine", "auto"); |
| 83 | Settings::values.enable_audio_stretching = sdl2_config->GetBoolean("Audio", "enable_audio_stretching", true); | 77 | Settings::values.enable_audio_stretching = |
| 78 | sdl2_config->GetBoolean("Audio", "enable_audio_stretching", true); | ||
| 84 | 79 | ||
| 85 | // Data Storage | 80 | // Data Storage |
| 86 | Settings::values.use_virtual_sd = sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true); | 81 | Settings::values.use_virtual_sd = |
| 82 | sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true); | ||
| 87 | 83 | ||
| 88 | // System | 84 | // System |
| 89 | Settings::values.is_new_3ds = sdl2_config->GetBoolean("System", "is_new_3ds", false); | 85 | Settings::values.is_new_3ds = sdl2_config->GetBoolean("System", "is_new_3ds", false); |
| @@ -94,7 +90,8 @@ void Config::ReadValues() { | |||
| 94 | 90 | ||
| 95 | // Debugging | 91 | // Debugging |
| 96 | Settings::values.use_gdbstub = sdl2_config->GetBoolean("Debugging", "use_gdbstub", false); | 92 | Settings::values.use_gdbstub = sdl2_config->GetBoolean("Debugging", "use_gdbstub", false); |
| 97 | Settings::values.gdbstub_port = static_cast<u16>(sdl2_config->GetInteger("Debugging", "gdbstub_port", 24689)); | 93 | Settings::values.gdbstub_port = |
| 94 | static_cast<u16>(sdl2_config->GetInteger("Debugging", "gdbstub_port", 24689)); | ||
| 98 | } | 95 | } |
| 99 | 96 | ||
| 100 | void Config::Reload() { | 97 | void Config::Reload() { |