X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_em%2Fgraphics.c;h=a29d2e0e7208ab4d45cf1e7cad2a4bb1bd1311a0;hb=70dc207bf840929d1f21821f1a94ed305df96f56;hp=19000a7de764047c836a1e6b2e943ccab698cf8a;hpb=385c764cc98bf873c364aa0411d15e39ca590312;p=rocksndiamonds.git diff --git a/src/game_em/graphics.c b/src/game_em/graphics.c index 19000a7d..a29d2e0e 100644 --- a/src/game_em/graphics.c +++ b/src/game_em/graphics.c @@ -441,11 +441,20 @@ static void blitplayer(int nr) ply[nr].x > lev.right - 1) { struct PLAYER ply_last = ply[nr]; + int direction = (ply[nr].x < lev.left ? -1 : 1); int dx = ply[nr].x - ply[nr].prev_x; - ply[nr].x = (ply[nr].x < lev.left ? lev.right - 1 : lev.left); + ply[nr].x += -direction * lev.width; ply[nr].prev_x = ply[nr].x - dx; + if (!lev.infinite_true) + { + int dy = ply[nr].y - ply[nr].prev_y; + + ply[nr].y += direction; + ply[nr].prev_y = ply[nr].y - dy; + } + /* draw player entering playfield from the opposite side */ blitplayer_ext(nr); @@ -666,8 +675,11 @@ void RedrawPlayfield_EM(boolean force_redraw) if (draw_new_player_location_wrap) { - // when wrapping around (horizontally), keep vertical player position - screen_yy = screen_y; + if (lev.infinite_true) + { + // 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;