diff options
author | bunnei <bunneidev@gmail.com> | 2015-04-29 06:01:41 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-05-02 00:34:42 +0200 |
commit | 43cf42490730d8a1b980aa1fe9ebbbe1249232ef (patch) | |
tree | bdaa812eed455d85517130934e4cf17bd56c6d0b /src/citra_qt/bootmanager.cpp | |
parent | Qt: Restructured to remove unnecessary shutdown event and various cleanups. (diff) | |
download | yuzu-43cf42490730d8a1b980aa1fe9ebbbe1249232ef.tar yuzu-43cf42490730d8a1b980aa1fe9ebbbe1249232ef.tar.gz yuzu-43cf42490730d8a1b980aa1fe9ebbbe1249232ef.tar.bz2 yuzu-43cf42490730d8a1b980aa1fe9ebbbe1249232ef.tar.lz yuzu-43cf42490730d8a1b980aa1fe9ebbbe1249232ef.tar.xz yuzu-43cf42490730d8a1b980aa1fe9ebbbe1249232ef.tar.zst yuzu-43cf42490730d8a1b980aa1fe9ebbbe1249232ef.zip |
Diffstat (limited to '')
-rw-r--r-- | src/citra_qt/bootmanager.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 1e902a8b6..4be410fe0 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -87,8 +87,8 @@ private: GRenderWindow* parent; }; -GRenderWindow::GRenderWindow(QWidget* parent, GMainWindow& main_window) : - QWidget(parent), main_window(main_window), keyboard_id(0) { +GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread) : + QWidget(parent), emu_thread(emu_thread), keyboard_id(0) { std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc); setWindowTitle(QString::fromStdString(window_title)); @@ -129,7 +129,7 @@ void GRenderWindow::moveContext() // We need to move GL context to the swapping thread in Qt5 #if QT_VERSION > QT_VERSION_CHECK(5, 0, 0) // If the thread started running, move the GL Context to the new thread. Otherwise, move it back. - auto thread = QThread::currentThread() == qApp->thread() ? main_window.GetEmuThread() : qApp->thread(); + auto thread = (QThread::currentThread() == qApp->thread() && emu_thread != nullptr) ? emu_thread : qApp->thread(); child->context()->moveToThread(thread); #endif } @@ -272,3 +272,11 @@ void GRenderWindow::OnClientAreaResized(unsigned width, unsigned height) void GRenderWindow::OnMinimalClientAreaChangeRequest(const std::pair<unsigned,unsigned>& minimal_size) { setMinimumSize(minimal_size.first, minimal_size.second); } + +void GRenderWindow::OnEmulationStarted(EmuThread* emu_thread) { + this->emu_thread = emu_thread; +} + +void GRenderWindow::OnEmulationStopped() { + emu_thread = nullptr; +} |