- new_width = width_1;
- new_height = height_1;
-
- new_bitmap = tmp_bitmap_1; /* directly use tmp_bitmap_1 as new bitmap */
- }
-
- if (create_small_bitmaps)
- {
- /* if no small bitmaps created, tmp_bitmap_1 is used as new bitmap now */
-
-#if 1
- if (tmp_bitmap_final != old_bitmap)
- FreeBitmap(tmp_bitmap_final);
-
- if (tmp_bitmap_0 != old_bitmap &&
- tmp_bitmap_0 != tmp_bitmap_final)
- FreeBitmap(tmp_bitmap_0);
-
- if (tmp_bitmap_1 != old_bitmap &&
- tmp_bitmap_1 != tmp_bitmap_final &&
- tmp_bitmap_1 != tmp_bitmap_0)
- FreeBitmap(tmp_bitmap_1);
-
- if (tmp_bitmap_2 != old_bitmap)
- FreeBitmap(tmp_bitmap_2);
-
- if (tmp_bitmap_4 != old_bitmap)
- FreeBitmap(tmp_bitmap_4);
-
- if (tmp_bitmap_8 != old_bitmap)
- FreeBitmap(tmp_bitmap_8);
-
- if (tmp_bitmap_16 != old_bitmap)
- FreeBitmap(tmp_bitmap_16);
-
- if (tmp_bitmap_32 != old_bitmap)
- FreeBitmap(tmp_bitmap_32);
-
-#else
-
- if (zoom_factor != 1)
- FreeBitmap(tmp_bitmap_1);
-
- if (zoom_factor != 2)
- FreeBitmap(tmp_bitmap_2);
-
- if (zoom_factor != 4)
- FreeBitmap(tmp_bitmap_4);
-
- if (zoom_factor != 8)
- FreeBitmap(tmp_bitmap_8);
-
- if (zoom_factor != 16)
- FreeBitmap(tmp_bitmap_16);
-
- if (zoom_factor != 32)
- FreeBitmap(tmp_bitmap_32);
-#endif
- }
-
- /* replace image with extended image (containing 1/1, 1/2, 1/4, 1/8 size) */
-#if defined(TARGET_SDL)
- swap_bitmap.surface = old_bitmap->surface;
- old_bitmap->surface = new_bitmap->surface;
- new_bitmap->surface = swap_bitmap.surface;
-#else
- swap_bitmap.drawable = old_bitmap->drawable;
- old_bitmap->drawable = new_bitmap->drawable;
- new_bitmap->drawable = swap_bitmap.drawable;
-#endif
-
- old_bitmap->width = new_bitmap->width;
- old_bitmap->height = new_bitmap->height;
-
-#if 1
- /* this replaces all blit masks created when loading -- maybe optimize this */
- {
- SDL_Surface *old_surface = old_bitmap->surface;
-
- if (old_bitmap->surface_masked)
- SDL_FreeSurface(old_bitmap->surface_masked);
-
- SDL_SetColorKey(old_surface, SET_TRANSPARENT_PIXEL,
- SDL_MapRGB(old_surface->format, 0x00, 0x00, 0x00));
-
- if ((old_bitmap->surface_masked = SDL_DisplayFormat(old_surface)) == NULL)
- Error(ERR_EXIT, "SDL_DisplayFormat() failed");
-
- SDL_SetColorKey(old_surface, UNSET_TRANSPARENT_PIXEL, 0);