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 + SXSIZE + 1 * TILEX;
15 int sy2 = scy + SYSIZE + 1 * TILEY;
23 /* do not draw fields that are outside the visible screen area */
24 if (pX < sx1 || pX > sx2 || pY < sy1 || pY > sy2)
27 BlitBitmap(bitmap, screenBitmap, SpriteX, SpriteY,
28 TILEX, TILEY, sx, sy);
31 void DDSpriteBuffer_BltImg(int pX, int pY, int graphic, int sync_frame)
33 struct GraphicInfo_SP g;
38 getGraphicSource_SP(&g, graphic, sync_frame, -1, -1);
40 Blt(pX, pY, g.bitmap, g.src_x, g.src_y);