fix Ctrl-C not stopping in console mode

This commit is contained in:
tildearrow 2022-01-26 03:00:58 -05:00
parent d882fd33f8
commit 4d1b69e905
1 changed files with 5 additions and 5 deletions

View File

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