Moving shutdown logic to Emulator.
This commit is contained in:
parent
991e7d8ad3
commit
2a7f3de1c3
|
@ -145,6 +145,16 @@ XECLEANUP:
|
|||
return result;
|
||||
}
|
||||
|
||||
void Emulator::set_main_window(Window* window) {
|
||||
XEASSERTNULL(main_window_);
|
||||
main_window_ = window;
|
||||
|
||||
window->closed.AddListener([](UIEvent& e) {
|
||||
// TODO(benvanik): call module API to kill? this is a bad shutdown.
|
||||
exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
X_STATUS Emulator::LaunchXexFile(const xechar_t* path) {
|
||||
// We create a virtual filesystem pointing to its directory and symlink
|
||||
// that to the game filesystem.
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
const xechar_t* command_line() const { return command_line_; }
|
||||
|
||||
ui::Window* main_window() const { return main_window_; }
|
||||
void set_main_window(ui::Window* window) { main_window_ = window; }
|
||||
void set_main_window(ui::Window* window);
|
||||
|
||||
Memory* memory() const { return memory_; }
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ D3D11Window::D3D11Window(
|
|||
swap_chain_ = 0;
|
||||
render_target_view_ = 0;
|
||||
|
||||
// TODO(benvanik): move to emulator main window setter.
|
||||
closing.AddListener([](UIEvent& e) {
|
||||
xe_run_loop_quit(e.window()->run_loop());
|
||||
});
|
||||
|
|
|
@ -92,9 +92,6 @@ void GraphicsSystem::ThreadStart() {
|
|||
running_ = false;
|
||||
|
||||
xe_run_loop_release(run_loop);
|
||||
|
||||
// TODO(benvanik): call module API to kill? this is a bad shutdown.
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void GraphicsSystem::Initialize() {
|
||||
|
|
Loading…
Reference in New Issue