X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fgame_sp%2FMainGameLoop.c;h=e1a20b102466cfcf641c694ffa8bfc9b5125b15a;hp=b72852921178bfc94c229f60176ddd92ade58401;hb=c40a5c6109e586ce4049ca0900e5fb9c9ac60fb7;hpb=475d747d7f6122bf9b62ccf1518fc7e8fc0f201c diff --git a/src/game_sp/MainGameLoop.c b/src/game_sp/MainGameLoop.c index b7285292..e1a20b10 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 @@ -51,19 +51,13 @@ void subMainGameLoop_Main(byte action, boolean warp_mode) TimerVar = TimerVar + 1; -#if 1 + if (ExplosionShakeMurphy > 0) + ExplosionShakeMurphy--; + if (ExitToMenuFlag == 1) { // happens when demo ends or when Murphy enters exit (to be checked) - -#if 0 - goto locExitMainGameLoop; -#endif } -#else - if (ExitToMenuFlag == 1) - goto locExitMainGameLoop; -#endif if (LeadOutCounter == 0) // no lead-out: game busy return; @@ -80,28 +74,16 @@ void subMainGameLoop_Main(byte action, boolean warp_mode) // lead-out done: exit now // ---------------------- END OF GAME-BUSY LOOP (including lead-out) --------- -#if 0 -locExitMainGameLoop: -#endif - -#if 1 - printf("::: locExitMainGameLoop reached [%d]\n", LeadOutCounter); - printf("::: [KillMurphyFlag == %d]\n", KillMurphyFlag); -#endif - -#if 1 - /* if the game is not won when reaching this point, then it is lost */ - if (!game_sp.LevelSolved) - game_sp.GameOver = TRUE; -#endif + // if the game is not won when reaching this point, then it is lost + if (!game_sp.level_solved) + game_sp.game_over = TRUE; } -void subCalculateScreenScrollPos() +void subCalculateScreenScrollPos(void) { -#if 1 int jump_pos = TILEX / 2; - /* handle wrap-around */ + // handle wrap-around if (MurphyScreenXPos < -jump_pos) { MurphyScreenXPos = FieldWidth * TILEX + MurphyScreenXPos; @@ -112,7 +94,6 @@ void subCalculateScreenScrollPos() MurphyScreenXPos = MurphyScreenXPos - FieldWidth * TILEX; MurphyScreenYPos += TILEY; } -#endif if (ExplosionShake != 0) {