rnd-20060219-1-src
[rocksndiamonds.git] / src / tools.c
index a17057c8fb5204f19b3693538591ade91b4a860a..de8e9df3543af507fb16cd291b9906030906db26 100644 (file)
@@ -127,7 +127,11 @@ void RedrawPlayfield(boolean force_redraw, int x, int y, int width, int height)
   if (game_status == GAME_MODE_PLAYING &&
       level.game_engine_type == GAME_ENGINE_TYPE_EM)
   {
+#if 1
+    RedrawPlayfield_EM(force_redraw);
+#else
     BlitScreenToBitmap_EM(backbuffer);
+#endif
   }
   else if (game_status == GAME_MODE_PLAYING && !game.envelope_active)
   {
@@ -1827,6 +1831,13 @@ void DrawPlayer(struct PlayerInfo *player)
   int last_player_frame = player->Frame;
   int frame = 0;
 
+#if 1
+  /* GfxElement[][] is set to the element the player is digging or collecting;
+     remove also for off-screen player if the player is not moving anymore */
+  if (IN_LEV_FIELD(jx, jy) && !player_is_moving)
+    GfxElement[jx][jy] = EL_UNDEFINED;
+#endif
+
   if (!player->active || !IN_SCR_FIELD(SCREENX(last_jx), SCREENY(last_jy)))
     return;
 
@@ -5118,6 +5129,14 @@ int getGameFrameDelay_EM(int native_em_game_frame_delay)
   return game_frame_delay_value;
 }
 
+int getCenteredPlayer_EM()
+{
+  if (game.centered_to_player != game.centered_to_player_next)
+    game.centered_to_player = game.centered_to_player_next;
+
+  return game.centered_to_player;
+}
+
 unsigned int InitRND(long seed)
 {
   if (level.game_engine_type == GAME_ENGINE_TYPE_EM)