From: Holger Schemel Date: Mon, 7 Aug 2006 22:05:10 +0000 (+0200) Subject: rnd-20060808-1-src X-Git-Tag: 3.2.1^2~18 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=077a063efbdea9755f17e7442115221aabe71503;p=rocksndiamonds.git rnd-20060808-1-src * fixed bug with bumpy scrolling with EM engine in double player mode --- diff --git a/ChangeLog b/ChangeLog index 43eb2e24..2df768e4 100644 --- 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 diff --git a/src/conftime.h b/src/conftime.h index 2da5f838..60eec918 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-08-05 23:30]" +#define COMPILE_DATE_STRING "[2006-08-08 00:01]" diff --git a/src/game_em/graphics.c b/src/game_em/graphics.c index deee45a3..9aff1644 100644 --- a/src/game_em/graphics.c +++ b/src/game_em/graphics.c @@ -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 ||