diff options
Diffstat (limited to 'src/citra')
-rw-r--r-- | src/citra/citra.cpp | 2 | ||||
-rw-r--r-- | src/citra/config.cpp | 5 | ||||
-rw-r--r-- | src/citra/config.h | 1 | ||||
-rw-r--r-- | src/citra/default_ini.h | 3 | ||||
-rw-r--r-- | src/citra/emu_window/emu_window_glfw.cpp | 5 | ||||
-rw-r--r-- | src/citra/emu_window/emu_window_glfw.h | 11 |
6 files changed, 22 insertions, 5 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index 46781def..6ac5c5dc 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -34,7 +34,7 @@ int __cdecl main(int argc, char **argv) { return -1; } - while(true) { + while (emu_window->IsOpen()) { Core::RunLoop(); } diff --git a/src/citra/config.cpp b/src/citra/config.cpp index 1d5e9c71..03a0ce60 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -55,9 +55,14 @@ void Config::ReadControls() { Settings::values.pad_sright_key = glfw_config->GetInteger("Controls", "pad_sright", GLFW_KEY_RIGHT); } +void Config::ReadData() { + Settings::values.use_virtual_sd = glfw_config->GetBoolean("Data Storage", "use_virtual_sd", true); +} + void Config::Reload() { LoadINI(glfw_config, glfw_config_loc.c_str(), DefaultINI::glfw_config_file); ReadControls(); + ReadData(); } Config::~Config() { diff --git a/src/citra/config.h b/src/citra/config.h index de0570b4..c4fac245 100644 --- a/src/citra/config.h +++ b/src/citra/config.h @@ -16,6 +16,7 @@ class Config { bool LoadINI(INIReader* config, const char* location, const std::string& default_contents="", bool retry=true); void ReadControls(); + void ReadData(); public: Config(); ~Config(); diff --git a/src/citra/default_ini.h b/src/citra/default_ini.h index 11b985e1..e7e45f4a 100644 --- a/src/citra/default_ini.h +++ b/src/citra/default_ini.h @@ -25,6 +25,9 @@ pad_sup = pad_sdown = pad_sleft = pad_sright = + +[Data Storage] +use_virtual_sd = )"; } diff --git a/src/citra/emu_window/emu_window_glfw.cpp b/src/citra/emu_window/emu_window_glfw.cpp index 6cdba2b8..0c774bbc 100644 --- a/src/citra/emu_window/emu_window_glfw.cpp +++ b/src/citra/emu_window/emu_window_glfw.cpp @@ -29,6 +29,11 @@ void EmuWindow_GLFW::OnKeyEvent(GLFWwindow* win, int key, int scancode, int acti HID_User::PadUpdateComplete(); } +/// Whether the window is still open, and a close request hasn't yet been sent +const bool EmuWindow_GLFW::IsOpen() { + return glfwWindowShouldClose(m_render_window) == 0; +} + /// EmuWindow_GLFW constructor EmuWindow_GLFW::EmuWindow_GLFW() { keyboard_id = KeyMap::NewDeviceId(); diff --git a/src/citra/emu_window/emu_window_glfw.h b/src/citra/emu_window/emu_window_glfw.h index d38a11c2..7c307214 100644 --- a/src/citra/emu_window/emu_window_glfw.h +++ b/src/citra/emu_window/emu_window_glfw.h @@ -14,19 +14,22 @@ public: ~EmuWindow_GLFW(); /// Swap buffers to display the next frame - void SwapBuffers(); + void SwapBuffers() override; /// Polls window events - void PollEvents(); + void PollEvents() override; /// Makes the graphics context current for the caller thread - void MakeCurrent(); + void MakeCurrent() override; /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread - void DoneCurrent(); + void DoneCurrent() override; static void OnKeyEvent(GLFWwindow* win, int key, int scancode, int action, int mods); + /// Whether the window is still open, and a close request hasn't yet been sent + const bool IsOpen(); + void ReloadSetKeymaps() override; private: |