rnd-20060808-1-src
authorHolger Schemel <info@artsoft.org>
Mon, 7 Aug 2006 22:05:10 +0000 (00:05 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:52:43 +0000 (10:52 +0200)
* fixed bug with bumpy scrolling with EM engine in double player mode

ChangeLog
src/conftime.h
src/game_em/graphics.c

index 43eb2e2442f7e480a3322154407790a93d84620f..2df768e45a079934cfa3cab3e3418a0a84cdacc2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2006-08-07
+       * fixed bug with bumpy scrolling with EM engine in double player mode
+
 2006-08-05
        * added compatibility code to fix "Snake Bite" style levels that were
          broken due to a bugfix regarding EL_SOKOBAN_FIELD_PLAYER in 3.2.0
index 2da5f8383ce1bc2eee2cc0343e05d799c049a226..60eec91895420a4e88cffcdade44bfdd219b3784 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-08-05 23:30]"
+#define COMPILE_DATE_STRING "[2006-08-08 00:01]"
index deee45a380a905e09b93cb2f02609659b33edfa2..9aff1644d4b8e75f5b4e80efe588d5d48d19ccb2 100644 (file)
@@ -912,7 +912,36 @@ void RedrawPlayfield_EM(boolean force_redraw)
                            sy - offset_y > screen_y ? sy - offset_y :
                            screen_y);
 
+#if 0
+  printf("::: (%d, %d) => (%d, %d) [(%d, %d), (%d, %d)] [%d, %d] [%d / %d]\n",
+        screen_x_old, screen_y_old,
+        screen_x, screen_y,
+        ply[max_center_distance_player_nr].oldx,
+        ply[max_center_distance_player_nr].x,
+        ply[max_center_distance_player_nr].oldy,
+        ply[max_center_distance_player_nr].y,
+        sx, sy,
+        ABS(screen_x - screen_x_old),
+        ABS(screen_y - screen_y_old));
+#endif
+
+#if 1
+
 #if 1
+  /* prevent scrolling further than double player step size when scrolling */
+  if (ABS(screen_x - screen_x_old) > 2 * stepsize)
+  {
+    int dx = SIGN(screen_x - screen_x_old);
+
+    screen_x = screen_x_old + dx * 2 * stepsize;
+  }
+  if (ABS(screen_y - screen_y_old) > 2 * stepsize)
+  {
+    int dy = SIGN(screen_y - screen_y_old);
+
+    screen_y = screen_y_old + dy * 2 * stepsize;
+  }
+#else
   /* prevent scrolling further than double player step size when scrolling */
   if (ABS(screen_x - screen_x_old) > 2 * stepsize ||
       ABS(screen_y - screen_y_old) > 2 * stepsize)
@@ -923,6 +952,8 @@ void RedrawPlayfield_EM(boolean force_redraw)
     screen_x = screen_x_old + dx * 2 * stepsize;
     screen_y = screen_y_old + dy * 2 * stepsize;
   }
+#endif
+
 #else
   /* prevent scrolling further than player step size when scrolling */
   if (ABS(screen_x - screen_x_old) > stepsize ||