X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fgame_sp%2FDDSpriteBuffer.c;h=9377eac3f2d7679cffea8567f5624c0f748d91ac;hp=4683d319d1829b2c4d646f2985e8362705ed2858;hb=97baecdfcf386d972f6f8e6eec9ddfd3021ed7ed;hpb=cd77f8c1eb3e792f1cd0c108ce49a03d762ebb96 diff --git a/src/game_sp/DDSpriteBuffer.c b/src/game_sp/DDSpriteBuffer.c index 4683d319..9377eac3 100644 --- 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 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; @@ -26,6 +29,20 @@ static void Blt(int pX, int pY, Bitmap *bitmap, int SpriteX, int SpriteY) BlitBitmap(bitmap, bitmap_db_field_sp, SpriteX, SpriteY, 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)