X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FMainGameLoop.c;h=39580a30f6ea5f81dbf22eccef16657f2850ca4c;hb=4b979559210bd4da7da9d6c94643823748df23ae;hp=61d5ed1c663414e456599b12037af2eb2a1805ec;hpb=3ff2e8a0b5c27b99a9920bdf5ed82bc41bf40181;p=rocksndiamonds.git diff --git a/src/game_sp/MainGameLoop.c b/src/game_sp/MainGameLoop.c index 61d5ed1c..39580a30 100644 --- a/src/game_sp/MainGameLoop.c +++ b/src/game_sp/MainGameLoop.c @@ -16,7 +16,7 @@ boolean AutoScrollFlag; // Play a game/demo // ========================================================================== -void subMainGameLoop_Init() +void subMainGameLoop_Init(void) { // This was a bug in the original Supaplex: sometimes red disks could not // be released. This happened if Murphy was killed DURING a red disk release @@ -25,7 +25,7 @@ void subMainGameLoop_Init() RedDiskReleasePhase = 0; // (re-)enable red disk release } -void subMainGameLoop_Main(byte action, boolean warp_mode) +void subMainGameLoop_Main(byte action) { // --------------------------------------------------------------------------- // --------------------- START OF GAME-BUSY LOOP ----------------------------- @@ -66,6 +66,10 @@ void subMainGameLoop_Main(byte action, boolean warp_mode) // ---------------------- END OF GAME-BUSY LOOP ------------------------------ // --------------------------------------------------------------------------- + // if the game is not won when reaching this point, then it is lost + if (!game_sp.level_solved) + game_sp.game_over = TRUE; + LeadOutCounter = LeadOutCounter - 1; // do more lead-out after quit if (LeadOutCounter != 0) // lead-out not ready: more @@ -73,17 +77,13 @@ void subMainGameLoop_Main(byte action, boolean warp_mode) // lead-out done: exit now // ---------------------- END OF GAME-BUSY LOOP (including lead-out) --------- - - /* if the game is not won when reaching this point, then it is lost */ - if (!game_sp.LevelSolved) - game_sp.GameOver = TRUE; } -void subCalculateScreenScrollPos() +void subCalculateScreenScrollPos(void) { int jump_pos = TILEX / 2; - /* handle wrap-around */ + // handle wrap-around if (MurphyScreenXPos < -jump_pos) { MurphyScreenXPos = FieldWidth * TILEX + MurphyScreenXPos; @@ -99,7 +99,7 @@ void subCalculateScreenScrollPos() { subGetRandomNumber(); - // printf("::: ExplosionShake [%d]\n", FrameCounter); + // Debug("game:playing:SP", "ExplosionShake [%d]", FrameCounter); } ScreenScrollXPos = MurphyScreenXPos - (SCR_FIELDX / 2) * TILESIZE;