projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20100623-2-src
[rocksndiamonds.git]
/
src
/
game_sp
/
DDSpriteBuffer.c
diff --git
a/src/game_sp/DDSpriteBuffer.c
b/src/game_sp/DDSpriteBuffer.c
index 863aac39f4a8e9f2516ea96f8082fc565e365058..9377eac3f2d7679cffea8567f5624c0f748d91ac 100644
(file)
--- a/
src/game_sp/DDSpriteBuffer.c
+++ b/
src/game_sp/DDSpriteBuffer.c
@@
-13,9
+13,12
@@
static void Blt(int pX, int pY, Bitmap *bitmap, int SpriteX, int SpriteY)
int sy1 = scy - 2 * TILEY;
int sx2 = scx + SXSIZE + 1 * TILEX;
int sy2 = scy + SYSIZE + 1 * TILEY;
int sy1 = scy - 2 * TILEY;
int sx2 = scx + SXSIZE + 1 * TILEX;
int sy2 = scy + SYSIZE + 1 * TILEY;
-
int sx = pX - sx1;
int sy = pY - sy1;
int sx = pX - sx1;
int sy = pY - sy1;
+ int tile_x = sx / TILESIZE;
+ int tile_y = sy / TILESIZE;
+ int move_x = (sx + TILESIZE - 1) / TILESIZE;
+ int move_y = (sy + TILESIZE - 1) / TILESIZE;
if (NoDisplayFlag)
return;
if (NoDisplayFlag)
return;
@@
-24,8
+27,22
@@
static void Blt(int pX, int pY, Bitmap *bitmap, int SpriteX, int SpriteY)
if (pX < sx1 || pX > sx2 || pY < sy1 || pY > sy2)
return;
if (pX < sx1 || pX > sx2 || pY < sy1 || pY > sy2)
return;
- BlitBitmap(bitmap,
screenBitma
p, SpriteX, SpriteY,
+ BlitBitmap(bitmap,
bitmap_db_field_s
p, SpriteX, SpriteY,
TILEX, TILEY, sx, sy);
TILEX, TILEY, sx, sy);
+
+ redraw[tile_x][tile_y] = TRUE;
+ redraw_tiles++;
+
+ if (move_x != tile_x)
+ {
+ redraw[move_x][tile_y] = TRUE;
+ redraw_tiles++;
+ }
+ else if (move_y != tile_y)
+ {
+ redraw[tile_x][move_y] = TRUE;
+ redraw_tiles++;
+ }
}
void DDSpriteBuffer_BltImg(int pX, int pY, int graphic, int sync_frame)
}
void DDSpriteBuffer_BltImg(int pX, int pY, int graphic, int sync_frame)