Qt: Fix undesired screen filtering when paused (fixes #1602)

This commit is contained in:
Vicki Pfau 2019-12-20 21:11:29 -08:00
parent b49f072c94
commit 814be50321
3 changed files with 11 additions and 1 deletions

View File

@ -103,6 +103,7 @@ Other fixes:
- Qt: Fix several cases where shader selections don't get saved - Qt: Fix several cases where shader selections don't get saved
- Qt: Fix division by zero error in invalid TilePainter state - Qt: Fix division by zero error in invalid TilePainter state
- Qt: Fix "restart needed" dialog after first config (fixes mgba.io/i/1601) - Qt: Fix "restart needed" dialog after first config (fixes mgba.io/i/1601)
- Qt: Fix undesired screen filtering when paused (fixes mgba.io/i/1602)
Misc: Misc:
- GB Memory: Support manual SRAM editing (fixes mgba.io/i/1580) - GB Memory: Support manual SRAM editing (fixes mgba.io/i/1580)
- SDL: Use controller GUID instead of name - SDL: Use controller GUID instead of name

View File

@ -259,6 +259,7 @@ void Window::reloadConfig() {
m_display->lockAspectRatio(opts->lockAspectRatio); m_display->lockAspectRatio(opts->lockAspectRatio);
m_display->filter(opts->resampleVideo); m_display->filter(opts->resampleVideo);
} }
m_screenWidget->filter(opts->resampleVideo);
m_inputController.setScreensaverSuspendable(opts->suspendScreensaver); m_inputController.setScreensaverSuspendable(opts->suspendScreensaver);
} }
@ -909,6 +910,7 @@ void Window::reloadDisplayDriver() {
m_display->lockIntegerScaling(opts->lockIntegerScaling); m_display->lockIntegerScaling(opts->lockIntegerScaling);
m_display->interframeBlending(opts->interframeBlending); m_display->interframeBlending(opts->interframeBlending);
m_display->filter(opts->resampleVideo); m_display->filter(opts->resampleVideo);
m_screenWidget->filter(opts->resampleVideo);
m_config->updateOption("showOSD"); m_config->updateOption("showOSD");
#if defined(BUILD_GL) || defined(BUILD_GLES2) #if defined(BUILD_GL) || defined(BUILD_GLES2)
if (opts->shader) { if (opts->shader) {
@ -1387,6 +1389,7 @@ void Window::setupMenu(QMenuBar* menubar) {
if (m_display) { if (m_display) {
m_display->filter(value.toBool()); m_display->filter(value.toBool());
} }
m_screenWidget->filter(value.toBool());
}, this); }, this);
m_config->updateOption("resampleVideo"); m_config->updateOption("resampleVideo");
@ -1948,11 +1951,15 @@ void WindowBackground::setLockAspectRatio(bool lock) {
m_lockAspectRatio = lock; m_lockAspectRatio = lock;
} }
void WindowBackground::filter(bool filter) {
m_filter = filter;
}
void WindowBackground::paintEvent(QPaintEvent* event) { void WindowBackground::paintEvent(QPaintEvent* event) {
QWidget::paintEvent(event); QWidget::paintEvent(event);
const QPixmap& logo = pixmap(); const QPixmap& logo = pixmap();
QPainter painter(this); QPainter painter(this);
painter.setRenderHint(QPainter::SmoothPixmapTransform); painter.setRenderHint(QPainter::SmoothPixmapTransform, m_filter);
painter.fillRect(QRect(QPoint(), size()), Qt::black); painter.fillRect(QRect(QPoint(), size()), Qt::black);
QSize s = size(); QSize s = size();
QSize ds = s; QSize ds = s;

View File

@ -245,6 +245,7 @@ public:
void setDimensions(int width, int height); void setDimensions(int width, int height);
void setLockIntegerScaling(bool lock); void setLockIntegerScaling(bool lock);
void setLockAspectRatio(bool lock); void setLockAspectRatio(bool lock);
void filter(bool filter);
const QPixmap& pixmap() const { return m_pixmap; } const QPixmap& pixmap() const { return m_pixmap; }
@ -258,6 +259,7 @@ private:
int m_aspectHeight; int m_aspectHeight;
bool m_lockAspectRatio; bool m_lockAspectRatio;
bool m_lockIntegerScaling; bool m_lockIntegerScaling;
bool m_filter;
}; };
} }