rnd-20091211-1-src
[rocksndiamonds.git] / src / game_sp / DDSpriteBuffer.c
index 00e49d7ac02f62aaaac59c05e3445c853382f57a..bcaaa9841cbd750b6fb029332febf6c173e74ecd 100644 (file)
@@ -132,6 +132,8 @@ boolean DDSpriteBuffer_CreateFromFile(char *Path, long xSprites, long ySprites)
   return CreateFromFile;
 }
 
+#if 0
+
 boolean DDSpriteBuffer_CreateAtSize(long Width, long Height, long xSprites, long ySprites)
 {
   boolean CreateAtSize;
@@ -163,6 +165,10 @@ boolean DDSpriteBuffer_CreateAtSize(long Width, long Height, long xSprites, long
   return CreateAtSize;
 }
 
+#endif
+
+#if 0
+
 void DDSpriteBuffer_Cls(int BackColor)
 {
   RECT EmptyRect;
@@ -170,19 +176,23 @@ void DDSpriteBuffer_Cls(int BackColor)
   Buffer.BltColorFill(EmptyRect, BackColor);
 }
 
+#endif
+
 static void Blt(int pX, int pY, int SpriteX, int SpriteY)
 {
-  RECT DR, SR;
+  MyRECT DR, SR;
 #if 0
   long Tmp;
 #endif
 
 #if 1
 
-  int sx1 = mScrollX_last - 2 * TILEX;
-  int sy1 = mScrollY_last - 2 * TILEY;
-  int sx2 = mScrollX_last + SXSIZE + 1 * TILEX;
-  int sy2 = mScrollY_last + SYSIZE + 1 * TILEY;
+  int scx = (mScrollX_last < 0 ? 0 : mScrollX_last);
+  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 sx = pX - sx1;
   int sy = pY - sy1;