From 43cf42490730d8a1b980aa1fe9ebbbe1249232ef Mon Sep 17 00:00:00 2001 From: bunnei Date: Wed, 29 Apr 2015 00:01:41 -0400 Subject: Qt: Use signals for emu_thread start/stop and fix disasm widget. --- src/citra_qt/bootmanager.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/citra_qt/bootmanager.h') diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h index e9b3ea66..e5752218 100644 --- a/src/citra_qt/bootmanager.h +++ b/src/citra_qt/bootmanager.h @@ -22,6 +22,7 @@ class EmuThread : public QThread Q_OBJECT public: + EmuThread(GRenderWindow* render_window); /** * Start emulation (on new thread) @@ -50,15 +51,14 @@ public: bool IsRunning() { return running; } /** - * Shutdown (permanently stops) the emulation thread + * Requests for the emulation thread to stop running and shutdown emulation */ - void Shutdown() { stop_run = true; }; + void RequestShutdown() { + stop_run = true; + running = false; + }; private: - friend class GMainWindow; - - EmuThread(GRenderWindow* render_window); - bool exec_step; bool running; std::atomic stop_run; @@ -86,7 +86,7 @@ class GRenderWindow : public QWidget, public EmuWindow Q_OBJECT public: - GRenderWindow(QWidget* parent, GMainWindow& main_window); + GRenderWindow(QWidget* parent, EmuThread* emu_thread); // EmuWindow implementation void SwapBuffers() override; @@ -115,6 +115,9 @@ public: public slots: void moveContext(); // overridden + void OnEmulationStarted(EmuThread* emu_thread); + void OnEmulationStopped(); + private: void OnMinimalClientAreaChangeRequest(const std::pair& minimal_size) override; @@ -122,8 +125,8 @@ private: QByteArray geometry; - GMainWindow& main_window; - /// Device id of keyboard for use with KeyMap int keyboard_id; + + EmuThread* emu_thread; }; -- cgit v1.2.3