rnd-20040820-1-src
[rocksndiamonds.git] / src / libgame / system.c
index 1c33deb66375d930e42c891f98017114e73cffcc..93d251e9d37bb86cb74596cfe9cfc298af92b07f 100644 (file)
@@ -117,6 +117,8 @@ void InitPlatformDependentStuff(void)
 #if defined(TARGET_SDL)
   if (SDL_Init(SDL_INIT_EVENTTHREAD | SDL_INIT_NOPARACHUTE) < 0)
     Error(ERR_EXIT, "SDL_Init() failed: %s", SDL_GetError());
+
+  SDLNet_Init();
 #endif
 }
 
@@ -370,8 +372,7 @@ inline static void FreeBitmapPointers(Bitmap *bitmap)
   X11FreeBitmapPointers(bitmap);
 #endif
 
-  if (bitmap->source_filename)
-    free(bitmap->source_filename);
+  checked_free(bitmap->source_filename);
   bitmap->source_filename = NULL;
 }
 
@@ -813,6 +814,7 @@ Bitmap *ZoomBitmap(Bitmap *src_bitmap, int zoom_width, int zoom_height)
 
 void CreateBitmapWithSmallBitmaps(Bitmap *src_bitmap)
 {
+  Bitmap swap_bitmap;
   Bitmap *tmp_bitmap, *tmp_bitmap_2, *tmp_bitmap_8;
   int src_width, src_height;
   int tmp_width, tmp_height;
@@ -837,6 +839,8 @@ void CreateBitmapWithSmallBitmaps(Bitmap *src_bitmap)
   FreeBitmap(tmp_bitmap_2);
   FreeBitmap(tmp_bitmap_8);
 
+#if 0
+
 #if defined(TARGET_SDL)
   /* !!! what about the old src_bitmap->surface ??? FIX ME !!! */
   src_bitmap->surface = tmp_bitmap->surface;
@@ -845,6 +849,20 @@ void CreateBitmapWithSmallBitmaps(Bitmap *src_bitmap)
   /* !!! see above !!! */
   src_bitmap->drawable = tmp_bitmap->drawable;
   tmp_bitmap->drawable = None;
+#endif
+
+#else
+
+#if defined(TARGET_SDL)
+  swap_bitmap.surface = src_bitmap->surface;
+  src_bitmap->surface = tmp_bitmap->surface;
+  tmp_bitmap->surface = swap_bitmap.surface;
+#else
+  swap_bitmap.drawable = src_bitmap->drawable;
+  src_bitmap->drawable = tmp_bitmap->drawable;
+  tmp_bitmap->drawable = swap_bitmap.drawable;
+#endif
+
 #endif
 
   src_bitmap->height = tmp_bitmap->height;
@@ -869,6 +887,31 @@ static const char *cursor_image_playfield[] =
   ". c #ffffff",
   "  c None",
 
+#if 1
+  /* some people complained about a "white dot" on the screen and thought it
+     was a graphical error... OK, let's just remove the whole pointer :-) */
+
+  /* pixels */
+  "                ",
+  "                ",
+  "                ",
+  "                ",
+  "                ",
+  "                ",
+  "                ",
+  "                ",
+  "                ",
+  "                ",
+  "                ",
+  "                ",
+  "                ",
+  "                ",
+  "                ",
+  "                ",
+
+  /* hot spot */
+  "0,0"
+#else
   /* pixels */
   " X              ",
   "X.X             ",
@@ -889,6 +932,7 @@ static const char *cursor_image_playfield[] =
 
   /* hot spot */
   "1,1"
+#endif
 };
 
 #if defined(TARGET_SDL)