diff --git a/doomsday/Src/sys_timer.c b/doomsday/Src/sys_timer.c index 50fca6d80e..ac50aa71af 100644 --- a/doomsday/Src/sys_timer.c +++ b/doomsday/Src/sys_timer.c @@ -18,20 +18,12 @@ /* * sys_timer.c: Timing Subsystem * - * Uses Win32 multimedia timing routines. + * Uses the SDL timing routines. */ // HEADER FILES ------------------------------------------------------------ -#include "de_platform.h" - -#ifdef WIN32 -# include -#endif - -#ifdef UNIX -# include -#endif +#include #include "de_base.h" #include "de_console.h" @@ -56,41 +48,23 @@ float ticsPerSecond = TICSPERSEC; // CODE -------------------------------------------------------------------- -//========================================================================== -// Sys_ShutdownTimer -//========================================================================== void Sys_ShutdownTimer(void) { -#ifdef WIN32 - timeEndPeriod(1); -#endif } -//========================================================================== -// Sys_InitTimer -//========================================================================== void Sys_InitTimer(void) { - Con_Message("Sys_InitTimer.\n"); -#ifdef WIN32 - timeBeginPeriod(1); -#endif + /*Con_Message("Sys_InitTimer.\n");*/ } -//=========================================================================== -// Sys_GetRealTime -// Returns the time in milliseconds. -//=========================================================================== +/* + * Returns the time in milliseconds. + */ unsigned int Sys_GetRealTime (void) { static boolean first = true; - static DWORD start; -#ifdef WIN32 - DWORD now = timeGetTime(); -#endif -#ifdef UNIX + static Uint32 start = 0; Uint32 now = SDL_GetTicks(); -#endif if(first) { @@ -105,39 +79,37 @@ unsigned int Sys_GetRealTime (void) return now - start; } -//=========================================================================== -// Sys_GetSeconds -// Returns the timer value in seconds. -//=========================================================================== +/* + * Returns the timer value in seconds. + */ double Sys_GetSeconds (void) { return (double) Sys_GetRealTime() / 1000.0; } -//=========================================================================== -// Sys_GetTimef -// Returns time in 35 Hz floating point tics. -//=========================================================================== +/* + * Returns time in 35 Hz floating point tics. + */ double Sys_GetTimef(void) { return (Sys_GetRealTime() / 1000.0 * ticsPerSecond); } -//========================================================================== -// Sys_GetTime -// Returns time in 35 Hz tics. -//========================================================================== +/* + * Returns time in 35 Hz tics. + */ int Sys_GetTime (void) { return (int) Sys_GetTimef(); } -//========================================================================== -// Sys_TicksPerSecond -// Set the number of game tics per second. -//========================================================================== +#if 0 +/* + * Set the number of game tics per second. + */ void Sys_TicksPerSecond(float num) { if(num <= 0) num = TICSPERSEC; ticsPerSecond = num; } +#endif