cleanup of some common and specific game engine function calls
authorHolger Schemel <info@artsoft.org>
Mon, 18 May 2015 22:58:19 +0000 (00:58 +0200)
committerHolger Schemel <info@artsoft.org>
Mon, 18 May 2015 22:58:19 +0000 (00:58 +0200)
src/game.c
src/game_em/input.c
src/game_sp/main.c
src/tools.c

index cad2e92e227f2601b9973dadeb66bac58a3f3f28..49acec5bed46a4c70b979dd4fc3f5d795284c645 100644 (file)
@@ -11197,7 +11197,11 @@ void GameActions()
     GameActions_RND_Main();
   }
 
-  redraw_mask |= REDRAW_FIELD;
+  BlitScreenToBitmap(backbuffer);
+
+  CheckLevelTime();
+
+  AdvanceFrameAndPlayerCounters(-1);   /* advance counters for all players */
 }
 
 void GameActions_EM_Main()
@@ -11210,10 +11214,6 @@ void GameActions_EM_Main()
     effective_action[i] = stored_player[i].effective_action;
 
   GameActions_EM(effective_action, warp_mode);
-
-  CheckLevelTime();
-
-  AdvanceFrameAndPlayerCounters(-1);   /* advance counters for all players */
 }
 
 void GameActions_SP_Main()
@@ -11226,17 +11226,11 @@ void GameActions_SP_Main()
     effective_action[i] = stored_player[i].effective_action;
 
   GameActions_SP(effective_action, warp_mode);
-
-  CheckLevelTime();
-
-  AdvanceFrameAndPlayerCounters(-1);   /* advance counters for all players */
 }
 
 void GameActions_RND_Main()
 {
   GameActions_RND();
-
-  BlitScreenToBitmap_RND(backbuffer);
 }
 
 void GameActions_RND()
@@ -11738,8 +11732,6 @@ void GameActions_RND()
   }
 #endif
 
-  CheckLevelTime();
-
   DrawAllPlayers();
   PlayAllPlayersSound();
 
@@ -11762,8 +11754,6 @@ void GameActions_RND()
     redraw_mask |= REDRAW_FPS;
   }
 
-  AdvanceFrameAndPlayerCounters(-1);   /* advance counters for all players */
-
   if (local_player->show_envelope != 0 && local_player->MovPos == 0)
   {
     ShowEnvelope(local_player->show_envelope - EL_ENVELOPE_1);
index e314272f5315158d1b6aaca80a3587dcf8cbc37e..f7542440b6e3270185962a36e1cd3c1a9570920c 100644 (file)
@@ -110,8 +110,6 @@ void GameActions_EM(byte action[MAX_PLAYERS], boolean warp_mode)
                         game_em.any_player_snapping, any_player_dropping);
 
   RedrawPlayfield_EM(FALSE);
-
-  BlitScreenToBitmap_EM(backbuffer);
 }
 
 /* read input device for players */
index 51d799e7945ae249e6c8334b3ff7143284d6d8b8..f9dcecc5b63d377473810d2a8611166c5b9bd0cd 100644 (file)
@@ -58,8 +58,6 @@ void RedrawPlayfield_SP(boolean force_redraw)
     RestorePlayfield();
 
   UpdatePlayfield(force_redraw);
-
-  BlitScreenToBitmap_SP(backbuffer);
 }
 
 void UpdateGameDoorValues_SP()
index 95bc7a45ac7bbdc8a83c1e6267b8314f43c446b4..2bfae3c978c65ebf24d7dd2058ffdfb0656175de 100644 (file)
@@ -415,6 +415,8 @@ void BlitScreenToBitmap(Bitmap *target_bitmap)
     BlitScreenToBitmap_SP(target_bitmap);
   else if (level.game_engine_type == GAME_ENGINE_TYPE_RND)
     BlitScreenToBitmap_RND(target_bitmap);
+
+  redraw_mask |= REDRAW_FIELD;
 }
 
 void BackToFront_OLD()