fix no GUI build

This commit is contained in:
tildearrow 2022-01-27 04:25:16 -05:00
parent c577eeafac
commit 17b1a65280
1 changed files with 10 additions and 0 deletions

View File

@ -2,7 +2,9 @@
#include <stdio.h>
#include <stdint.h>
#include <string>
#ifdef HAVE_GUI
#include "SDL_events.h"
#endif
#include "ta-log.h"
#include "fileutils.h"
#include "engine/engine.h"
@ -358,6 +360,7 @@ int main(int argc, char** argv) {
if (consoleMode) {
logI("playing...\n");
e.play();
#ifdef HAVE_GUI
SDL_Event ev;
while (true) {
SDL_WaitEvent(&ev);
@ -365,6 +368,13 @@ int main(int argc, char** argv) {
}
e.quit();
return 0;
#else
#ifdef _WIN32
Sleep(500);
#else
usleep(500000);
#endif
#endif
}
#ifdef HAVE_GUI