- screentiles[y / TILEY][x / TILEX] = -1; /* mark screen as dirty */
- screentiles[dy / TILEY][dx / TILEX] = -1;
-
-#if 1
-
-
-#if 1
-
- SetClipMask(sprBitmap, sprBitmap->stored_clip_gc, spriteBitmap);
-
- SetClipOrigin(sprBitmap, sprBitmap->stored_clip_gc, x, y);
- BlitBitmapMasked(sprBitmap, screenBitmap,
- (spr / 8) * TILEX, (spr % 8) * TILEY, TILEX, TILEY,
- x, y);
-
- SetClipOrigin(sprBitmap, sprBitmap->stored_clip_gc,
- x - MAX_BUF_XSIZE * TILEX, y);
- BlitBitmapMasked(sprBitmap, screenBitmap,
- (spr / 8) * TILEX, (spr % 8) * TILEY, TILEX, TILEY,
- x - MAX_BUF_XSIZE * TILEX, y);
-
- SetClipOrigin(sprBitmap, sprBitmap->stored_clip_gc,
- x, y - MAX_BUF_YSIZE * TILEY);
- BlitBitmapMasked(sprBitmap, screenBitmap,
- (spr / 8) * TILEX, (spr % 8) * TILEY, TILEX, TILEY,
- x, y - MAX_BUF_YSIZE * TILEY);
-
- SetClipMask(sprBitmap, sprBitmap->stored_clip_gc, None);
-
-#else
-
- XSetClipMask(display, sprBitmap->stored_clip_gc, spriteBitmap);
-
- XSetClipOrigin(display, sprBitmap->stored_clip_gc, x, y);
- XCopyArea(display, sprBitmap->drawable, screenBitmap->drawable,
- sprBitmap->stored_clip_gc,
- (spr / 8) * TILEX, (spr % 8) * TILEY, TILEX, TILEY,
- x, y);
-
- XSetClipOrigin(display, sprBitmap->stored_clip_gc,
- x - MAX_BUF_XSIZE * TILEX, y);
- XCopyArea(display, sprBitmap->drawable, screenBitmap->drawable,
- sprBitmap->stored_clip_gc,
- (spr / 8) * TILEX, (spr % 8) * TILEY, TILEX, TILEY,
- x - MAX_BUF_XSIZE * TILEX, y);
-
- XSetClipOrigin(display, sprBitmap->stored_clip_gc,
- x, y - MAX_BUF_YSIZE * TILEY);
- XCopyArea(display, sprBitmap->drawable, screenBitmap->drawable,
- sprBitmap->stored_clip_gc,
- (spr / 8) * TILEX, (spr % 8) * TILEY, TILEX, TILEY,
- x, y - MAX_BUF_YSIZE * TILEY);
-
- XSetClipMask(display, sprBitmap->stored_clip_gc, None);
-
-#endif
-
-#else
-
- XSetClipMask(display, screenGC, spriteBitmap);
- XSetClipOrigin(display, screenGC, x, y);
- XCopyArea(display, sprPixmap, screenPixmap, screenGC,
- (spr / 8) * TILEX, (spr % 8) * TILEY, TILEX, TILEY,
- x, y);
- XSetClipOrigin(display, screenGC, x - MAX_BUF_XSIZE * TILEX, y);
- XCopyArea(display, sprPixmap, screenPixmap, screenGC,
- (spr / 8) * TILEX, (spr % 8) * TILEY, TILEX, TILEY,
- x - MAX_BUF_XSIZE * TILEX, y);
- XSetClipOrigin(display, screenGC, x, y - MAX_BUF_YSIZE * TILEY);
- XCopyArea(display, sprPixmap, screenPixmap, screenGC,
- (spr / 8) * TILEX, (spr % 8) * TILEY, TILEX, TILEY,
- x, y - MAX_BUF_YSIZE * TILEY);
- XSetClipMask(display, screenGC, None);
-
-#endif
+ if (width > 0 && height > 0)
+ {
+ int src_x = g->crumbled_src_x + cx;
+ int src_y = g->crumbled_src_y + cy;
+ int dst_x = sx * TILEX + cx;
+ int dst_y = sy * TILEY + cy;
+
+ if (draw_masked)
+ {
+ SetClipOrigin(g->crumbled_bitmap, g->crumbled_bitmap->stored_clip_gc,
+ dst_x - src_x, dst_y - src_y);
+ BlitBitmapMasked(g->crumbled_bitmap, screenBitmap,
+ src_x, src_y, width, height, dst_x, dst_y);
+ }
+ else
+ BlitBitmap(g->crumbled_bitmap, screenBitmap,
+ src_x, src_y, width, height, dst_x, dst_y);
+ }