rnd-20100315-3-src
[rocksndiamonds.git] / src / game_sp / TickCountObject.c
index 9c8ba48adc3141b9d41ee2691d5fbde0bf900c6a..fae698ce5168d4b09902bdc00213766387227304 100644 (file)
 #define LongMin                        (-(double)2147483648UL) // the "#" sign is a bug of the VB environment AutoFormat function but causes no real problems; don't  worry 'bout it!
 #define LongMax                        (2147483647UL)
 
-long GetTickCount();
+#if 0
+
+long MyGetTickCount();
 long QueryPerformanceCounter(currency lpPerformanceCount);
 long QueryPerformanceFrequency(currency lpFrequency);
 
+#endif
+
 boolean DelayLoopActive;
 
 boolean MPause, bHighPerf;
 currency PFreq; // LARGE_INTEGER
 double sFactor, msFactor, usFactor;
 
+#if 0
+
 boolean TickCountObject_Get_Active()
 {
   boolean Active;
@@ -56,39 +62,6 @@ void TickCountObject_Let_Pause(boolean NewVal)
   MPause = NewVal;
 }
 
-void TickCountObject_DelayMS(long MSInterval, boolean DoEventsFlag) // in ms
-{
-  currency Start;
-
-  Start = TickCountObject_Get_TickNow();
-  DelayLoopActive = True;
-  do
-  {
-    if (DoEventsFlag)
-      DoEvents();
-
-    if (MSInterval <= TickCountObject_TickDiffMS(Start) && ! MPause)
-      break;
-  }
-  while (1);
-
-  DelayLoopActive = False;
-}
-
-// for compatibility with old code:
-void TickCountObject_DelayS(long SInterval, boolean DoEventsFlag) // in s
-{
-  // check if SInterval is less than 25 days ...
-  if ((int)(LongMax / 1000) <= SInterval)
-  {
-    Err.Raise(513, "Delay()", "Value Overflow");
-  }
-  else
-  {
-    TickCountObject_DelayMS((long)1000 * SInterval, DoEventsFlag);
-  }
-}
-
 currency TickCountObject_Get_TickNow()
 {
   currency TickNow;
@@ -99,7 +72,7 @@ currency TickCountObject_Get_TickNow()
   }
   else
   {
-    TickNow = GetTickCount();
+    TickNow = MyGetTickCount();
   }
 
   return TickNow;
@@ -119,7 +92,7 @@ long TickCountObject_TickDiffS(currency TickStart)
   }
   else
   {
-    NewTick = GetTickCount();
+    NewTick = MyGetTickCount();
     if (NewTick < TickStart)
     {
       // Overflow occured and needs to be handled
@@ -150,7 +123,7 @@ long TickCountObject_TickDiffMS(currency TickStart)
   }
   else
   {
-    NewTick = GetTickCount();
+    NewTick = MyGetTickCount();
     if (NewTick < TickStart)
     {
       // Overflow occured and needs to be handled
@@ -179,7 +152,7 @@ currency TickCountObject_TickDiffUS(currency TickStart)
   }
   else
   {
-    NewTick = GetTickCount();
+    NewTick = MyGetTickCount();
     if (NewTick < TickStart)
     {
       // Overflow occured and needs to be handled
@@ -194,6 +167,8 @@ currency TickCountObject_TickDiffUS(currency TickStart)
   return TickDiffUS;
 }
 
+#endif
+
 #if 0
 
 static void Class_Initialize()