rocksndiamonds-3.3.0.0
[rocksndiamonds.git] / src / game_sp / MainGameLoop.c
index a82c8732f4846393e958441d10db97067b2a1528..48a1ac480480d7f726566432518004d3db5b7061 100644 (file)
@@ -6,7 +6,7 @@
 
 
 boolean bPlaying;
-int LeadOutCounter, EnterRepeatCounter;
+int LeadOutCounter;
 int ExitToMenuFlag;
 boolean AutoScrollFlag;
 
@@ -51,6 +51,11 @@ void subMainGameLoop_Main(byte action, boolean warp_mode)
 
   TimerVar = TimerVar + 1;
 
+#if 1
+  if (ExplosionShakeMurphy > 0)
+    ExplosionShakeMurphy--;
+#endif
+
 #if 1
   if (ExitToMenuFlag == 1)
   {
@@ -84,7 +89,7 @@ void subMainGameLoop_Main(byte action, boolean warp_mode)
 locExitMainGameLoop:
 #endif
 
-#if 1
+#if 0
   printf("::: locExitMainGameLoop reached [%d]\n", LeadOutCounter);
   printf("::: [KillMurphyFlag == %d]\n", KillMurphyFlag);
 #endif
@@ -98,11 +103,10 @@ locExitMainGameLoop:
 
 void subCalculateScreenScrollPos()
 {
-  int ax, Ay;
-
 #if 1
   int jump_pos = TILEX / 2;
 
+  /* handle wrap-around */
   if (MurphyScreenXPos < -jump_pos)
   {
     MurphyScreenXPos = FieldWidth * TILEX + MurphyScreenXPos;
@@ -122,11 +126,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;
 }