This commit is contained in:
Extrems 2015-10-28 02:03:23 -04:00 committed by Jeffrey Pfau
parent b1d915abbc
commit 2725d6ed2f
1 changed files with 11 additions and 8 deletions

View File

@ -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);