rnd-20140129-1-src
[rocksndiamonds.git] / src / libgame / system.c
index e3f5847d4ba45a2469318668e59b4dcaa8eee0d3..f08c88c762aa1519e71965eee0e58f6a2b92eb1a 100644 (file)
@@ -129,6 +129,9 @@ void InitExitFunction(void (*exit_function)(int))
 
 void InitPlatformDependentStuff(void)
 {
+  // this is initialized in GetOptions(), but may already be used before
+  options.verbose = TRUE;
+
 #if defined(PLATFORM_MSDOS)
   _fmode = O_BINARY;
 #endif
@@ -315,11 +318,9 @@ void SetBackgroundBitmap(Bitmap *background_bitmap_tile, int mask)
                       gfx.real_sx, gfx.real_sy,
                       gfx.full_sxsize, gfx.full_sysize);
   else if (mask == REDRAW_DOOR_1)
-  {
     DrawBitmapFromTile(gfx.background_bitmap, background_bitmap_tile,
                       gfx.dx, gfx.dy,
                       gfx.dxsize, gfx.dysize);
-  }
 }
 
 #else
@@ -347,10 +348,8 @@ void SetBackgroundBitmap(Bitmap *background_bitmap_tile, int mask)
     BlitBitmapTiled(background_bitmap_tile, gfx.background_bitmap, 0, 0, 0, 0,
                    gfx.real_sx, gfx.real_sy, gfx.full_sxsize, gfx.full_sysize);
   else if (mask == REDRAW_DOOR_1)
-  {
     BlitBitmapTiled(background_bitmap_tile, gfx.background_bitmap, 0, 0, 0, 0,
                    gfx.dx, gfx.dy, gfx.dxsize, gfx.dysize);
-  }
 }
 
 #endif
@@ -412,6 +411,13 @@ inline static void sysCopyArea(Bitmap *src_bitmap, Bitmap *dst_bitmap,
 #endif
 }
 
+void LimitScreenUpdates(boolean enable)
+{
+#if defined(TARGET_SDL)
+  SDLLimitScreenUpdates(enable);
+#endif
+}
+
 void InitVideoDisplay(void)
 {
 #if defined(TARGET_SDL)
@@ -435,17 +441,24 @@ void CloseVideoDisplay(void)
 
 void InitVideoBuffer(int width, int height, int depth, boolean fullscreen)
 {
+#if 0
+  printf("::: InitVideoBuffer\n");
+#endif
+
   video.width = width;
   video.height = height;
   video.depth = GetRealDepth(depth);
 
   video.fullscreen_available = FULLSCREEN_STATUS;
   video.fullscreen_enabled = FALSE;
+  // video.fullscreen_initial = FALSE;
 #if 0
   video.fullscreen_mode_current = NULL;
   video.fullscreen_modes = NULL;
 #endif
 
+  video.window_scaling_available = WINDOW_SCALING_STATUS;
+
 #if defined(TARGET_SDL)
   SDLInitVideoBuffer(&backbuffer, &window, fullscreen);
 #else
@@ -703,14 +716,17 @@ void BlitBitmap(Bitmap *src_bitmap, Bitmap *dst_bitmap,
     height = dst_bitmap->height - dst_y;
 #endif
 
-#if 0
+#if 1
+  /* !!! 2013-12-11: An "old friend" is back. Same bug in SDL2 2.0.1 !!! */
+#if 1
   /* !!! 2009-03-30: Fixed by using self-compiled, patched SDL.dll !!! */
   /* (This bug still exists in the actual (as of 2009-06-15) version 1.2.13,
      but is already fixed in SVN and should therefore finally be fixed with
      the next official SDL release, which is probably version 1.2.14.) */
 #if 1
   /* !!! 2009-03-24: It seems that this problem still exists in 1.2.12 !!! */
-#if defined(TARGET_SDL) && defined(PLATFORM_WIN32)
+  //#if defined(TARGET_SDL) && defined(PLATFORM_WIN32)
+#if defined(TARGET_SDL2)
   if (src_bitmap == dst_bitmap)
   {
     /* !!! THIS IS A BUG (IN THE SDL LIBRARY?) AND SHOULD BE FIXED !!! */
@@ -755,6 +771,7 @@ void BlitBitmap(Bitmap *src_bitmap, Bitmap *dst_bitmap,
 #endif
 #endif
 #endif
+#endif
 
 #if 0
   if (dst_x < gfx.sx + gfx.sxsize)