all repos — mgba @ 2725d6ed2f0cafdf9c993a18d03e6ca85304af87

mGBA Game Boy Advance Emulator

GUI: Fix
Extrems metaradil@gmail.com
Wed, 28 Oct 2015 02:03:23 -0400
commit

2725d6ed2f0cafdf9c993a18d03e6ca85304af87

parent

b1d915abbc8924613bea12ae37e3a39d35d8c08f

1 files changed, 11 insertions(+), 8 deletions(-)

jump to
M src/gba/gui/gui-runner.csrc/gba/gui/gui-runner.c

@@ -191,28 +191,31 @@ if (!GUISelectFile(&runner->params, path, sizeof(path), 0)) {

break; } + // TODO: Message box API + runner->params.drawStart(); if (runner->params.guiPrepare) { runner->params.guiPrepare(); } - // TODO: Message box API - runner->params.drawStart(); GUIFontPrint(runner->params.font, runner->params.width / 2, (GUIFontHeight(runner->params.font) + runner->params.height) / 2, GUI_TEXT_CENTER, 0xFFFFFFFF, "Loading..."); - runner->params.drawEnd(); - runner->params.drawStart(); - GUIFontPrint(runner->params.font, runner->params.width / 2, (GUIFontHeight(runner->params.font) + runner->params.height) / 2, GUI_TEXT_CENTER, 0xFFFFFFFF, "Loading..."); + if (runner->params.guiFinish) { + runner->params.guiFinish(); + } runner->params.drawEnd(); if (!GBAContextLoadROM(&runner->context, path, true)) { int i; for (i = 0; i < 300; ++i) { runner->params.drawStart(); + if (runner->params.guiPrepare) { + runner->params.guiPrepare(); + } GUIFontPrint(runner->params.font, runner->params.width / 2, (GUIFontHeight(runner->params.font) + runner->params.height) / 2, GUI_TEXT_CENTER, 0xFFFFFFFF, "Load failed!"); + if (runner->params.guiFinish) { + runner->params.guiFinish(); + } runner->params.drawEnd(); } continue; - } - if (runner->params.guiFinish) { - runner->params.guiFinish(); } bool running = GBAContextStart(&runner->context); if (runner->gameLoaded) {