rnd-20091028-1-src
[rocksndiamonds.git] / src / game_sp / DDScrollBuffer.c
index b1a88ed5d6986b713413ee48214cd5f6b40f671e..48a35ef12084aeb44410caeedc9b2586c91e2af1 100644 (file)
@@ -131,7 +131,7 @@ void DDScrollBuffer_Cls(int BackColor)
   Buffer.BltColorFill(EmptyRect, BackColor);
 }
 
-void DDScrollBuffer_Blt()
+void DDScrollBuffer_Blt_Ext(Bitmap *target_bitmap)
 {
   RECT DR, SR;
   long tX, tY, L;
@@ -182,16 +182,29 @@ void DDScrollBuffer_Blt()
 #endif
 
 #if 0
-  BlitBitmap(screenBitmap, window,
-            1600, 320,
-             SCR_FIELDX * TILEX, SCR_FIELDY * TILEY, SX, SY);
-#else
-  BlitBitmap(screenBitmap, window,
+  /* !!! quick and dirty -- FIX THIS !!! */
+  if (tape.playing && tape.fast_forward &&
+      target_bitmap == window &&
+      (FrameCounter % 2) != 0)
+    printf("::: FrameCounter == %d\n", FrameCounter);
+#endif
+
+#if 1
+  SyncDisplay();
+#endif
+
+#if 1
+  BlitBitmap(screenBitmap, target_bitmap,
             SR.left, SR.top,
              SCR_FIELDX * TILEX, SCR_FIELDY * TILEY, SX, SY);
 #endif
 
+#if 1
+  FlushDisplay();
+#endif
+
   return;
+
 #endif
 
   // DDraw.WaitForVerticalBlank DDWAITVB_BLOCKBEGIN, 0
@@ -305,6 +318,11 @@ void DDScrollBuffer_Blt()
   // BltEH:
 }
 
+void DDScrollBuffer_Blt()
+{
+  DDScrollBuffer_Blt_Ext(window);
+}
+
 void DDScrollBuffer_ScrollTo(int X, int Y)
 {
   if (NoDisplayFlag)
@@ -383,7 +401,7 @@ void DDScrollBuffer_SoftScrollTo(int X, int Y, long TimeMS, int FPS)
   Y = Y / Stretch;
   dx = X - mScrollX;
   dY = Y - mScrollY;
-  maxD = (Abs(dx) < Abs(dY) ?  Abs(dY) :  Abs(dY));
+  maxD = (Abs(dx) < Abs(dY) ? Abs(dY) : Abs(dx));
   StepCount = FPS * (TimeMS / (double)1000);
   if (StepCount > maxD)
     StepCount = maxD;