move replaying into the event loop

This commit is contained in:
2024-07-31 16:44:19 -05:00
committed by Celtic Minstrel
parent d9cf1c8fae
commit 40cec6e861

View File

@@ -339,12 +339,6 @@ void init_boe(int argc, char* argv[]) {
init_mini_map(); init_mini_map();
redraw_screen(REFRESH_NONE); redraw_screen(REFRESH_NONE);
showMenuBar(); showMenuBar();
if(replaying){
while(has_next_action()){
replay_next_action();
}
}
} }
void showWelcome() { void showWelcome() {
@@ -361,6 +355,9 @@ void handle_events() {
cFramerateLimiter fps_limiter; cFramerateLimiter fps_limiter;
while(!All_Done) { while(!All_Done) {
if(replaying && has_next_action()){
replay_next_action();
}else{
#ifdef __APPLE__ #ifdef __APPLE__
if (menuChoiceId>=0) { if (menuChoiceId>=0) {
eMenuChoice aMenuChoice=menuChoice; eMenuChoice aMenuChoice=menuChoice;
@@ -387,6 +384,7 @@ void handle_events() {
// Alternatively, minimap could live on its own thread. // Alternatively, minimap could live on its own thread.
// But for now we just handle events from both windows on this thread. // But for now we just handle events from both windows on this thread.
while(map_visible && mini_map.pollEvent(currentEvent)) handle_one_minimap_event(currentEvent); while(map_visible && mini_map.pollEvent(currentEvent)) handle_one_minimap_event(currentEvent);
}
if(changed_display_mode) { if(changed_display_mode) {
changed_display_mode = false; changed_display_mode = false;