Skip to content

Commit

Permalink
Changed to the same method RA uses and thus avoids the call to PostMe…
Browse files Browse the repository at this point in the history
…ssage with SDL enabled
  • Loading branch information
tore29 committed Dec 19, 2023
1 parent 0076980 commit 43970f0
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions tiberiandawn/startup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ int main(int argc, char** argv)
printf("Zuwenig Hauptspeicher verf?gbar.\n");
#else
#ifdef FRENCH
printf("Mmoire vive (RAM) insuffisante.\n");
printf("Mmoire vive (RAM) insuffisante.\n");
#else
printf("Insufficient RAM available.\n");
#endif
Expand Down Expand Up @@ -467,16 +467,30 @@ int main(int argc, char** argv)
Memory_Error_Exit = Print_Error_Exit;

CCDebugString("C&C95 - About to exit.\n");
ReadyToQuit = 1;

#if defined(SDL_BUILD)
Reset_Video_Mode();
#endif

Sound_End();

#if defined(_WIN32)
PostMessageA(MainWindow, WM_DESTROY, 0, 0);
/*
** Flag that this is a clean shutdown (not killed with Ctrl-Alt-Del)
*/
ReadyToQuit = 1;

/*
** Post a message to our message handler to tell it to clean up.
*/
#if defined(_WIN32) && !defined(SDL_BUILD)
PostMessage(MainWindow, WM_DESTROY, 0, 0);

/*
** Wait until the message handler has dealt with the message
*/
do {
Keyboard->Check();
} while (ReadyToQuit == 1);
#endif

CCDebugString("C&C95 - Returned from final message loop.\n");
Expand Down

0 comments on commit 43970f0

Please sign in to comment.