* handles transparency and movement
*/
-static void blitplayer(int nr)
+static void blitplayer_ext(int nr)
{
int x1, y1, x2, y2;
}
}
+static void blitplayer(int nr)
+{
+ blitplayer_ext(nr);
+
+ /* check for wrap-around movement ... */
+ if (ply[nr].x < lev.left ||
+ ply[nr].x > lev.right - 1)
+ {
+ struct PLAYER ply_last = ply[nr];
+ int dx = ply[nr].x - ply[nr].prev_x;
+
+ ply[nr].x = (ply[nr].x < lev.left ? lev.right - 1 : lev.left);
+ ply[nr].prev_x = ply[nr].x - dx;
+
+ /* draw player entering playfield from the opposite side */
+ blitplayer_ext(nr);
+
+ /* ... but keep the old player position until game logic */
+ ply[nr] = ply_last;
+ }
+}
+
void game_initscreen(void)
{
int player_nr;