From: Holger Schemel Date: Mon, 22 Nov 2004 01:36:55 +0000 (+0100) Subject: rnd-20041122-1-src X-Git-Tag: 3.1.1^2~48 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=0661d1d004cf01e6818d9005e532e3810f812f79;p=rocksndiamonds.git rnd-20041122-1-src --- diff --git a/src/conftime.h b/src/conftime.h index 8cc91490..cfb6f7ff 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2004-11-21 02:52]" +#define COMPILE_DATE_STRING "[2004-11-22 02:34]" diff --git a/src/game_em/graphics.c b/src/game_em/graphics.c index 9a74308e..fce6e032 100644 --- a/src/game_em/graphics.c +++ b/src/game_em/graphics.c @@ -129,7 +129,7 @@ static void blitplayer(struct PLAYER *ply) { unsigned int x, y, dx, dy; unsigned short obj, spr; - int src_x, src_y, dest_x, dest_y; + int src_x, src_y, dst_x, dst_y; if (!ply->alive) return; @@ -166,25 +166,69 @@ static void blitplayer(struct PLAYER *ply) 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; + dst_x = (x / TILEX) * TILEX; + dst_y = (y / TILEY) * TILEY; +#if 1 +#if 1 + { + int tile = Draw[ply->oldy][ply->oldx]; + struct GraphicInfo_EM *g = &graphic_info_em[tile][frame]; + + if (g->width > 0 && g->height > 0) + { + src_x = g->src_x + g->src_offset_x; + src_y = g->src_y + g->src_offset_y; + dst_x = ply->oldx % MAX_BUF_XSIZE * TILEX + g->dst_offset_x; + dst_y = ply->oldy % MAX_BUF_YSIZE * TILEY + g->dst_offset_y; + + SetClipOrigin(g->bitmap, g->bitmap->stored_clip_gc, + dst_x - src_x, dst_y - src_y); + BlitBitmapMasked(g->bitmap, screenBitmap, + src_x, src_y, g->width, g->height, dst_x, dst_y); + } + } +#else SetClipOrigin(objBitmap, objBitmap->stored_clip_gc, - dest_x - src_x, dest_y - src_y); + dst_x - src_x, dst_y - src_y); BlitBitmapMasked(objBitmap, screenBitmap, - src_x, src_y, TILEX, TILEY, dest_x, dest_y); + src_x, src_y, TILEX, TILEY, dst_x, dst_y); +#endif +#endif /* 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; + dst_x = (dx / TILEX) * TILEX; + dst_y = (dy / TILEY) * TILEY; +#if 1 +#if 1 + { + int tile = Draw[ply->y][ply->x]; + struct GraphicInfo_EM *g = &graphic_info_em[tile][frame]; + + if (g->width > 0 && g->height > 0) + { + src_x = g->src_x + g->src_offset_x; + src_y = g->src_y + g->src_offset_y; + dst_x = ply->x % MAX_BUF_XSIZE * TILEX + g->dst_offset_x; + dst_y = ply->y % MAX_BUF_YSIZE * TILEY + g->dst_offset_y; + + SetClipOrigin(g->bitmap, g->bitmap->stored_clip_gc, + dst_x - src_x, dst_y - src_y); + BlitBitmapMasked(g->bitmap, screenBitmap, + src_x, src_y, g->width, g->height, dst_x, dst_y); + } + } +#else SetClipOrigin(objBitmap, objBitmap->stored_clip_gc, - dest_x - src_x, dest_y - src_y); + dst_x - src_x, dst_y - src_y); BlitBitmapMasked(objBitmap, screenBitmap, - src_x, src_y, TILEX, TILEY, dest_x, dest_y); + src_x, src_y, TILEX, TILEY, dst_x, dst_y); +#endif +#endif #else