mirror of https://github.com/mgba-emu/mgba.git
Qt: Move screenshot to GameController
This commit is contained in:
parent
0d6cc88f9f
commit
11eab66247
|
@ -26,9 +26,6 @@ public slots:
|
||||||
virtual void forceDraw() = 0;
|
virtual void forceDraw() = 0;
|
||||||
virtual void lockAspectRatio(bool lock) = 0;
|
virtual void lockAspectRatio(bool lock) = 0;
|
||||||
virtual void filter(bool filter) = 0;
|
virtual void filter(bool filter) = 0;
|
||||||
#ifdef USE_PNG
|
|
||||||
virtual void screenshot() = 0;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,14 +117,6 @@ void DisplayGL::filter(bool filter) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_PNG
|
|
||||||
void DisplayGL::screenshot() {
|
|
||||||
GBAThreadInterrupt(m_context);
|
|
||||||
GBAThreadTakeScreenshot(m_context);
|
|
||||||
GBAThreadContinue(m_context);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void DisplayGL::resizeEvent(QResizeEvent* event) {
|
void DisplayGL::resizeEvent(QResizeEvent* event) {
|
||||||
m_painter->resize(event->size());
|
m_painter->resize(event->size());
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,9 +31,6 @@ public slots:
|
||||||
void forceDraw();
|
void forceDraw();
|
||||||
void lockAspectRatio(bool lock);
|
void lockAspectRatio(bool lock);
|
||||||
void filter(bool filter);
|
void filter(bool filter);
|
||||||
#ifdef USE_PNG
|
|
||||||
void screenshot();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void paintEvent(QPaintEvent*) override {};
|
virtual void paintEvent(QPaintEvent*) override {};
|
||||||
|
|
|
@ -520,6 +520,14 @@ void GameController::clearAVStream() {
|
||||||
threadContinue();
|
threadContinue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_PNG
|
||||||
|
void GameController::screenshot() {
|
||||||
|
GBAThreadInterrupt(&m_threadContext);
|
||||||
|
GBAThreadTakeScreenshot(&m_threadContext);
|
||||||
|
GBAThreadContinue(&m_threadContext);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void GameController::reloadAudioDriver() {
|
void GameController::reloadAudioDriver() {
|
||||||
QMetaObject::invokeMethod(m_audioProcessor, "pause", Qt::BlockingQueuedConnection);
|
QMetaObject::invokeMethod(m_audioProcessor, "pause", Qt::BlockingQueuedConnection);
|
||||||
int samples = m_audioProcessor->getBufferSamples();
|
int samples = m_audioProcessor->getBufferSamples();
|
||||||
|
|
|
@ -119,6 +119,10 @@ public slots:
|
||||||
void clearAVStream();
|
void clearAVStream();
|
||||||
void reloadAudioDriver();
|
void reloadAudioDriver();
|
||||||
|
|
||||||
|
#ifdef USE_PNG
|
||||||
|
void screenshot();
|
||||||
|
#endif
|
||||||
|
|
||||||
void setLuminanceValue(uint8_t value);
|
void setLuminanceValue(uint8_t value);
|
||||||
uint8_t luminanceValue() const { return m_luxValue; }
|
uint8_t luminanceValue() const { return m_luxValue; }
|
||||||
void setLuminanceLevel(int level);
|
void setLuminanceLevel(int level);
|
||||||
|
|
|
@ -738,7 +738,7 @@ void Window::setupMenu(QMenuBar* menubar) {
|
||||||
#ifdef USE_PNG
|
#ifdef USE_PNG
|
||||||
QAction* screenshot = new QAction(tr("Take &screenshot"), avMenu);
|
QAction* screenshot = new QAction(tr("Take &screenshot"), avMenu);
|
||||||
screenshot->setShortcut(tr("F12"));
|
screenshot->setShortcut(tr("F12"));
|
||||||
connect(screenshot, SIGNAL(triggered()), m_display, SLOT(screenshot()));
|
connect(screenshot, SIGNAL(triggered()), m_controller, SLOT(screenshot()));
|
||||||
m_gameActions.append(screenshot);
|
m_gameActions.append(screenshot);
|
||||||
addControlledAction(avMenu, screenshot, "screenshot");
|
addControlledAction(avMenu, screenshot, "screenshot");
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue