diff options
Diffstat (limited to '')
| -rw-r--r-- | src/citra/config.cpp | 17 | ||||
| -rw-r--r-- | src/citra/config.h | 5 | ||||
| -rw-r--r-- | src/citra_qt/config.cpp | 52 | ||||
| -rw-r--r-- | src/citra_qt/config.h | 11 |
4 files changed, 26 insertions, 59 deletions
diff --git a/src/citra/config.cpp b/src/citra/config.cpp index f45d09fc2..1f8f5922b 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp | |||
| @@ -36,7 +36,8 @@ bool Config::LoadINI(INIReader* config, const char* location, const std::string& | |||
| 36 | return true; | 36 | return true; |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | void Config::ReadControls() { | 39 | void Config::ReadValues() { |
| 40 | // Controls | ||
| 40 | Settings::values.pad_a_key = glfw_config->GetInteger("Controls", "pad_a", GLFW_KEY_A); | 41 | Settings::values.pad_a_key = glfw_config->GetInteger("Controls", "pad_a", GLFW_KEY_A); |
| 41 | Settings::values.pad_b_key = glfw_config->GetInteger("Controls", "pad_b", GLFW_KEY_S); | 42 | Settings::values.pad_b_key = glfw_config->GetInteger("Controls", "pad_b", GLFW_KEY_S); |
| 42 | Settings::values.pad_x_key = glfw_config->GetInteger("Controls", "pad_x", GLFW_KEY_Z); | 43 | Settings::values.pad_x_key = glfw_config->GetInteger("Controls", "pad_x", GLFW_KEY_Z); |
| @@ -54,27 +55,21 @@ void Config::ReadControls() { | |||
| 54 | Settings::values.pad_sdown_key = glfw_config->GetInteger("Controls", "pad_sdown", GLFW_KEY_DOWN); | 55 | Settings::values.pad_sdown_key = glfw_config->GetInteger("Controls", "pad_sdown", GLFW_KEY_DOWN); |
| 55 | Settings::values.pad_sleft_key = glfw_config->GetInteger("Controls", "pad_sleft", GLFW_KEY_LEFT); | 56 | Settings::values.pad_sleft_key = glfw_config->GetInteger("Controls", "pad_sleft", GLFW_KEY_LEFT); |
| 56 | Settings::values.pad_sright_key = glfw_config->GetInteger("Controls", "pad_sright", GLFW_KEY_RIGHT); | 57 | Settings::values.pad_sright_key = glfw_config->GetInteger("Controls", "pad_sright", GLFW_KEY_RIGHT); |
| 57 | } | ||
| 58 | 58 | ||
| 59 | void Config::ReadCore() { | 59 | // Core |
| 60 | Settings::values.cpu_core = glfw_config->GetInteger("Core", "cpu_core", Core::CPU_Interpreter); | 60 | Settings::values.cpu_core = glfw_config->GetInteger("Core", "cpu_core", Core::CPU_Interpreter); |
| 61 | Settings::values.gpu_refresh_rate = glfw_config->GetInteger("Core", "gpu_refresh_rate", 60); | 61 | Settings::values.gpu_refresh_rate = glfw_config->GetInteger("Core", "gpu_refresh_rate", 60); |
| 62 | } | ||
| 63 | 62 | ||
| 64 | void Config::ReadData() { | 63 | // Data Storage |
| 65 | Settings::values.use_virtual_sd = glfw_config->GetBoolean("Data Storage", "use_virtual_sd", true); | 64 | Settings::values.use_virtual_sd = glfw_config->GetBoolean("Data Storage", "use_virtual_sd", true); |
| 66 | } | ||
| 67 | 65 | ||
| 68 | void Config::ReadMiscellaneous() { | 66 | // Miscellaneous |
| 69 | Settings::values.enable_log = glfw_config->GetBoolean("Miscellaneous", "enable_log", true); | 67 | Settings::values.enable_log = glfw_config->GetBoolean("Miscellaneous", "enable_log", true); |
| 70 | } | 68 | } |
| 71 | 69 | ||
| 72 | void Config::Reload() { | 70 | void Config::Reload() { |
| 73 | LoadINI(glfw_config, glfw_config_loc.c_str(), DefaultINI::glfw_config_file); | 71 | LoadINI(glfw_config, glfw_config_loc.c_str(), DefaultINI::glfw_config_file); |
| 74 | ReadControls(); | 72 | ReadValues(); |
| 75 | ReadCore(); | ||
| 76 | ReadData(); | ||
| 77 | ReadMiscellaneous(); | ||
| 78 | } | 73 | } |
| 79 | 74 | ||
| 80 | Config::~Config() { | 75 | Config::~Config() { |
diff --git a/src/citra/config.h b/src/citra/config.h index 19bb83700..2b46fa8aa 100644 --- a/src/citra/config.h +++ b/src/citra/config.h | |||
| @@ -15,10 +15,7 @@ class Config { | |||
| 15 | std::string glfw_config_loc; | 15 | std::string glfw_config_loc; |
| 16 | 16 | ||
| 17 | bool LoadINI(INIReader* config, const char* location, const std::string& default_contents="", bool retry=true); | 17 | bool LoadINI(INIReader* config, const char* location, const std::string& default_contents="", bool retry=true); |
| 18 | void ReadControls(); | 18 | void ReadValues(); |
| 19 | void ReadCore(); | ||
| 20 | void ReadData(); | ||
| 21 | void ReadMiscellaneous(); | ||
| 22 | public: | 19 | public: |
| 23 | Config(); | 20 | Config(); |
| 24 | ~Config(); | 21 | ~Config(); |
diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index 09fce4d6f..3209e5900 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp | |||
| @@ -21,7 +21,7 @@ Config::Config() { | |||
| 21 | Reload(); | 21 | Reload(); |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | void Config::ReadControls() { | 24 | void Config::ReadValues() { |
| 25 | qt_config->beginGroup("Controls"); | 25 | qt_config->beginGroup("Controls"); |
| 26 | Settings::values.pad_a_key = qt_config->value("pad_a", Qt::Key_A).toInt(); | 26 | Settings::values.pad_a_key = qt_config->value("pad_a", Qt::Key_A).toInt(); |
| 27 | Settings::values.pad_b_key = qt_config->value("pad_b", Qt::Key_S).toInt(); | 27 | Settings::values.pad_b_key = qt_config->value("pad_b", Qt::Key_S).toInt(); |
| @@ -41,9 +41,22 @@ void Config::ReadControls() { | |||
| 41 | Settings::values.pad_sleft_key = qt_config->value("pad_sleft", Qt::Key_Left).toInt(); | 41 | Settings::values.pad_sleft_key = qt_config->value("pad_sleft", Qt::Key_Left).toInt(); |
| 42 | Settings::values.pad_sright_key = qt_config->value("pad_sright", Qt::Key_Right).toInt(); | 42 | Settings::values.pad_sright_key = qt_config->value("pad_sright", Qt::Key_Right).toInt(); |
| 43 | qt_config->endGroup(); | 43 | qt_config->endGroup(); |
| 44 | |||
| 45 | qt_config->beginGroup("Core"); | ||
| 46 | Settings::values.cpu_core = qt_config->value("cpu_core", Core::CPU_Interpreter).toInt(); | ||
| 47 | Settings::values.gpu_refresh_rate = qt_config->value("gpu_refresh_rate", 60).toInt(); | ||
| 48 | qt_config->endGroup(); | ||
| 49 | |||
| 50 | qt_config->beginGroup("Data Storage"); | ||
| 51 | Settings::values.use_virtual_sd = qt_config->value("use_virtual_sd", true).toBool(); | ||
| 52 | qt_config->endGroup(); | ||
| 53 | |||
| 54 | qt_config->beginGroup("Miscellaneous"); | ||
| 55 | Settings::values.enable_log = qt_config->value("enable_log", true).toBool(); | ||
| 56 | qt_config->endGroup(); | ||
| 44 | } | 57 | } |
| 45 | 58 | ||
| 46 | void Config::SaveControls() { | 59 | void Config::SaveValues() { |
| 47 | qt_config->beginGroup("Controls"); | 60 | qt_config->beginGroup("Controls"); |
| 48 | qt_config->setValue("pad_a", Settings::values.pad_a_key); | 61 | qt_config->setValue("pad_a", Settings::values.pad_a_key); |
| 49 | qt_config->setValue("pad_b", Settings::values.pad_b_key); | 62 | qt_config->setValue("pad_b", Settings::values.pad_b_key); |
| @@ -63,58 +76,27 @@ void Config::SaveControls() { | |||
| 63 | qt_config->setValue("pad_sleft", Settings::values.pad_sleft_key); | 76 | qt_config->setValue("pad_sleft", Settings::values.pad_sleft_key); |
| 64 | qt_config->setValue("pad_sright", Settings::values.pad_sright_key); | 77 | qt_config->setValue("pad_sright", Settings::values.pad_sright_key); |
| 65 | qt_config->endGroup(); | 78 | qt_config->endGroup(); |
| 66 | } | ||
| 67 | |||
| 68 | void Config::ReadCore() { | ||
| 69 | qt_config->beginGroup("Core"); | ||
| 70 | Settings::values.cpu_core = qt_config->value("cpu_core", Core::CPU_Interpreter).toInt(); | ||
| 71 | Settings::values.gpu_refresh_rate = qt_config->value("gpu_refresh_rate", 60).toInt(); | ||
| 72 | qt_config->endGroup(); | ||
| 73 | } | ||
| 74 | 79 | ||
| 75 | void Config::SaveCore() { | ||
| 76 | qt_config->beginGroup("Core"); | 80 | qt_config->beginGroup("Core"); |
| 77 | qt_config->setValue("cpu_core", Settings::values.cpu_core); | 81 | qt_config->setValue("cpu_core", Settings::values.cpu_core); |
| 78 | qt_config->setValue("gpu_refresh_rate", Settings::values.gpu_refresh_rate); | 82 | qt_config->setValue("gpu_refresh_rate", Settings::values.gpu_refresh_rate); |
| 79 | qt_config->endGroup(); | 83 | qt_config->endGroup(); |
| 80 | } | ||
| 81 | |||
| 82 | void Config::ReadData() { | ||
| 83 | qt_config->beginGroup("Data Storage"); | ||
| 84 | Settings::values.use_virtual_sd = qt_config->value("use_virtual_sd", true).toBool(); | ||
| 85 | qt_config->endGroup(); | ||
| 86 | } | ||
| 87 | 84 | ||
| 88 | void Config::SaveData() { | ||
| 89 | qt_config->beginGroup("Data Storage"); | 85 | qt_config->beginGroup("Data Storage"); |
| 90 | qt_config->setValue("use_virtual_sd", Settings::values.use_virtual_sd); | 86 | qt_config->setValue("use_virtual_sd", Settings::values.use_virtual_sd); |
| 91 | qt_config->endGroup(); | 87 | qt_config->endGroup(); |
| 92 | } | ||
| 93 | |||
| 94 | void Config::ReadMiscellaneous() { | ||
| 95 | qt_config->beginGroup("Miscellaneous"); | ||
| 96 | Settings::values.enable_log = qt_config->value("enable_log", true).toBool(); | ||
| 97 | qt_config->endGroup(); | ||
| 98 | } | ||
| 99 | 88 | ||
| 100 | void Config::SaveMiscellaneous() { | ||
| 101 | qt_config->beginGroup("Miscellaneous"); | 89 | qt_config->beginGroup("Miscellaneous"); |
| 102 | qt_config->setValue("enable_log", Settings::values.enable_log); | 90 | qt_config->setValue("enable_log", Settings::values.enable_log); |
| 103 | qt_config->endGroup(); | 91 | qt_config->endGroup(); |
| 104 | } | 92 | } |
| 105 | 93 | ||
| 106 | void Config::Reload() { | 94 | void Config::Reload() { |
| 107 | ReadControls(); | 95 | ReadValues(); |
| 108 | ReadCore(); | ||
| 109 | ReadData(); | ||
| 110 | ReadMiscellaneous(); | ||
| 111 | } | 96 | } |
| 112 | 97 | ||
| 113 | void Config::Save() { | 98 | void Config::Save() { |
| 114 | SaveControls(); | 99 | SaveValues(); |
| 115 | SaveCore(); | ||
| 116 | SaveData(); | ||
| 117 | SaveMiscellaneous(); | ||
| 118 | } | 100 | } |
| 119 | 101 | ||
| 120 | Config::~Config() { | 102 | Config::~Config() { |
diff --git a/src/citra_qt/config.h b/src/citra_qt/config.h index 8c6568cb2..4c95d0cb9 100644 --- a/src/citra_qt/config.h +++ b/src/citra_qt/config.h | |||
| @@ -12,15 +12,8 @@ class Config { | |||
| 12 | QSettings* qt_config; | 12 | QSettings* qt_config; |
| 13 | std::string qt_config_loc; | 13 | std::string qt_config_loc; |
| 14 | 14 | ||
| 15 | void ReadControls(); | 15 | void ReadValues(); |
| 16 | void SaveControls(); | 16 | void SaveValues(); |
| 17 | void ReadCore(); | ||
| 18 | void SaveCore(); | ||
| 19 | void ReadData(); | ||
| 20 | void SaveData(); | ||
| 21 | |||
| 22 | void ReadMiscellaneous(); | ||
| 23 | void SaveMiscellaneous(); | ||
| 24 | public: | 17 | public: |
| 25 | Config(); | 18 | Config(); |
| 26 | ~Config(); | 19 | ~Config(); |