From 17b1a6528049ca46af34ffe931f35a458a9e1e1c Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 27 Jan 2022 04:25:16 -0500 Subject: [PATCH] fix no GUI build --- src/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 1143d8c84..a92cad2c5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,7 +2,9 @@ #include #include #include +#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