all repos — mgba @ 1055e325a0cbd83ac8286a9d9eedcf234bca94a8

mGBA Game Boy Advance Emulator

Qt: Fix patch loading while a game is running
Vicki Pfau vi@endrift.com
Sat, 08 Jul 2017 13:50:46 -0700
commit

1055e325a0cbd83ac8286a9d9eedcf234bca94a8

parent

2c30b661ffdbfafbef2a3e99a3112b3741ad1153

2 files changed, 10 insertions(+), 3 deletions(-)

jump to
M CHANGESCHANGES

@@ -164,6 +164,7 @@ - GB Video: Fix LYC regression

- Qt: Fix translation initialization (fixes mgba.io/i/776) - PSP2: Use custom localtime_r since newlib version is broken (fixes mgba.io/i/560) - GBA SIO: Improve SIO Normal dummy driver (fixes mgba.io/i/520) + - Qt: Fix patch loading while a game is running Misc: - Qt: Add language selector - GBA Timer: Improve accuracy of timers
M src/platform/qt/GameController.cppsrc/platform/qt/GameController.cpp

@@ -543,10 +543,16 @@ mCoreLoadFile(m_threadContext.core, m_fname.toLocal8Bit().constData());

} void GameController::loadPatch(const QString& path) { - if (m_gameOpen) { + if (isLoaded()) { closeGame(); - m_patch = path; - openGame(); + } + if (m_gameOpen) { + QTimer::singleShot(10, this, [this, path]() { + loadPatch(path); + if (!m_gameOpen) { + openGame(); + } + }); } else { m_patch = path; }