X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.c;h=09c804f06a4a3f6687266356e41b9d4672ffdbf8;hb=197edf38367a6f825e4a60441a11a3c55191e51b;hp=c99010bc9bde7fde6a77e2f7f8451fc8790f8ade;hpb=0838017832a108ba365ea0efb851fc8c4d5f3aa5;p=rocksndiamonds.git diff --git a/src/libgame/system.c b/src/libgame/system.c index c99010bc..09c804f0 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -1023,6 +1023,32 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, old_bitmap->width = new_bitmap->width; old_bitmap->height = new_bitmap->height; +#if 1 + /* !!! THIS URGENTLY NEEDS OPTIMIZATION -- DO NOT CREATE MASKS BEFORE !!! */ + { +#if defined(TARGET_X11) + if (old_bitmap->clip_mask) + XFreePixmap(display, old_bitmap->clip_mask); + + old_bitmap->clip_mask = + Pixmap_to_Mask(old_bitmap->drawable, new_width, new_height); + + XSetClipMask(display, old_bitmap->stored_clip_gc, old_bitmap->clip_mask); +#else + SDL_Surface *old_surface = old_bitmap->surface; + + if (old_bitmap->surface_masked) + SDL_FreeSurface(old_bitmap->surface_masked); + + SDL_SetColorKey(old_surface, SDL_SRCCOLORKEY, + 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, 0, 0); /* reset transparent pixel */ +#endif + } +#endif + FreeBitmap(new_bitmap); /* this actually frees the _old_ bitmap now */ }