rnd-20090722-2-src
[rocksndiamonds.git] / src / game_sp / MainGameLoop.c
index 2852dd0639494e48b662ddb0b8f50c4adbadb4d4..b4a91d006f98a80db10eb77fbad667a2988256c0 100644 (file)
@@ -28,8 +28,10 @@ int subMainGameLoop()
 
   // int al, bx;
   int bx;
+#if 0
   TickCountObject Clock;
   currency LastFrame;
+#endif
 
   if (DemoFlag != 0)
   {
@@ -86,10 +88,16 @@ locRepeatMainGameLoop:                           // start repeating game loop
   {
     DoEvents(); // user may klick on menus or move the window here ...
   }
+#if 1
+  while (0);
+#else
   while (Clock.TickDiffUS(LastFrame) < DeltaT); // wait till its time for the next frame
+#endif
 
   //   never any additional code between here!
-  LastFrame = Clock.TickNow; // store the frame time
+#if 0
+  LastFrame = Clock.TickNow(); // store the frame time
+#endif
   //   never any additional code between here!
   if (! NoDisplayFlag) // copy the BackBuffer(=Stage) to visible screen
     Stage.Blt();
@@ -189,7 +197,11 @@ locExitMainGameLoop:
   {
     DoEvents(); // user may klick on menus or move the window here ...
   }
+#if 1
+  while (0);
+#else
   while (Clock.TickDiffUS(LastFrame) < DeltaT); // wait till its time for the next frame
+#endif
 
   Stage.Blt(); // blit the last frame
   GameLoopRunning = 0;
@@ -236,9 +248,16 @@ int subCalculateScreenScrollPos()
     ax = MainForm.picPane.Width / 2;
     Ay = MainForm.picPane.Height / 2;
   }
+
   ScreenScrollXPos = Stretch * (MurphyScreenXPos + 8) - ax;
   ScreenScrollYPos = Stretch * (MurphyScreenYPos + 8) - Ay;
 
+#if 0
+  printf("::: MainGameLoop.c: subCalculateScreenScrollPos(): %d, %d [%d, %d] -> %d, %d\n",
+        MainForm.picPane.Width, MainForm.picPane.Height,
+        MurphyScreenXPos, MurphyScreenYPos,
+        ScreenScrollXPos, ScreenScrollYPos);
+#endif
+
   return subCalculateScreenScrollPos;
 }
-