Qt: Fix stride changing when toggling SGB borders (fixes #1898)
Vicki Pfau vi@endrift.com
Sun, 11 Oct 2020 22:44:26 -0700
2 files changed,
13 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -73,6 +73,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: Load/save bytes from memory viewer in the order visible (fixes mgba.io/i/1900) + - Qt: Fix stride changing when toggling SGB borders (fixes mgba.io/i/1898) - mGUI: Fix closing down a game if an exit is signalled - mVL: Fix injecting accidentally draining non-injection buffer - SM83: Simplify register pair access on big endian
M
src/platform/qt/CoreController.cpp
→
src/platform/qt/CoreController.cpp
@@ -263,10 +263,22 @@ m_fastForwardVolume = config->getOption("fastForwardVolume", -1).toInt();
m_fastForwardMute = config->getOption("fastForwardMute", -1).toInt(); mCoreConfigCopyValue(&m_threadContext.core->config, config->config(), "volume"); mCoreConfigCopyValue(&m_threadContext.core->config, config->config(), "mute"); + + QSize sizeBefore = screenDimensions(); mCoreLoadForeignConfig(m_threadContext.core, config->config()); + QSize sizeAfter = screenDimensions(); if (hasStarted()) { updateFastForward(); mCoreThreadRewindParamsChanged(&m_threadContext); + } + if (sizeBefore != sizeAfter) { + m_threadContext.core->setVideoBuffer(m_threadContext.core, reinterpret_cast<color_t*>(m_activeBuffer.data()), sizeAfter.width()); +#ifdef M_CORE_GB + mCoreConfigSetIntValue(&m_threadContext.core->config, "sgb.borders", 0); + m_threadContext.core->reloadConfigOption(m_threadContext.core, "sgb.borders", nullptr); + mCoreConfigCopyValue(&m_threadContext.core->config, config->config(), "sgb.borders"); + m_threadContext.core->reloadConfigOption(m_threadContext.core, "sgb.borders", nullptr); +#endif } }