1 /* 2000-08-13T14:36:17Z
3 * graphics manipulation crap
8 #define MIN_SCREEN_XPOS 1
9 #define MIN_SCREEN_YPOS 1
10 #define MAX_SCREEN_XPOS MAX(1, lev.width - (SCR_FIELDX - 1))
11 #define MAX_SCREEN_YPOS MAX(1, lev.height - (SCR_FIELDY - 1))
13 #define MIN_SCREEN_X (MIN_SCREEN_XPOS * TILEX)
14 #define MIN_SCREEN_Y (MIN_SCREEN_YPOS * TILEY)
15 #define MAX_SCREEN_X (MAX_SCREEN_XPOS * TILEX)
16 #define MAX_SCREEN_Y (MAX_SCREEN_YPOS * TILEY)
18 #define VALID_SCREEN_X(x) ((x) < MIN_SCREEN_X ? MIN_SCREEN_X : \
19 (x) > MAX_SCREEN_X ? MAX_SCREEN_X : (x))
20 #define VALID_SCREEN_Y(y) ((y) < MIN_SCREEN_Y ? MIN_SCREEN_Y : \
21 (y) > MAX_SCREEN_Y ? MAX_SCREEN_Y : (y))
23 #define PLAYER_SCREEN_X(p) ((( frame) * ply[p].oldx + \
24 (8 - frame) * ply[p].x) * TILEX / 8 \
25 - ((SCR_FIELDX - 1) * TILEX) / 2)
26 #define PLAYER_SCREEN_Y(p) ((( frame) * ply[p].oldy + \
27 (8 - frame) * ply[p].y) * TILEY / 8 \
28 - ((SCR_FIELDY - 1) * TILEY) / 2)
30 #define USE_EXTENDED_GRAPHICS_ENGINE 1
33 int frame; /* current screen frame */
34 int screen_x, screen_y; /* current scroll position */
36 /* tiles currently on screen */
37 static int screentiles[MAX_PLAYFIELD_HEIGHT + 2][MAX_PLAYFIELD_WIDTH + 2];
38 static int crumbled_state[MAX_PLAYFIELD_HEIGHT + 2][MAX_PLAYFIELD_WIDTH + 2];
40 /* copy the entire screen to the window at the scroll position */
42 void BlitScreenToBitmap_EM(Bitmap *target_bitmap)
44 int x = screen_x % (MAX_BUF_XSIZE * TILEX);
45 int y = screen_y % (MAX_BUF_YSIZE * TILEY);
46 int sx, sy, sxsize, sysize;
49 int full_xsize = lev.width * TILEX;
50 int full_ysize = lev.height * TILEY;
52 sxsize = (full_xsize < xsize ? full_xsize : xsize);
53 sysize = (full_ysize < ysize ? full_ysize : ysize);
54 sx = SX + (full_xsize < xsize ? (xsize - full_xsize) / 2 : 0);
55 sy = SY + (full_ysize < ysize ? (ysize - full_ysize) / 2 : 0);
57 if (x < 2 * TILEX && y < 2 * TILEY)
59 BlitBitmap(screenBitmap, target_bitmap, x, y,
60 sxsize, sysize, sx, sy);
62 else if (x < 2 * TILEX && y >= 2 * TILEY)
64 BlitBitmap(screenBitmap, target_bitmap, x, y,
65 sxsize, MAX_BUF_YSIZE * TILEY - y,
67 BlitBitmap(screenBitmap, target_bitmap, x, 0,
68 sxsize, y - 2 * TILEY,
69 sx, sy + MAX_BUF_YSIZE * TILEY - y);
71 else if (x >= 2 * TILEX && y < 2 * TILEY)
73 BlitBitmap(screenBitmap, target_bitmap, x, y,
74 MAX_BUF_XSIZE * TILEX - x, sysize,
76 BlitBitmap(screenBitmap, target_bitmap, 0, y,
77 x - 2 * TILEX, sysize,
78 sx + MAX_BUF_XSIZE * TILEX - x, sy);
82 BlitBitmap(screenBitmap, target_bitmap, x, y,
83 MAX_BUF_XSIZE * TILEX - x, MAX_BUF_YSIZE * TILEY - y,
85 BlitBitmap(screenBitmap, target_bitmap, 0, y,
86 x - 2 * TILEX, MAX_BUF_YSIZE * TILEY - y,
87 sx + MAX_BUF_XSIZE * TILEX - x, sy);
88 BlitBitmap(screenBitmap, target_bitmap, x, 0,
89 MAX_BUF_XSIZE * TILEX - x, y - 2 * TILEY,
90 sx, sy + MAX_BUF_YSIZE * TILEY - y);
91 BlitBitmap(screenBitmap, target_bitmap, 0, 0,
92 x - 2 * TILEX, y - 2 * TILEY,
93 sx + MAX_BUF_XSIZE * TILEX - x, sy + MAX_BUF_YSIZE * TILEY - y);
97 void BackToFront_EM(void)
99 /* blit all (up to four) parts of the scroll buffer to the backbuffer */
100 BlitScreenToBitmap_EM(backbuffer);
102 /* blit the completely updated backbuffer to the window (in one blit) */
103 BlitBitmap(backbuffer, window, SX, SY, SXSIZE, SYSIZE, SX, SY);
106 void blitscreen(void)
111 static struct GraphicInfo_EM *getObjectGraphic(int x, int y)
113 int tile = Draw[y][x];
114 struct GraphicInfo_EM *g = &graphic_info_em_object[tile][frame];
116 if (!game.use_native_emc_graphics_engine)
117 getGraphicSourceObjectExt_EM(g, tile, 7 - frame, x - 2, y - 2);
122 static struct GraphicInfo_EM *getPlayerGraphic(int player_nr, int anim)
124 struct GraphicInfo_EM *g = &graphic_info_em_player[player_nr][anim][frame];
126 if (!game.use_native_emc_graphics_engine)
127 getGraphicSourcePlayerExt_EM(g, player_nr, anim, 7 - frame);
132 static void DrawLevelField_EM(int x, int y, int sx, int sy,
135 struct GraphicInfo_EM *g = getObjectGraphic(x, y);
136 int src_x = g->src_x + g->src_offset_x * TILESIZE_VAR / TILESIZE;
137 int src_y = g->src_y + g->src_offset_y * TILESIZE_VAR / TILESIZE;
138 int dst_x = sx * TILEX + g->dst_offset_x * TILESIZE_VAR / TILESIZE;
139 int dst_y = sy * TILEY + g->dst_offset_y * TILESIZE_VAR / TILESIZE;
140 int width = g->width * TILESIZE_VAR / TILESIZE;
141 int height = g->height * TILESIZE_VAR / TILESIZE;
142 int left = screen_x / TILEX;
143 int top = screen_y / TILEY;
145 /* do not draw fields that are outside the visible screen area */
146 if (x < left || x >= left + MAX_BUF_XSIZE ||
147 y < top || y >= top + MAX_BUF_YSIZE)
152 if (width > 0 && height > 0)
153 BlitBitmapMasked(g->bitmap, screenBitmap,
154 src_x, src_y, width, height, dst_x, dst_y);
158 if ((width != TILEX || height != TILEY) && !g->preserve_background)
159 ClearRectangle(screenBitmap, sx * TILEX, sy * TILEY, TILEX, TILEY);
161 if (width > 0 && height > 0)
162 BlitBitmap(g->bitmap, screenBitmap,
163 src_x, src_y, width, height, dst_x, dst_y);
167 static void DrawLevelFieldCrumbled_EM(int x, int y, int sx, int sy,
168 int crm, boolean draw_masked)
170 struct GraphicInfo_EM *g;
171 int crumbled_border_size;
172 int left = screen_x / TILEX;
173 int top = screen_y / TILEY;
176 /* do not draw fields that are outside the visible screen area */
177 if (x < left || x >= left + MAX_BUF_XSIZE ||
178 y < top || y >= top + MAX_BUF_YSIZE)
181 if (crm == 0) /* no crumbled edges for this tile */
184 g = getObjectGraphic(x, y);
186 crumbled_border_size = g->crumbled_border_size * TILESIZE_VAR / TILESIZE;
188 for (i = 0; i < 4; i++)
192 int width, height, cx, cy;
194 if (i == 1 || i == 2)
196 width = crumbled_border_size;
198 cx = (i == 2 ? TILEX - crumbled_border_size : 0);
204 height = crumbled_border_size;
206 cy = (i == 3 ? TILEY - crumbled_border_size : 0);
209 if (width > 0 && height > 0)
211 int src_x = g->crumbled_src_x + cx;
212 int src_y = g->crumbled_src_y + cy;
213 int dst_x = sx * TILEX + cx;
214 int dst_y = sy * TILEY + cy;
217 BlitBitmapMasked(g->crumbled_bitmap, screenBitmap,
218 src_x, src_y, width, height, dst_x, dst_y);
220 BlitBitmap(g->crumbled_bitmap, screenBitmap,
221 src_x, src_y, width, height, dst_x, dst_y);
227 static void DrawLevelPlayer_EM(int x1, int y1, int player_nr, int anim,
230 struct GraphicInfo_EM *g = getPlayerGraphic(player_nr, anim);
231 int src_x = g->src_x, src_y = g->src_y;
234 /* do not draw fields that are outside the visible screen area */
235 if (x1 < screen_x - TILEX || x1 >= screen_x + MAX_BUF_XSIZE * TILEX ||
236 y1 < screen_y - TILEY || y1 >= screen_y + MAX_BUF_YSIZE * TILEY)
239 x1 %= MAX_BUF_XSIZE * TILEX;
240 y1 %= MAX_BUF_YSIZE * TILEY;
244 /* draw the player to current location */
247 BlitBitmapMasked(g->bitmap, screenBitmap,
248 src_x, src_y, TILEX, TILEY, dst_x, dst_y);
250 /* draw the player to opposite wrap-around column */
251 dst_x = x1 - MAX_BUF_XSIZE * TILEX;
253 BlitBitmapMasked(g->bitmap, screenBitmap,
254 g->src_x, g->src_y, TILEX, TILEY, dst_x, dst_y);
256 /* draw the player to opposite wrap-around row */
258 dst_y = y1 - MAX_BUF_YSIZE * TILEY;
259 BlitBitmapMasked(g->bitmap, screenBitmap,
260 g->src_x, g->src_y, TILEX, TILEY, dst_x, dst_y);
264 /* draw the player to current location */
267 BlitBitmap(g->bitmap, screenBitmap,
268 g->src_x, g->src_y, TILEX, TILEY, dst_x, dst_y);
270 /* draw the player to opposite wrap-around column */
271 dst_x = x1 - MAX_BUF_XSIZE * TILEX;
273 BlitBitmap(g->bitmap, screenBitmap,
274 g->src_x, g->src_y, TILEX, TILEY, dst_x, dst_y);
276 /* draw the player to opposite wrap-around row */
278 dst_y = y1 - MAX_BUF_YSIZE * TILEY;
279 BlitBitmap(g->bitmap, screenBitmap,
280 g->src_x, g->src_y, TILEX, TILEY, dst_x, dst_y);
284 /* draw differences between game tiles and screen tiles
286 * implicitly handles scrolling and restoring background under the sprites
289 static void animscreen(void)
292 int left = screen_x / TILEX;
293 int top = screen_y / TILEY;
294 static int xy[4][2] =
302 if (!game.use_native_emc_graphics_engine)
303 for (y = 2; y < EM_MAX_CAVE_HEIGHT - 2; y++)
304 for (x = 2; x < EM_MAX_CAVE_WIDTH - 2; x++)
305 SetGfxAnimation_EM(&graphic_info_em_object[Draw[y][x]][frame],
306 Draw[y][x], 7 - frame, x - 2, y - 2);
308 for (y = top; y < top + MAX_BUF_YSIZE; y++)
310 for (x = left; x < left + MAX_BUF_XSIZE; x++)
312 int sx = x % MAX_BUF_XSIZE;
313 int sy = y % MAX_BUF_YSIZE;
314 int tile = Draw[y][x];
315 struct GraphicInfo_EM *g = &graphic_info_em_object[tile][frame];
316 int obj = g->unique_identifier;
318 boolean redraw_screen_tile = FALSE;
320 /* re-calculate crumbled state of this tile */
321 if (g->has_crumbled_graphics)
323 for (i = 0; i < 4; i++)
325 int xx = x + xy[i][0];
326 int yy = y + xy[i][1];
329 if (xx < 0 || xx >= EM_MAX_CAVE_WIDTH ||
330 yy < 0 || yy >= EM_MAX_CAVE_HEIGHT)
333 tile_next = Draw[yy][xx];
335 if (!graphic_info_em_object[tile_next][frame].has_crumbled_graphics)
340 redraw_screen_tile = (screentiles[sy][sx] != obj ||
341 crumbled_state[sy][sx] != crm);
343 /* only redraw screen tiles if they (or their crumbled state) changed */
344 if (redraw_screen_tile)
346 DrawLevelField_EM(x, y, sx, sy, FALSE);
347 DrawLevelFieldCrumbled_EM(x, y, sx, sy, crm, FALSE);
349 screentiles[sy][sx] = obj;
350 crumbled_state[sy][sx] = crm;
357 /* blit players to the screen
359 * handles transparency and movement
362 static void blitplayer(struct PLAYER *ply)
369 /* x1/y1 are left/top and x2/y2 are right/down part of the player movement */
370 x1 = (frame * ply->oldx + (8 - frame) * ply->x) * TILEX / 8;
371 y1 = (frame * ply->oldy + (8 - frame) * ply->y) * TILEY / 8;
375 if ((int)(x2 - screen_x) < ((MAX_BUF_XSIZE - 1) * TILEX - 1) &&
376 (int)(y2 - screen_y) < ((MAX_BUF_YSIZE - 1) * TILEY - 1))
378 /* some casts to "int" are needed because of negative calculation values */
379 int dx = (int)ply->x - (int)ply->oldx;
380 int dy = (int)ply->y - (int)ply->oldy;
381 int old_x = (int)ply->oldx + (7 - (int)frame) * dx / 8;
382 int old_y = (int)ply->oldy + (7 - (int)frame) * dy / 8;
383 int new_x = old_x + SIGN(dx);
384 int new_y = old_y + SIGN(dy);
385 int old_sx = old_x % MAX_BUF_XSIZE;
386 int old_sy = old_y % MAX_BUF_YSIZE;
387 int new_sx = new_x % MAX_BUF_XSIZE;
388 int new_sy = new_y % MAX_BUF_YSIZE;
389 int new_crm = crumbled_state[new_sy][new_sx];
391 /* only diggable elements can be crumbled in the classic EM engine */
392 boolean player_is_digging = (new_crm != 0);
394 if (player_is_digging)
396 /* draw the field the player is moving to (under the player) */
397 DrawLevelField_EM(new_x, new_y, new_sx, new_sy, FALSE);
398 DrawLevelFieldCrumbled_EM(new_x, new_y, new_sx, new_sy, new_crm, FALSE);
400 /* draw the player (masked) over the element he is just digging away */
401 DrawLevelPlayer_EM(x1, y1, ply->num, ply->anim, TRUE);
403 /* draw the field the player is moving from (masked over the player) */
404 DrawLevelField_EM(old_x, old_y, old_sx, old_sy, TRUE);
408 /* draw the player under the element which is on the same field */
409 DrawLevelPlayer_EM(x1, y1, ply->num, ply->anim, FALSE);
411 /* draw the field the player is moving from (masked over the player) */
412 DrawLevelField_EM(old_x, old_y, old_sx, old_sy, TRUE);
414 /* draw the field the player is moving to (masked over the player) */
415 DrawLevelField_EM(new_x, new_y, new_sx, new_sy, TRUE);
418 /* redraw screen tiles in the next frame (player may have left the tiles) */
419 screentiles[old_sy][old_sx] = -1;
420 screentiles[new_sy][new_sx] = -1;
424 void game_initscreen(void)
431 player_nr = (game.centered_player_nr != -1 ? game.centered_player_nr : 0);
433 screen_x = VALID_SCREEN_X(PLAYER_SCREEN_X(player_nr));
434 screen_y = VALID_SCREEN_Y(PLAYER_SCREEN_Y(player_nr));
436 for (y = 0; y < MAX_BUF_YSIZE; y++)
438 for (x = 0; x < MAX_BUF_XSIZE; x++)
440 screentiles[y][x] = -1;
441 crumbled_state[y][x] = 0;
446 static int getMaxCenterDistancePlayerNr(int center_x, int center_y)
448 int max_dx = 0, max_dy = 0;
449 int player_nr = game_em.last_moving_player;
452 for (i = 0; i < MAX_PLAYERS; i++)
456 int sx = PLAYER_SCREEN_X(i);
457 int sy = PLAYER_SCREEN_Y(i);
459 if (game_em.last_player_direction[i] != MV_NONE &&
460 (ABS(sx - center_x) > max_dx ||
461 ABS(sy - center_y) > max_dy))
463 max_dx = MAX(max_dx, ABS(sx - center_x));
464 max_dy = MAX(max_dy, ABS(sy - center_y));
474 static void setMinimalPlayerBoundaries(int *sx1, int *sy1, int *sx2, int *sy2)
476 boolean num_checked_players = 0;
479 for (i = 0; i < MAX_PLAYERS; i++)
483 int sx = PLAYER_SCREEN_X(i);
484 int sy = PLAYER_SCREEN_Y(i);
486 if (num_checked_players == 0)
493 *sx1 = MIN(*sx1, sx);
494 *sy1 = MIN(*sy1, sy);
495 *sx2 = MAX(*sx2, sx);
496 *sy2 = MAX(*sy2, sy);
499 num_checked_players++;
504 boolean checkIfAllPlayersFitToScreen()
506 int sx1 = 0, sy1 = 0, sx2 = 0, sy2 = 0;
508 setMinimalPlayerBoundaries(&sx1, &sy1, &sx2, &sy2);
510 return (sx2 - sx1 <= SCR_FIELDX * TILEX &&
511 sy2 - sy1 <= SCR_FIELDY * TILEY);
514 static void setScreenCenteredToAllPlayers(int *sx, int *sy)
516 int sx1 = screen_x, sy1 = screen_y, sx2 = screen_x, sy2 = screen_y;
518 setMinimalPlayerBoundaries(&sx1, &sy1, &sx2, &sy2);
520 *sx = (sx1 + sx2) / 2;
521 *sy = (sy1 + sy2) / 2;
524 static void setMaxCenterDistanceForAllPlayers(int *max_dx, int *max_dy,
525 int center_x, int center_y)
527 int sx1 = center_x, sy1 = center_y, sx2 = center_x, sy2 = center_y;
529 setMinimalPlayerBoundaries(&sx1, &sy1, &sx2, &sy2);
531 *max_dx = MAX(ABS(sx1 - center_x), ABS(sx2 - center_x));
532 *max_dy = MAX(ABS(sy1 - center_y), ABS(sy2 - center_y));
535 static boolean checkIfAllPlayersAreVisible(int center_x, int center_y)
539 setMaxCenterDistanceForAllPlayers(&max_dx, &max_dy, center_x, center_y);
541 return (max_dx <= SCR_FIELDX * TILEX / 2 &&
542 max_dy <= SCR_FIELDY * TILEY / 2);
545 void RedrawPlayfield_EM(boolean force_redraw)
547 boolean draw_new_player_location = FALSE;
548 boolean quick_relocation = setup.quick_switch;
549 int max_center_distance_player_nr =
550 getMaxCenterDistancePlayerNr(screen_x, screen_y);
551 int stepsize = TILEX / 8;
552 int offset = game.scroll_delay_value * TILEX;
553 int offset_x = offset;
554 int offset_y = offset;
555 int screen_x_old = screen_x;
556 int screen_y_old = screen_y;
560 if (game.set_centered_player)
562 boolean all_players_fit_to_screen = checkIfAllPlayersFitToScreen();
564 /* switching to "all players" only possible if all players fit to screen */
565 if (game.centered_player_nr_next == -1 && !all_players_fit_to_screen)
567 game.centered_player_nr_next = game.centered_player_nr;
568 game.set_centered_player = FALSE;
571 /* do not switch focus to non-existing (or non-active) player */
572 if (game.centered_player_nr_next >= 0 &&
573 !ply[game.centered_player_nr_next].alive)
575 game.centered_player_nr_next = game.centered_player_nr;
576 game.set_centered_player = FALSE;
580 /* also allow focus switching when screen is scrolled to half tile */
581 if (game.set_centered_player)
583 game.centered_player_nr = game.centered_player_nr_next;
585 draw_new_player_location = TRUE;
588 game.set_centered_player = FALSE;
591 if (game.centered_player_nr == -1)
593 if (draw_new_player_location || offset == 0)
595 setScreenCenteredToAllPlayers(&sx, &sy);
599 sx = PLAYER_SCREEN_X(max_center_distance_player_nr);
600 sy = PLAYER_SCREEN_Y(max_center_distance_player_nr);
605 sx = PLAYER_SCREEN_X(game.centered_player_nr);
606 sy = PLAYER_SCREEN_Y(game.centered_player_nr);
609 if (draw_new_player_location && quick_relocation)
611 screen_x = VALID_SCREEN_X(sx);
612 screen_y = VALID_SCREEN_Y(sy);
613 screen_x_old = screen_x;
614 screen_y_old = screen_y;
617 if (draw_new_player_location && !quick_relocation)
619 unsigned int game_frame_delay_value = getGameFrameDelay_EM(20);
620 int wait_delay_value = game_frame_delay_value;
621 int screen_xx = VALID_SCREEN_X(sx);
622 int screen_yy = VALID_SCREEN_Y(sy);
624 while (screen_x != screen_xx || screen_y != screen_yy)
626 int dx = (screen_xx < screen_x ? +1 : screen_xx > screen_x ? -1 : 0);
627 int dy = (screen_yy < screen_y ? +1 : screen_yy > screen_y ? -1 : 0);
628 int dxx = 0, dyy = 0;
630 if (dx == 0 && dy == 0) /* no scrolling needed at all */
633 if (ABS(screen_xx - screen_x) >= TILEX)
635 screen_x -= dx * TILEX;
636 dxx = dx * TILEX / 2;
640 screen_x = screen_xx;
644 if (ABS(screen_yy - screen_y) >= TILEY)
646 screen_y -= dy * TILEY;
647 dyy = dy * TILEY / 2;
651 screen_y = screen_yy;
655 /* scroll in two steps of half tile size to make things smoother */
661 for (i = 0; i < MAX_PLAYERS; i++)
666 Delay(wait_delay_value);
668 /* scroll second step to align at full tile size */
674 for (i = 0; i < MAX_PLAYERS; i++)
679 Delay(wait_delay_value);
682 screen_x_old = screen_x;
683 screen_y_old = screen_y;
688 for (y = 0; y < MAX_BUF_YSIZE; y++)
690 for (x = 0; x < MAX_BUF_XSIZE; x++)
692 screentiles[y][x] = -1;
693 crumbled_state[y][x] = 0;
698 /* calculate new screen scrolling position, with regard to scroll delay */
699 screen_x = VALID_SCREEN_X(sx + offset_x < screen_x ? sx + offset_x :
700 sx - offset_x > screen_x ? sx - offset_x :
702 screen_y = VALID_SCREEN_Y(sy + offset_y < screen_y ? sy + offset_y :
703 sy - offset_y > screen_y ? sy - offset_y :
706 /* prevent scrolling further than double player step size when scrolling */
707 if (ABS(screen_x - screen_x_old) > 2 * stepsize)
709 int dx = SIGN(screen_x - screen_x_old);
711 screen_x = screen_x_old + dx * 2 * stepsize;
713 if (ABS(screen_y - screen_y_old) > 2 * stepsize)
715 int dy = SIGN(screen_y - screen_y_old);
717 screen_y = screen_y_old + dy * 2 * stepsize;
720 /* prevent scrolling away from the other players when focus on all players */
721 if (game.centered_player_nr == -1)
723 /* check if all players are still visible with new scrolling position */
724 if (checkIfAllPlayersAreVisible(screen_x_old, screen_y_old) &&
725 !checkIfAllPlayersAreVisible(screen_x, screen_y))
727 /* reset horizontal scroll position to last value, if needed */
728 if (!checkIfAllPlayersAreVisible(screen_x, screen_y_old))
729 screen_x = screen_x_old;
731 /* reset vertical scroll position to last value, if needed */
732 if (!checkIfAllPlayersAreVisible(screen_x_old, screen_y))
733 screen_y = screen_y_old;
737 /* prevent scrolling (for screen correcting) if no player is moving */
738 if (!game_em.any_player_moving)
740 screen_x = screen_x_old;
741 screen_y = screen_y_old;
745 /* prevent scrolling against the players move direction */
746 int player_nr = (game.centered_player_nr == -1 ?
747 max_center_distance_player_nr : game.centered_player_nr);
748 int player_move_dir = game_em.last_player_direction[player_nr];
749 int dx = SIGN(screen_x - screen_x_old);
750 int dy = SIGN(screen_y - screen_y_old);
752 if ((dx < 0 && player_move_dir != MV_LEFT) ||
753 (dx > 0 && player_move_dir != MV_RIGHT))
754 screen_x = screen_x_old;
756 if ((dy < 0 && player_move_dir != MV_UP) ||
757 (dy > 0 && player_move_dir != MV_DOWN))
758 screen_y = screen_y_old;
763 for (i = 0; i < MAX_PLAYERS; i++)
767 void game_animscreen(void)
769 RedrawPlayfield_EM(FALSE);