rnd-20131209-1-src
[rocksndiamonds.git] / src / init.c
index b1e9920e12b718e49e99f46064c3777aa80959e4..c2344a507175af8ce42059a4d563ca8c35cada54 100644 (file)
@@ -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();
@@ -6498,7 +6510,8 @@ void CloseAllAndExit(int exit_value)
     SaveLevelSetup_LastSeries_Deactivate();
 
     /* tell user where to find error log file which may contain more details */
-    NotifyUserAboutErrorFile();
+    // (error notification now directly displayed on screen inside R'n'D
+    // NotifyUserAboutErrorFile();     /* currently only works for Windows */
   }
 
   exit(exit_value);