From 77912538a71fe4bba85b97b873f937569d88998f Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 19 May 2015 00:58:19 +0200 Subject: [PATCH] cleanup of some common and specific game engine function calls --- src/game.c | 20 +++++--------------- src/game_em/input.c | 2 -- src/game_sp/main.c | 2 -- src/tools.c | 2 ++ 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/game.c b/src/game.c index cad2e92e..49acec5b 100644 --- a/src/game.c +++ b/src/game.c @@ -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); diff --git a/src/game_em/input.c b/src/game_em/input.c index e314272f..f7542440 100644 --- a/src/game_em/input.c +++ b/src/game_em/input.c @@ -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 */ diff --git a/src/game_sp/main.c b/src/game_sp/main.c index 51d799e7..f9dcecc5 100644 --- a/src/game_sp/main.c +++ b/src/game_sp/main.c @@ -58,8 +58,6 @@ void RedrawPlayfield_SP(boolean force_redraw) RestorePlayfield(); UpdatePlayfield(force_redraw); - - BlitScreenToBitmap_SP(backbuffer); } void UpdateGameDoorValues_SP() diff --git a/src/tools.c b/src/tools.c index 95bc7a45..2bfae3c9 100644 --- a/src/tools.c +++ b/src/tools.c @@ -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() -- 2.34.1