all repos — mgba @ cece34380676778820b24981f9c79aaa92fa3026

mGBA Game Boy Advance Emulator

Qt: Fix aliasing on background logo (closes #1886)
Vicki Pfau vi@endrift.com
Wed, 14 Oct 2020 20:39:47 -0700
commit

cece34380676778820b24981f9c79aaa92fa3026

parent

e7f76e635b9e8f4873ddf16bfa9075d1e4c35355

3 files changed, 18 insertions(+), 12 deletions(-)

jump to
M CHANGESCHANGES

@@ -26,6 +26,7 @@ - Qt: Fix Battle Chip view not displaying chips on some DPI settings

- Qt: Fix camera image being upside-down sometimes (fixes mgba.io/i/829 again) - Qt: Fix drawing on macOS break when using OpenGL (fixes mgba.io/i/1899) - Qt: Fix stride changing when toggling SGB borders (fixes mgba.io/i/1898) + - Qt: Fix aliasing on background logo (fixes mgba.io/i/1886) - mGUI: Fix closing down a game if an exit is signalled - mVL: Fix injecting accidentally draining non-injection buffer - VFS: Fix directory node listing on some filesystems
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -137,10 +137,7 @@ resizeFrame(QSize(GBA_VIDEO_HORIZONTAL_PIXELS * i, GBA_VIDEO_VERTICAL_PIXELS * i));

#elif defined(M_CORE_GB) resizeFrame(QSize(GB_VIDEO_HORIZONTAL_PIXELS * i, GB_VIDEO_VERTICAL_PIXELS * i)); #endif - m_screenWidget->setPixmap(m_logo); - m_screenWidget->setDimensions(m_logo.width(), m_logo.height()); - m_screenWidget->setLockIntegerScaling(false); - m_screenWidget->setLockAspectRatio(true); + setLogo(); setCentralWidget(m_screenWidget); connect(this, &Window::shutdown, m_logView, &QWidget::hide);

@@ -259,7 +256,6 @@ if (m_display) {

m_display->lockAspectRatio(opts->lockAspectRatio); m_display->filter(opts->resampleVideo); } - m_screenWidget->filter(opts->resampleVideo); m_inputController.setScreensaverSuspendable(opts->suspendScreensaver); }

@@ -739,6 +735,7 @@ m_screenWidget->setDimensions(size.width(), size.height());

m_config->updateOption("lockIntegerScaling"); m_config->updateOption("lockAspectRatio"); m_config->updateOption("interframeBlending"); + m_config->updateOption("resampleVideo"); m_config->updateOption("showOSD"); if (m_savedScale > 0) { resizeFrame(size * m_savedScale);

@@ -807,11 +804,7 @@ action->setEnabled(false);

} setWindowFilePath(QString()); detachWidget(m_display.get()); - m_screenWidget->setDimensions(m_logo.width(), m_logo.height()); - m_screenWidget->setLockIntegerScaling(false); - m_screenWidget->setLockAspectRatio(true); - m_screenWidget->setPixmap(m_logo); - m_screenWidget->unsetCursor(); + setLogo(); if (m_display) { #ifdef M_CORE_GB m_display->setMinimumSize(GB_VIDEO_HORIZONTAL_PIXELS, GB_VIDEO_VERTICAL_PIXELS);

@@ -910,7 +903,6 @@ m_display->lockAspectRatio(opts->lockAspectRatio);

m_display->lockIntegerScaling(opts->lockIntegerScaling); m_display->interframeBlending(opts->interframeBlending); m_display->filter(opts->resampleVideo); - m_screenWidget->filter(opts->resampleVideo); m_config->updateOption("showOSD"); #if defined(BUILD_GL) || defined(BUILD_GLES2) if (opts->shader) {

@@ -1398,7 +1390,9 @@ resampleVideo->connect([this](const QVariant& value) {

if (m_display) { m_display->filter(value.toBool()); } - m_screenWidget->filter(value.toBool()); + if (m_controller) { + m_screenWidget->filter(value.toBool()); + } }, this); m_config->updateOption("resampleVideo");

@@ -1931,6 +1925,15 @@ if (m_pendingPause) {

m_controller->setPaused(true); m_pendingPause = false; } +} + +void Window::setLogo() { + m_screenWidget->setPixmap(m_logo); + m_screenWidget->setDimensions(m_logo.width(), m_logo.height()); + m_screenWidget->setLockIntegerScaling(false); + m_screenWidget->setLockAspectRatio(true); + m_screenWidget->filter(true); + m_screenWidget->unsetCursor(); } WindowBackground::WindowBackground(QWidget* parent)
M src/platform/qt/Window.hsrc/platform/qt/Window.h

@@ -140,6 +140,8 @@ void focusCheck();

void updateFrame(); + void setLogo(); + private: static const int FPS_TIMER_INTERVAL = 2000; static const int MUST_RESTART_TIMEOUT = 10000;