From 2725d6ed2f0cafdf9c993a18d03e6ca85304af87 Mon Sep 17 00:00:00 2001 From: Extrems Date: Wed, 28 Oct 2015 02:03:23 -0400 Subject: [PATCH] GUI: Fix --- src/gba/gui/gui-runner.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gba/gui/gui-runner.c b/src/gba/gui/gui-runner.c index 8353e6327..945fa4937 100644 --- a/src/gba/gui/gui-runner.c +++ b/src/gba/gui/gui-runner.c @@ -191,29 +191,32 @@ void GBAGUIRunloop(struct GBAGUIRunner* runner) { 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) { runner->gameLoaded(runner);