From: Holger Schemel Date: Sun, 10 Mar 2024 20:26:56 +0000 (+0100) Subject: added scrolling without iterating BD engine if player out of sight X-Git-Tag: 4.4.0.0-test-1~211 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=7f40069aab8fb0a1055c82ce17502f5ec81fefdd;p=rocksndiamonds.git added scrolling without iterating BD engine if player out of sight This is needed to prevent broken tapes in case of viewport or tile size changes and may occur in case of wrap-around at level borders. Before, recording tape events was continued during scrolling, even though the BD game engine did not iterate while scrolling the cave to the visual player position. This could result in broken tapes if the tape was replayed with a different playing viewport or with a different tile size (like using "small game elements" from the setup menu), as this would have an effect on the duration of scrolling, causing tape events and game engine running out of sync. --- diff --git a/src/game_bd/main_bd.c b/src/game_bd/main_bd.c index fcd2a23d..a854786e 100644 --- a/src/game_bd/main_bd.c +++ b/src/game_bd/main_bd.c @@ -386,6 +386,19 @@ void GameActions_BD(byte action[MAX_PLAYERS]) play_game_func(game_bd.game, action[0]); + // scroll without iterating engine if player out of sight (mainly due to wrap-around) + // (this is needed to prevent broken tapes in case of viewport or tile size changes) + while (game_bd.game->out_of_window) + { + RedrawPlayfield_BD(TRUE); + + BlitScreenToBitmap_BD(backbuffer); + + BackToFront(); + + play_game_func(game_bd.game, action[0]); + } + RedrawPlayfield_BD(FALSE); UpdateGameDoorValues_BD();