X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FDDSpriteBuffer.c;h=9377eac3f2d7679cffea8567f5624c0f748d91ac;hb=fe43dcf8ac7fb16e80d60a0c187bcbd65f40b5f2;hp=863aac39f4a8e9f2516ea96f8082fc565e365058;hpb=35b995abd3183999201d9581f7674de1475dc169;p=rocksndiamonds.git diff --git a/src/game_sp/DDSpriteBuffer.c b/src/game_sp/DDSpriteBuffer.c index 863aac39..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; @@ -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; - BlitBitmap(bitmap, screenBitmap, SpriteX, 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)