X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FDDSpriteBuffer.c;h=9865b93053a3ab9467cdc455cf06267317ebb3e9;hb=98d421667c21a07ab69dd881f1435c2f595ddd4c;hp=9377eac3f2d7679cffea8567f5624c0f748d91ac;hpb=97baecdfcf386d972f6f8e6eec9ddfd3021ed7ed;p=rocksndiamonds.git diff --git a/src/game_sp/DDSpriteBuffer.c b/src/game_sp/DDSpriteBuffer.c index 9377eac3..9865b930 100644 --- a/src/game_sp/DDSpriteBuffer.c +++ b/src/game_sp/DDSpriteBuffer.c @@ -11,38 +11,23 @@ static void Blt(int pX, int pY, Bitmap *bitmap, int SpriteX, int SpriteY) int scy = (mScrollY_last < 0 ? 0 : mScrollY_last); int sx1 = scx - 2 * TILEX; int sy1 = scy - 2 * TILEY; - int sx2 = scx + SXSIZE + 1 * TILEX; - int sy2 = scy + SYSIZE + 1 * TILEY; + int sx2 = scx + (SCR_FIELDX + 1) * TILEX; + int sy2 = scy + (SCR_FIELDY + 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; - /* do not draw fields that are outside the visible screen area */ + // do not draw fields that are outside the visible screen area if (pX < sx1 || pX > sx2 || pY < sy1 || pY > sy2) return; + sx = sx * TILESIZE_VAR / TILESIZE; + sy = sy * TILESIZE_VAR / TILESIZE; + 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++; - } + TILEX_VAR, TILEY_VAR, sx, sy); } void DDSpriteBuffer_BltImg(int pX, int pY, int graphic, int sync_frame) @@ -52,6 +37,9 @@ void DDSpriteBuffer_BltImg(int pX, int pY, int graphic, int sync_frame) if (NoDisplayFlag) return; + if (graphic < 0) + return; + getGraphicSource_SP(&g, graphic, sync_frame, -1, -1); Blt(pX, pY, g.bitmap, g.src_x, g.src_y);