fix no GUI build

This commit is contained in:
tildearrow 2022-01-27 04:25:16 -05:00
parent c577eeafac
commit 17b1a65280

View file

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