1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
5 #include "DDSpriteBuffer.h"
8 static void Blt(int pX, int pY, Bitmap *bitmap, int SpriteX, int SpriteY)
10 int scx = (mScrollX_last < 0 ? 0 : mScrollX_last);
11 int scy = (mScrollY_last < 0 ? 0 : mScrollY_last);
12 int sx1 = scx - 2 * TILEX;
13 int sy1 = scy - 2 * TILEY;
14 int sx2 = scx + (SCR_FIELDX + 1) * TILEX;
15 int sy2 = scy + (SCR_FIELDY + 1) * TILEY;
22 /* do not draw fields that are outside the visible screen area */
23 if (pX < sx1 || pX > sx2 || pY < sy1 || pY > sy2)
26 sx = sx * TILESIZE_VAR / TILESIZE;
27 sy = sy * TILESIZE_VAR / TILESIZE;
29 BlitBitmap(bitmap, bitmap_db_field_sp, SpriteX, SpriteY,
30 TILEX_VAR, TILEY_VAR, sx, sy);
33 void DDSpriteBuffer_BltImg(int pX, int pY, int graphic, int sync_frame)
35 struct GraphicInfo_SP g;
43 getGraphicSource_SP(&g, graphic, sync_frame, -1, -1);
45 Blt(pX, pY, g.bitmap, g.src_x, g.src_y);