GBA Context: Callbacks when pausing and unpausing, for audio
Jeffrey Pfau jeffrey@endrift.com
Wed, 02 Sep 2015 23:15:36 -0700
4 files changed,
12 insertions(+),
0 deletions(-)
M
src/gba/gui/gui-runner.c
→
src/gba/gui/gui-runner.c
@@ -184,6 +184,9 @@ runner->params.drawEnd();
} } + if (runner->paused) { + runner->paused(runner); + } GUIInvalidateKeys(&runner->params); uint32_t keys = 0xFFFFFFFF; // Huge hack to avoid an extra variable! struct GUIMenuItem item;@@ -218,6 +221,9 @@ GUIPollInput(&runner->params, 0, &keys);
} if (runner->params.guiFinish) { runner->params.guiFinish(); + } + if (runner->unpaused) { + runner->unpaused(runner); } } GBAContextStop(&runner->context);
M
src/gba/gui/gui-runner.h
→
src/gba/gui/gui-runner.h
@@ -37,6 +37,8 @@ void (*gameLoaded)(struct GBAGUIRunner*);
void (*gameUnloaded)(struct GBAGUIRunner*); void (*prepareForFrame)(struct GBAGUIRunner*); void (*drawFrame)(struct GBAGUIRunner*, bool faded); + void (*paused)(struct GBAGUIRunner*); + void (*unpaused)(struct GBAGUIRunner*); uint16_t (*pollGameInput)(struct GBAGUIRunner*); };
M
src/platform/3ds/main.c
→
src/platform/3ds/main.c
@@ -264,6 +264,8 @@ .gameLoaded = _gameLoaded,
.gameUnloaded = _gameUnloaded, .prepareForFrame = 0, .drawFrame = _drawFrame, + .paused = _gameUnloaded, + .unpaused = _gameLoaded, .pollGameInput = _pollGameInput }; GBAGUIInit(&runner, 0);
M
src/platform/wii/main.c
→
src/platform/wii/main.c
@@ -170,6 +170,8 @@ .gameLoaded = _gameLoaded,
.gameUnloaded = _gameUnloaded, .prepareForFrame = 0, .drawFrame = _drawFrame, + .paused = _gameUnloaded, + .unpaused = 0, .pollGameInput = _pollGameInput }; GBAGUIInit(&runner, 0);