mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[ion/simulator] Add Termination event when headless
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "actions.h"
|
||||
#include "events.h"
|
||||
#include "journal.h"
|
||||
#include "keyboard.h"
|
||||
#include "layout.h"
|
||||
#include "state_file.h"
|
||||
@@ -182,6 +183,13 @@ Event getPlatformEvent() {
|
||||
* the subsequent ones. */
|
||||
SDL_FlushEvents(0, UINT32_MAX);
|
||||
}
|
||||
if (Simulator::Window::isHeadless()) {
|
||||
if (Simulator::Journal::replayJournal() == nullptr || Simulator::Journal::replayJournal()->isEmpty()) {
|
||||
/* We don't want to keep the simulator process alive if there's no chance
|
||||
* we're ever going to provide it with new events to process. */
|
||||
return Termination;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user