summaryrefslogtreecommitdiffstats
path: root/src/citra
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra')
-rw-r--r--src/citra/config.cpp17
-rw-r--r--src/citra/config.h5
-rw-r--r--src/citra/emu_window/emu_window_glfw.cpp8
3 files changed, 13 insertions, 17 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&
return true;
}
-void Config::ReadControls() {
+void Config::ReadValues() {
+ // Controls
Settings::values.pad_a_key = glfw_config->GetInteger("Controls", "pad_a", GLFW_KEY_A);
Settings::values.pad_b_key = glfw_config->GetInteger("Controls", "pad_b", GLFW_KEY_S);
Settings::values.pad_x_key = glfw_config->GetInteger("Controls", "pad_x", GLFW_KEY_Z);
@@ -54,27 +55,21 @@ void Config::ReadControls() {
Settings::values.pad_sdown_key = glfw_config->GetInteger("Controls", "pad_sdown", GLFW_KEY_DOWN);
Settings::values.pad_sleft_key = glfw_config->GetInteger("Controls", "pad_sleft", GLFW_KEY_LEFT);
Settings::values.pad_sright_key = glfw_config->GetInteger("Controls", "pad_sright", GLFW_KEY_RIGHT);
-}
-void Config::ReadCore() {
+ // Core
Settings::values.cpu_core = glfw_config->GetInteger("Core", "cpu_core", Core::CPU_Interpreter);
Settings::values.gpu_refresh_rate = glfw_config->GetInteger("Core", "gpu_refresh_rate", 60);
-}
-void Config::ReadData() {
+ // Data Storage
Settings::values.use_virtual_sd = glfw_config->GetBoolean("Data Storage", "use_virtual_sd", true);
-}
-void Config::ReadMiscellaneous() {
+ // Miscellaneous
Settings::values.enable_log = glfw_config->GetBoolean("Miscellaneous", "enable_log", true);
}
void Config::Reload() {
LoadINI(glfw_config, glfw_config_loc.c_str(), DefaultINI::glfw_config_file);
- ReadControls();
- ReadCore();
- ReadData();
- ReadMiscellaneous();
+ ReadValues();
}
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 {
std::string glfw_config_loc;
bool LoadINI(INIReader* config, const char* location, const std::string& default_contents="", bool retry=true);
- void ReadControls();
- void ReadCore();
- void ReadData();
- void ReadMiscellaneous();
+ void ReadValues();
public:
Config();
~Config();
diff --git a/src/citra/emu_window/emu_window_glfw.cpp b/src/citra/emu_window/emu_window_glfw.cpp
index 8efb39e2e..697bf4693 100644
--- a/src/citra/emu_window/emu_window_glfw.cpp
+++ b/src/citra/emu_window/emu_window_glfw.cpp
@@ -58,9 +58,13 @@ EmuWindow_GLFW::EmuWindow_GLFW() {
ReloadSetKeymaps();
+ glfwSetErrorCallback([](int error, const char *desc){
+ ERROR_LOG(GUI, "GLFW 0x%08x: %s", error, desc);
+ });
+
// Initialize the window
if(glfwInit() != GL_TRUE) {
- printf("Failed to initialize GLFW! Exiting...");
+ ERROR_LOG(GUI, "Failed to initialize GLFW! Exiting...");
exit(1);
}
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
@@ -75,7 +79,7 @@ EmuWindow_GLFW::EmuWindow_GLFW() {
window_title.c_str(), NULL, NULL);
if (m_render_window == NULL) {
- printf("Failed to create GLFW window! Exiting...");
+ ERROR_LOG(GUI, "Failed to create GLFW window! Exiting...");
exit(1);
}