+ if (bitmap == NULL)
+ return;
+
+ SDL_Surface *surface = bitmap->surface;
+
+ if (bitmap->surface_masked)
+ SDL_FreeSurface(bitmap->surface_masked);
+
+ SDL_SetColorKey(surface, SET_TRANSPARENT_PIXEL,
+ SDL_MapRGB(surface->format, 0x00, 0x00, 0x00));
+
+ if ((bitmap->surface_masked = SDLGetNativeSurface(surface)) == NULL)
+ Error(ERR_EXIT, "SDL_DisplayFormat() failed");
+
+ SDL_SetColorKey(surface, UNSET_TRANSPARENT_PIXEL, 0);
+}
+
+void ReCreateGameTileSizeBitmap(Bitmap **bitmaps)
+{
+ if (bitmaps[IMG_BITMAP_CUSTOM])
+ {
+ FreeBitmap(bitmaps[IMG_BITMAP_CUSTOM]);
+
+ bitmaps[IMG_BITMAP_CUSTOM] = NULL;
+ }
+
+ if (gfx.game_tile_size == gfx.standard_tile_size)
+ {
+ bitmaps[IMG_BITMAP_GAME] = bitmaps[IMG_BITMAP_STANDARD];
+
+ return;
+ }
+
+ Bitmap *bitmap = bitmaps[IMG_BITMAP_STANDARD];
+ int width = bitmap->width * gfx.game_tile_size / gfx.standard_tile_size;;
+ int height = bitmap->height * gfx.game_tile_size / gfx.standard_tile_size;;
+
+ Bitmap *bitmap_new = ZoomBitmap(bitmap, width, height);
+
+ bitmaps[IMG_BITMAP_CUSTOM] = bitmap_new;
+ bitmaps[IMG_BITMAP_GAME] = bitmap_new;
+
+ SetMaskedBitmapSurface(bitmap_new);
+}
+
+static void CreateScaledBitmaps(Bitmap **bitmaps, int zoom_factor,
+ int tile_size, boolean create_small_bitmaps)
+{
+ Bitmap *old_bitmap = bitmaps[IMG_BITMAP_STANDARD];
+ Bitmap *tmp_bitmap_final = NULL;
+ Bitmap *tmp_bitmap_0 = NULL;
+ Bitmap *tmp_bitmap_1 = NULL;
+ Bitmap *tmp_bitmap_2 = NULL;
+ Bitmap *tmp_bitmap_4 = NULL;
+ Bitmap *tmp_bitmap_8 = NULL;
+ Bitmap *tmp_bitmap_16 = NULL;
+ Bitmap *tmp_bitmap_32 = NULL;
+ int width_final, height_final;
+ int width_0, height_0;