major cleanup of preprocessor hell
[rocksndiamonds.git] / src / game_sp / MainGameLoop.c
index a82c8732f4846393e958441d10db97067b2a1528..61d5ed1c663414e456599b12037af2eb2a1805ec 100644 (file)
@@ -6,7 +6,7 @@
 
 
 boolean bPlaying;
-int LeadOutCounter, EnterRepeatCounter;
+int LeadOutCounter;
 int ExitToMenuFlag;
 boolean AutoScrollFlag;
 
@@ -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,29 +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
 }
 
 void subCalculateScreenScrollPos()
 {
-  int ax, Ay;
-
-#if 1
   int jump_pos = TILEX / 2;
 
+  /* handle wrap-around */
   if (MurphyScreenXPos < -jump_pos)
   {
     MurphyScreenXPos = FieldWidth * TILEX + MurphyScreenXPos;
@@ -113,7 +94,6 @@ void subCalculateScreenScrollPos()
     MurphyScreenXPos = MurphyScreenXPos - FieldWidth * TILEX;
     MurphyScreenYPos += TILEY;
   }
-#endif
 
   if (ExplosionShake != 0)
   {
@@ -122,11 +102,6 @@ void subCalculateScreenScrollPos()
     // printf("::: ExplosionShake [%d]\n", FrameCounter);
   }
 
-  {
-    ax = SXSIZE / 2;
-    Ay = SYSIZE / 2;
-  }
-
-  ScreenScrollXPos = Stretch * (MurphyScreenXPos + TILEX / 2) - ax;
-  ScreenScrollYPos = Stretch * (MurphyScreenYPos + TILEY / 2) - Ay;
+  ScreenScrollXPos = MurphyScreenXPos - (SCR_FIELDX / 2) * TILESIZE;
+  ScreenScrollYPos = MurphyScreenYPos - (SCR_FIELDY / 2) * TILESIZE;
 }