From 8bf81088836952a4f0263281560ef2127435e4b2 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 28 May 2020 17:35:22 +0200 Subject: [PATCH] added correcting playfield scroll position for EM engine --- src/game.c | 3 +++ src/tools.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/game.c b/src/game.c index 08b787fd..f4ae9303 100644 --- a/src/game.c +++ b/src/game.c @@ -4396,6 +4396,9 @@ void UpdateEngineValues(int actual_scroll_x, int actual_scroll_y, 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); } diff --git a/src/tools.c b/src/tools.c index 2bc7d4fe..70441d1c 100644 --- a/src/tools.c +++ b/src/tools.c @@ -291,8 +291,6 @@ static int getLevelFromScreenX_EM(int sx) int px = sx - SX; int lx = LEVELX((px + dx) / TILESIZE_VAR); - lx = correctLevelPosX_EM(lx); - return lx; } @@ -308,8 +306,6 @@ static int getLevelFromScreenY_EM(int sy) int py = sy - SY; int ly = LEVELY((py + dy) / TILESIZE_VAR); - ly = correctLevelPosY_EM(ly); - return ly; } -- 2.34.1