projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added sending level set name when getting scores from server
[rocksndiamonds.git]
/
src
/
game_em
/
graphics.c
diff --git
a/src/game_em/graphics.c
b/src/game_em/graphics.c
index 19000a7de764047c836a1e6b2e943ccab698cf8a..398ae6e0e303254f319e69931debc5d4b8b0b291 100644
(file)
--- 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];
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;
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;
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);
/* draw player entering playfield from the opposite side */
blitplayer_ext(nr);
@@
-544,11
+553,13
@@
static void setMinimalPlayerBoundaries(int *sx1, int *sy1, int *sx2, int *sy2)
boolean checkIfAllPlayersFitToScreen(void)
{
int sx1 = 0, sy1 = 0, sx2 = 0, sy2 = 0;
boolean checkIfAllPlayersFitToScreen(void)
{
int sx1 = 0, sy1 = 0, sx2 = 0, sy2 = 0;
+ int scr_fieldx = getScreenFieldSizeX();
+ int scr_fieldy = getScreenFieldSizeY();
setMinimalPlayerBoundaries(&sx1, &sy1, &sx2, &sy2);
setMinimalPlayerBoundaries(&sx1, &sy1, &sx2, &sy2);
- return (sx2 - sx1 <=
SCR_FIELDX
* TILEX &&
- sy2 - sy1 <=
SCR_FIELDY
* TILEY);
+ return (sx2 - sx1 <=
scr_fieldx
* TILEX &&
+ sy2 - sy1 <=
scr_fieldy
* TILEY);
}
static void setScreenCenteredToAllPlayers(int *sx, int *sy)
}
static void setScreenCenteredToAllPlayers(int *sx, int *sy)
@@
-666,8
+677,11
@@
void RedrawPlayfield_EM(boolean force_redraw)
if (draw_new_player_location_wrap)
{
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;
// scrolling for wrapping should be faster than for switching players
wait_delay_value /= 4;