Qt: Move screenshot to GameController
Jeffrey Pfau jeffrey@endrift.com
Tue, 31 Mar 2015 23:43:47 -0700
6 files changed,
13 insertions(+),
15 deletions(-)
M
src/platform/qt/Display.h
→
src/platform/qt/Display.h
@@ -26,9 +26,6 @@ virtual void unpauseDrawing() = 0;
virtual void forceDraw() = 0; virtual void lockAspectRatio(bool lock) = 0; virtual void filter(bool filter) = 0; -#ifdef USE_PNG - virtual void screenshot() = 0; -#endif }; }
M
src/platform/qt/DisplayGL.cpp
→
src/platform/qt/DisplayGL.cpp
@@ -117,14 +117,6 @@ m_painter->filter(filter);
} } -#ifdef USE_PNG -void DisplayGL::screenshot() { - GBAThreadInterrupt(m_context); - GBAThreadTakeScreenshot(m_context); - GBAThreadContinue(m_context); -} -#endif - void DisplayGL::resizeEvent(QResizeEvent* event) { m_painter->resize(event->size()); }
M
src/platform/qt/DisplayGL.h
→
src/platform/qt/DisplayGL.h
@@ -31,9 +31,6 @@ void unpauseDrawing();
void forceDraw(); void lockAspectRatio(bool lock); void filter(bool filter); -#ifdef USE_PNG - void screenshot(); -#endif protected: virtual void paintEvent(QPaintEvent*) override {};
M
src/platform/qt/GameController.cpp
→
src/platform/qt/GameController.cpp
@@ -520,6 +520,14 @@ m_threadContext.stream = nullptr;
threadContinue(); } +#ifdef USE_PNG +void GameController::screenshot() { + GBAThreadInterrupt(&m_threadContext); + GBAThreadTakeScreenshot(&m_threadContext); + GBAThreadContinue(&m_threadContext); +} +#endif + void GameController::reloadAudioDriver() { QMetaObject::invokeMethod(m_audioProcessor, "pause", Qt::BlockingQueuedConnection); int samples = m_audioProcessor->getBufferSamples();
M
src/platform/qt/GameController.h
→
src/platform/qt/GameController.h
@@ -119,6 +119,10 @@ void setAVStream(GBAAVStream*);
void clearAVStream(); void reloadAudioDriver(); +#ifdef USE_PNG + void screenshot(); +#endif + void setLuminanceValue(uint8_t value); uint8_t luminanceValue() const { return m_luxValue; } void setLuminanceLevel(int level);
M
src/platform/qt/Window.cpp
→
src/platform/qt/Window.cpp
@@ -738,7 +738,7 @@
#ifdef USE_PNG QAction* screenshot = new QAction(tr("Take &screenshot"), avMenu); screenshot->setShortcut(tr("F12")); - connect(screenshot, SIGNAL(triggered()), m_display, SLOT(screenshot())); + connect(screenshot, SIGNAL(triggered()), m_controller, SLOT(screenshot())); m_gameActions.append(screenshot); addControlledAction(avMenu, screenshot, "screenshot"); #endif