X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=c2344a507175af8ce42059a4d563ca8c35cada54;hb=297ee9b33dab3bca9433befc81d7c7ce91450dd0;hp=a7ad871bdd019d4735d66077a01e15b24fbebabd;hpb=07e47c9cc4c619ab000b1dd8d8b318eaf5bae3b3;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index a7ad871b..c2344a50 100644 --- a/src/init.c +++ b/src/init.c @@ -5313,6 +5313,7 @@ void Execute_Command(char *command) #if DEBUG #if defined(TARGET_SDL) +#if !defined(TARGET_SDL2) else if (strEqual(command, "SDL_ListModes")) { SDL_Rect **modes; @@ -5347,6 +5348,7 @@ void Execute_Command(char *command) exit(0); } #endif +#endif #endif else @@ -6276,6 +6278,10 @@ void KeyboardAutoRepeatOffUnlessAutoplay() void DisplayExitMessage(char *format, va_list ap) { + // check if draw buffer and fonts for exit message are already available + if (drawto == NULL || font_initial[NUM_INITIAL_FONTS - 1].bitmap == NULL) + return; + int font_1 = FC_RED; int font_2 = FC_YELLOW; int font_3 = FC_BLUE; @@ -6389,7 +6395,7 @@ void OpenAll() InitVideoDisplay(); InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen); - InitEventFilter(FilterMouseMotionEvents); + InitEventFilter(FilterEvents); print_timestamp_time("[init video stuff]"); @@ -6485,8 +6491,14 @@ void CloseAllAndExit(int exit_value) FreeAllImages(); #if defined(TARGET_SDL) +#if defined(TARGET_SDL2) + // !!! TODO !!! + // set a flag to tell the network server thread to quit and wait for it + // using SDL_WaitThread() +#else if (network_server) /* terminate network server */ SDL_KillThread(server_thread); +#endif #endif CloseVideoDisplay();