added correcting playfield scroll position for EM engine
authorHolger Schemel <info@artsoft.org>
Thu, 28 May 2020 15:35:22 +0000 (17:35 +0200)
committerHolger Schemel <info@artsoft.org>
Thu, 28 May 2020 16:16:58 +0000 (18:16 +0200)
src/game.c
src/tools.c

index 08b787fdc83c4f489ddf25ad467ad780825c5347..f4ae9303776da68ac2be4439c6b5ff651be2fe59 100644 (file)
@@ -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);
   }
index 2bc7d4fe9c000c06b4b429559be9aded895a52cc..70441d1c649eb06074c3fe77ef482de307668ac8 100644 (file)
@@ -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;
 }