all repos — mgba @ 36c66e7db434bc3034ec172323cc7f0cd7e5c1ec

mGBA Game Boy Advance Emulator

Qt: Fix logo missing with integer scaling (fixes #696)
Vicki Pfau vi@endrift.com
Sat, 22 Apr 2017 18:29:10 -0700
commit

36c66e7db434bc3034ec172323cc7f0cd7e5c1ec

parent

3b4ccb84d26604b72746d56f3cddfea5b6e5ba2c

1 files changed, 6 insertions(+), 1 deletions(-)

jump to
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -135,6 +135,7 @@ m_screenWidget->setSizeHint(QSize(VIDEO_HORIZONTAL_PIXELS * i, VIDEO_VERTICAL_PIXELS * i));

#endif m_screenWidget->setPixmap(m_logo); m_screenWidget->setLockAspectRatio(m_logo.width(), m_logo.height()); + m_screenWidget->setLockIntegerScaling(false); setCentralWidget(m_screenWidget); connect(m_controller, SIGNAL(gameStarted(mCoreThread*, const QString&)), this, SLOT(gameStarted(mCoreThread*, const QString&)));

@@ -732,6 +733,7 @@ unsigned width, height;

context->core->desiredVideoDimensions(context->core, &width, &height); m_display->setMinimumSize(width, height); m_screenWidget->setMinimumSize(m_display->minimumSize()); + m_config->updateOption("lockIntegerScaling"); if (m_savedScale > 0) { resizeFrame(QSize(width, height) * m_savedScale); }

@@ -794,6 +796,7 @@ setWindowFilePath(QString());

updateTitle(); detachWidget(m_display); m_screenWidget->setLockAspectRatio(m_logo.width(), m_logo.height()); + m_screenWidget->setLockIntegerScaling(false); m_screenWidget->setPixmap(m_logo); m_screenWidget->unsetCursor(); #ifdef M_CORE_GB

@@ -1267,7 +1270,9 @@ ConfigOption* lockIntegerScaling = m_config->addOption("lockIntegerScaling");

lockIntegerScaling->addBoolean(tr("Force integer scaling"), avMenu); lockIntegerScaling->connect([this](const QVariant& value) { m_display->lockIntegerScaling(value.toBool()); - m_screenWidget->setLockIntegerScaling(value.toBool()); + if (m_controller->isLoaded()) { + m_screenWidget->setLockIntegerScaling(value.toBool()); + } }, this); m_config->updateOption("lockIntegerScaling");