rnd-19980917
[rocksndiamonds.git] / src / cartoons.c
index 7cc59d1a05454557a136b2b6629c245993a87473..b1b31921c03f0f1cc01131a9160a9fe4a77f447d 100644 (file)
@@ -125,7 +125,7 @@ void HandleAnimation(int mode)
       reset_delay = TRUE;
 
       /* Fill empty backbuffer for animation functions */
-      if (direct_draw_on && game_status==PLAYING)
+      if (direct_draw_on && game_status == PLAYING)
       {
        int xx,yy;
 
@@ -139,12 +139,24 @@ void HandleAnimation(int mode)
        SetDrawtoField(DRAW_DIRECT);
       }
 
+      if (soft_scrolling_on && game_status == PLAYING)
+      {
+       int fx = FX, fy = FY;
+
+        fx += (PlayerMovDir & (MV_LEFT|MV_RIGHT) ? ScreenMovPos : 0);
+        fy += (PlayerMovDir & (MV_UP|MV_DOWN)    ? ScreenMovPos : 0);
+
+       XCopyArea(display,fieldbuffer,backbuffer,gc,
+                 fx,fy, SXSIZE,SYSIZE,
+                 SX,SY);
+      }
+
       return;
       break;
     case ANIM_CONTINUE:
       break;
     case ANIM_STOP:
-      redraw_mask |= REDRAW_FIELD;
+      redraw_mask |= (REDRAW_FIELD | REDRAW_FROM_BACKBUFFER);
 
       /* Redraw background even when in direct drawing mode */
       draw_mode = direct_draw_on;
@@ -163,7 +175,7 @@ void HandleAnimation(int mode)
   if (reset_delay)
   {
     animstart_delay = Counter();
-    animstart_delay_value = SimpleRND(500);
+    animstart_delay_value = SimpleRND(3000);
     reset_delay = FALSE;
   }
 
@@ -394,7 +406,7 @@ BOOL AnimateToon(int toon_nr, BOOL restart)
   {
     horiz_move = (anim->direction & (ANIMDIR_LEFT | ANIMDIR_RIGHT));
     vert_move = (anim->direction & (ANIMDIR_UP | ANIMDIR_DOWN));
-    anim_delay_value = 100/anim->frames_per_second;
+    anim_delay_value = 1000/anim->frames_per_second;
     frame = 0;
 
     if (horiz_move)