Skip to content

Commit

Permalink
Ready_To_Quit is only handled in WIN32 message handler
Browse files Browse the repository at this point in the history
  • Loading branch information
th-otto authored and OmniBlade committed Jun 19, 2024
1 parent f292852 commit 6f95720
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions redalert/startup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,9 @@ int main(int argc, char* argv[])
*/
#if defined(_WIN32) && !defined(SDL_BUILD)
PostMessage(MainWindow, WM_DESTROY, 0, 0);
#endif

#if !defined(REMASTER_BUILD) && defined(_WIN32) && !defined(SDL_BUILD)
/*
** Wait until the message handler has dealt with the message
*/
Expand Down Expand Up @@ -701,12 +703,14 @@ void Emergency_Exit(int code)
PostMessage(MainWindow, WM_DESTROY, 0, 0);
#endif

#if !defined(REMASTER_BUILD) && defined(_WIN32) && !defined(SDL_BUILD)
/*
** Wait until the message handler has dealt with the message
*/
do {
Keyboard->Check();
} while (ReadyToQuit == 3);
#endif

exit(code);
}
Expand Down
2 changes: 2 additions & 0 deletions redalert/winstub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,11 @@ void Memory_Error_Handler(void)
#ifdef _WIN32
PostMessage(MainWindow, WM_DESTROY, 0, 0);
#endif
#if !defined(REMASTER_BUILD) && defined(_WIN32) && !defined(SDL_BUILD)
do {
Keyboard->Check();
} while (ReadyToQuit == 1);
#endif

exit(1);
}
4 changes: 3 additions & 1 deletion tiberiandawn/startup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,9 @@ int main(int argc, char** argv)
*/
#if defined(_WIN32) && !defined(SDL_BUILD)
PostMessage(MainWindow, WM_DESTROY, 0, 0);
#endif

#if !defined(REMASTER_BUILD) && defined(_WIN32) && !defined(SDL_BUILD)
/*
** Wait until the message handler has dealt with the message
*/
Expand Down Expand Up @@ -609,4 +611,4 @@ void Read_Setup_Options(RawFileClass* config_file)
*/
VideoBackBufferAllowed = ini.Get_Bool("Options", "VideoBackBuffer", true);
AllowHardwareBlitFills = ini.Get_Bool("Options", "HardwareFills", true);
}
}

0 comments on commit 6f95720

Please sign in to comment.