GC copy_clipmask_gc;
XGCValues clip_gc_values;
unsigned long clip_gc_valuemask;
-#endif
#if defined(TARGET_X11_NATIVE)
static struct
{ GFX2_SHIELD_ACTIVE, 3 },
{ -1, 0 }
};
-#endif
+#endif /* TARGET_X11_NATIVE */
+#endif /* TARGET_X11 */
int i;
To prevent this, create small (tile-sized) mask Pixmaps which will then
be set much faster with XSetClipOrigin() and speed things up a lot. */
- /* create graphic context structures needed for clipping */
- clip_gc_values.graphics_exposures = False;
- clip_gc_valuemask = GCGraphicsExposures;
- copy_clipmask_gc =
- XCreateGC(display, pix[PIX_BACK]->clip_mask,
- clip_gc_valuemask, &clip_gc_values);
-
clip_gc_values.graphics_exposures = False;
clip_gc_valuemask = GCGraphicsExposures;
tile_clip_gc =
clip_gc_values.clip_mask = pix[i]->clip_mask;
clip_gc_valuemask = GCGraphicsExposures | GCClipMask;
pix[i]->stored_clip_gc = XCreateGC(display, window->drawable,
- clip_gc_valuemask,&clip_gc_values);
+ clip_gc_valuemask, &clip_gc_values);
}
}
#if defined(TARGET_X11_NATIVE)
+
+ /* create graphic context structures needed for clipping */
+ clip_gc_values.graphics_exposures = False;
+ clip_gc_valuemask = GCGraphicsExposures;
+ copy_clipmask_gc =
+ XCreateGC(display, pix[PIX_BACK]->clip_mask,
+ clip_gc_valuemask, &clip_gc_values);
+
/* create only those clipping Pixmaps we really need */
for(i=0; tile_needs_clipping[i].start>=0; i++)
{
src_x, src_y, TILEX, TILEY, 0, 0);
}
}
-#endif /* TARGET_X11_NATIVE */
XFreeGC(display, copy_clipmask_gc);
+#endif /* TARGET_X11_NATIVE */
+#endif /* TARGET_X11 */
+}
+
+void FreeTileClipmasks()
+{
+#if defined(TARGET_X11)
+ int i;
+
+ for(i=0; i<NUM_TILES; i++)
+ {
+ if (tile_clipmask[i] != None)
+ {
+ XFreePixmap(display, tile_clipmask[i]);
+ tile_clipmask[i] = None;
+ }
+ }
+
+ if (tile_clip_gc)
+ XFreeGC(display, tile_clip_gc);
+ tile_clip_gc = None;
+
+ for(i=0; i<NUM_BITMAPS; i++)
+ {
+ if (pix[i]->stored_clip_gc)
+ {
+ XFreeGC(display, pix[i]->stored_clip_gc);
+ pix[i]->stored_clip_gc = None;
+ }
+ }
#endif /* TARGET_X11 */
}
}
InitFontInfo(pix[PIX_BIGFONT], pix[PIX_MEDIUMFONT], pix[PIX_SMALLFONT]);
+
InitTileClipmasks();
}
{
if (artwork.graphics_set_current != artwork.gfx_current->name)
{
- Bitmap *pix_new[NUM_PICTURES];
int i;
ClearRectangle(window, 0, 0, WIN_XSIZE, WIN_YSIZE);
- for(i=0; i<NUM_PICTURES; i++)
- {
- DrawInitText(image_filename[i], 150, FC_YELLOW);
- pix_new[i] = ReloadCustomImage(&pix[i], image_filename[i]);
-#if 0
- if (pix_new[i] != NULL)
- pix[i] = pix_new[i];
-#endif
- }
-
-#if 0
- InitFontInfo(pix[PIX_BIGFONT], pix[PIX_MEDIUMFONT], pix[PIX_SMALLFONT]);
- InitTileClipmasks();
- InitGfxBackground();
-#endif
-
-#if 1
for(i=0; i<NUM_PICTURES; i++)
{
- if (pix_new[i] != NULL)
- TransferBitmapPointers(pix_new[i], pix[i]);
- }
-#else
- for(i=0; i<NUM_PICTURES; i++)
- {
- if (pix_new[i] != NULL)
- FreeBitmap(pix_old[i]);
+ DrawInitText(image_filename[i], 150, FC_YELLOW);
+ ReloadCustomImage(pix[i], image_filename[i]);
}
-#endif
-#if 1
- InitFontInfo(pix[PIX_BIGFONT], pix[PIX_MEDIUMFONT], pix[PIX_SMALLFONT]);
+ FreeTileClipmasks();
InitTileClipmasks();
InitGfxBackground();
-#endif
SetDoorState(DOOR_OPEN_1 | DOOR_CLOSE_2);
FreeSounds(NUM_SOUNDS);
CloseAudio();
+ FreeTileClipmasks();
for(i=0; i<NUM_BITMAPS; i++)
FreeBitmap(pix[i]);