#define VALID_SCREEN_Y(y) ((y) < MIN_SCREEN_Y ? MIN_SCREEN_Y : \
(y) > MAX_SCREEN_Y ? MAX_SCREEN_Y : (y))
-#define PLAYER_POS_X(nr) (((7 - frame) * ply[nr].oldx + \
+#define PLAYER_POS_X(nr) (((7 - frame) * ply[nr].prev_x + \
(1 + frame) * ply[nr].x) * TILEX / 8)
-#define PLAYER_POS_Y(nr) (((7 - frame) * ply[nr].oldy + \
+#define PLAYER_POS_Y(nr) (((7 - frame) * ply[nr].prev_y + \
(1 + frame) * ply[nr].y) * TILEY / 8)
#define PLAYER_SCREEN_X(nr) (PLAYER_POS_X(nr) - \
int sysize = (full_ysize < ysize ? full_ysize : ysize);
int xxsize = MAX_BUF_XSIZE * TILEX - x;
int yysize = MAX_BUF_YSIZE * TILEY - y;
- int xoffset = 2 * TILEX;
- int yoffset = 2 * TILEY;
+ int xoffset = 2 * CAVE_BUFFER_XOFFSET * TILEX;
+ int yoffset = 2 * CAVE_BUFFER_YOFFSET * TILEY;
if (x < xoffset && y < yoffset)
{
(int)(y2 - screen_y) < ((MAX_BUF_YSIZE - 1) * TILEY - 1))
{
/* some casts to "int" are needed because of negative calculation values */
- int dx = (int)ply[nr].x - (int)ply[nr].oldx;
- int dy = (int)ply[nr].y - (int)ply[nr].oldy;
- int old_x = (int)ply[nr].oldx + (int)frame * dx / 8;
- int old_y = (int)ply[nr].oldy + (int)frame * dy / 8;
+ int dx = (int)ply[nr].x - (int)ply[nr].prev_x;
+ int dy = (int)ply[nr].y - (int)ply[nr].prev_y;
+ int old_x = (int)ply[nr].prev_x + (int)frame * dx / 8;
+ int old_y = (int)ply[nr].prev_y + (int)frame * dy / 8;
int new_x = old_x + SIGN(dx);
int new_y = old_y + SIGN(dy);
int old_sx = old_x % MAX_BUF_XSIZE;
void RedrawPlayfield_EM(boolean force_redraw)
{
boolean draw_new_player_location = FALSE;
- boolean draw_new_player_location_fast = FALSE;
+ boolean draw_new_player_location_wrap = FALSE;
boolean quick_relocation = setup.quick_switch;
int max_center_distance_player_nr =
getMaxCenterDistancePlayerNr(screen_x, screen_y);
game.centered_player_nr = game.centered_player_nr_next;
draw_new_player_location = TRUE;
- draw_new_player_location_fast = game.set_centered_player_fast;
+ draw_new_player_location_wrap = game.set_centered_player_wrap;
force_redraw = TRUE;
game.set_centered_player = FALSE;
- game.set_centered_player_fast = FALSE;
+ game.set_centered_player_wrap = FALSE;
}
if (game.centered_player_nr == -1)
int screen_xx = VALID_SCREEN_X(sx);
int screen_yy = VALID_SCREEN_Y(sy);
- if (draw_new_player_location_fast)
+ if (draw_new_player_location_wrap)
+ {
+ // when wrapping around (horizontally), keep vertical player position
+ screen_yy = screen_y;
+
+ // scrolling for wrapping should be faster than for switching players
wait_delay_value /= 4;
+ }
SetVideoFrameDelay(wait_delay_value);