-/**
- * \fn Sint64 now()
- * \brief Return the current timestamp
- */
-Sint64 now()
-{
- return giTimestamp;
-}
-
-/**
- * \fn void Timer_CallTimers()
- */
-void Timer_CallTimers()
-{
- int i;
- void (*callback)(void *);
-
- for(i = 0;
- i < NUM_TIMERS;
- i ++)
- {
- //Log("Timer %i", i);
- if(gTimers[i].Callback == NULL) continue;
- Log("%i - %lli < %lli", i, giTimestamp, gTimers[i].FiresAfter);
- if(giTimestamp < gTimers[i].FiresAfter) continue;
- callback = gTimers[i].Callback;
- gTimers[i].Callback = NULL;
- callback(gTimers[i].Argument);
- }
-}
-
-/**
- * \fn int Time_CreateTimer(int Delta, void *Callback, void *Argument)
- */
-int Time_CreateTimer(int Delta, void *Callback, void *Argument)
-{
- int ret;
-
- if(Callback == NULL) return -1;
-
- for(ret = 0;
- ret < NUM_TIMERS;
- ret++)
- {
- if(gTimers[ret].Callback != NULL) continue;
- gTimers[ret].Callback = Callback;
- gTimers[ret].FiresAfter = giTimestamp + Delta;
- gTimers[ret].Argument = Argument;
- Log("Callback = %p", Callback);
- Log("Timer %i fires at %lli", ret, gTimers[ret].FiresAfter);
- return ret;
- }
- return -1;
-}
-
-/**
- * \fn void Time_RemoveTimer(int ID)
- */
-void Time_RemoveTimer(int ID)
-{
- if(ID < 0 || ID >= NUM_TIMERS) return;
- gTimers[ID].Callback = NULL;
-}
-
-/**
- * \fn void Time_Delay(int Delay)
- * \brief Delay for a small ammount of time
- */
-void Time_Delay(int Delay)