{
// this is used for non-R'n'D game engines to update certain engine values
- if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
- {
- actual_scroll_x = correctLevelPosX_EM(actual_scroll_x);
- actual_scroll_y = correctLevelPosY_EM(actual_scroll_y);
-
- actual_player_x = correctLevelPosX_EM(actual_player_x);
- actual_player_y = correctLevelPosY_EM(actual_player_y);
- }
-
// needed to determine if sounds are played within the visible screen area
scroll_x = actual_scroll_x;
scroll_y = actual_scroll_y;
for (i = 0; i < MAX_PLAYERS; i++)
readjoy(action[i], &ply[i]);
- UpdateEngineValues(screen_x / TILEX, screen_y / TILEY, ply[0].x, ply[0].y);
+ UpdateEngineValues(CAVE_POS_X(screen_x / TILEX),
+ CAVE_POS_Y(screen_y / TILEY),
+ CAVE_POS_X(ply[0].x),
+ CAVE_POS_Y(ply[0].y));
logic();
#define DISPLAY_TIME(x) ROUNDED_DIVIDE(x, FRAMES_PER_SECOND)
+#define CAVE_POS_X(x) ((x) - lev.left)
+#define CAVE_POS_Y(x) ((x) - lev.top)
+
// ----------------------------------------------------------------------------
// data structure definitions