From: Holger Schemel Date: Thu, 28 May 2020 16:28:24 +0000 (+0200) Subject: moved correcting playfield buffer scroll position to EM engine X-Git-Tag: 4.2.0.0~27 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=a0f9dd84ca26309a8ab518caed02a0ce7debd4e2;p=rocksndiamonds.git moved correcting playfield buffer scroll position to EM engine --- diff --git a/src/game.c b/src/game.c index f4ae9303..14c652b7 100644 --- a/src/game.c +++ b/src/game.c @@ -4394,15 +4394,6 @@ void UpdateEngineValues(int actual_scroll_x, int actual_scroll_y, { // 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; diff --git a/src/game_em/game.c b/src/game_em/game.c index 2d11170d..491c290d 100644 --- a/src/game_em/game.c +++ b/src/game_em/game.c @@ -92,7 +92,10 @@ void GameActions_EM(byte action[MAX_PLAYERS], boolean warp_mode) 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(); diff --git a/src/game_em/main_em.h b/src/game_em/main_em.h index cdb9325c..84d5509b 100644 --- a/src/game_em/main_em.h +++ b/src/game_em/main_em.h @@ -76,6 +76,9 @@ extern int SX, SY; #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