-
- 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);
+ /* draw the player to current location */
+ BlitBitmap(sprBitmap, screenBitmap,
+ (spr / 8) * TILEX, (spr % 8) * TILEY, TILEX, TILEY,
+ x, y);
+ /* draw the player to opposite wrap-around column */
+ BlitBitmap(sprBitmap, screenBitmap,
+ (spr / 8) * TILEX, (spr % 8) * TILEY, TILEX, TILEY,
+ x - MAX_BUF_XSIZE * TILEX, y),
+ /* draw the player to opposite wrap-around row */
+ BlitBitmap(sprBitmap, screenBitmap,
+ (spr / 8) * TILEX, (spr % 8) * TILEY, TILEX, TILEY,
+ x, y - MAX_BUF_YSIZE * TILEY);
+
+ /* draw the field the player is moving from (masked over the player) */
+ obj = screentiles[y / TILEY][x / TILEX];
+ src_x = (obj / 512) * TILEX;
+ src_y = (obj % 512) * TILEY / 16;
+ dest_x = (x / TILEX) * TILEX;
+ dest_y = (y / TILEY) * TILEY;
+
+ SetClipOrigin(objBitmap, objBitmap->stored_clip_gc,
+ dest_x - src_x, dest_y - src_y);
+ BlitBitmapMasked(objBitmap, screenBitmap,
+ src_x, src_y, TILEX, TILEY, dest_x, dest_y);
+
+ /* draw the field the player is moving to (masked over the player) */
+ obj = screentiles[dy / TILEY][dx / TILEX];
+ src_x = (obj / 512) * TILEX;
+ src_y = (obj % 512) * TILEY / 16;
+ dest_x = (dx / TILEX) * TILEX;
+ dest_y = (dy / TILEY) * TILEY;
+
+ SetClipOrigin(objBitmap, objBitmap->stored_clip_gc,
+ dest_x - src_x, dest_y - src_y);
+ BlitBitmapMasked(objBitmap, screenBitmap,
+ src_x, src_y, TILEX, TILEY, dest_x, dest_y);