mGUI: Add fast forward toggle
Vicki Pfau vi@endrift.com
Wed, 19 Sep 2018 19:20:15 -0700
3 files changed,
10 insertions(+),
3 deletions(-)
M
CHANGES
→
CHANGES
@@ -91,6 +91,7 @@ - Wii: Move audio handling to callbacks (fixes mgba.io/i/803)
- Qt: Clean up FPS target UI (fixes mgba.io/i/436) - Core: Remove broken option for whether rewinding restores save games - FFmpeg: Support lossless VP9 encoding + - mGUI: Add fast forward toggle 0.6.3: (2017-04-14) Bugfixes:
M
src/feature/gui/gui-runner.c
→
src/feature/gui/gui-runner.c
@@ -54,7 +54,8 @@ [mGUI_INPUT_INCREASE_BRIGHTNESS] = "Increase solar brightness",
[mGUI_INPUT_DECREASE_BRIGHTNESS] = "Decrease solar brightness", [mGUI_INPUT_SCREEN_MODE] = "Screen mode", [mGUI_INPUT_SCREENSHOT] = "Take screenshot", - [mGUI_INPUT_FAST_FORWARD] = "Fast forward", + [mGUI_INPUT_FAST_FORWARD_HELD] = "Fast forward (held)", + [mGUI_INPUT_FAST_FORWARD_TOGGLE] = "Fast forward (toggle)", }, .nKeys = GUI_INPUT_MAX };@@ -412,6 +413,7 @@ gettimeofday(&tv, 0);
runner->lastFpsCheck = 1000000LL * tv.tv_sec + tv.tv_usec; int frame = 0; + bool fastForward = false; while (running) { if (runner->running) { running = runner->running(runner);@@ -442,7 +444,10 @@ if (guiKeys & (1 << mGUI_INPUT_SCREENSHOT)) {
mCoreTakeScreenshot(runner->core); } if (runner->setFrameLimiter) { - if (heldKeys & (1 << mGUI_INPUT_FAST_FORWARD)) { + if (guiKeys & (1 << mGUI_INPUT_FAST_FORWARD_TOGGLE)) { + fastForward = !fastForward; + } + if (fastForward || (heldKeys & (1 << mGUI_INPUT_FAST_FORWARD_HELD))) { runner->setFrameLimiter(runner, false); } else { runner->setFrameLimiter(runner, true);
M
src/feature/gui/gui-runner.h
→
src/feature/gui/gui-runner.h
@@ -22,7 +22,8 @@ mGUI_INPUT_INCREASE_BRIGHTNESS = GUI_INPUT_USER_START,
mGUI_INPUT_DECREASE_BRIGHTNESS, mGUI_INPUT_SCREEN_MODE, mGUI_INPUT_SCREENSHOT, - mGUI_INPUT_FAST_FORWARD, + mGUI_INPUT_FAST_FORWARD_HELD, + mGUI_INPUT_FAST_FORWARD_TOGGLE }; struct mGUIBackground {