From 6398316b1f5dada21192640b35c1c87b7399df82 Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 23 Jul 2007 12:05:41 +0000 Subject: [PATCH] SVN compiles here too git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2545 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/sys_sdl.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/engine/client/sys_sdl.c b/engine/client/sys_sdl.c index 39864662c..0ed62aa0b 100644 --- a/engine/client/sys_sdl.c +++ b/engine/client/sys_sdl.c @@ -41,6 +41,27 @@ void Sys_Printf (char *fmt, ...) va_end (argptr); } +unsigned int Sys_Milliseconds(void) +{ + static int first = true; + static unsigned long oldtime = 0, curtime = 0; + unsigned long newtime; + + newtime = SDL_GetTicks(); + + if (first) + { + first = false; + oldtime = newtime; + } + if (newtime < oldtime) + Con_Printf("Sys_Milliseconds stepped backwards!\n"); + else + curtime += oldtime - newtime; + oldtime = newtime; + return curtime; +} + //return the current time, in the form of a double double Sys_DoubleTime (void) { @@ -323,4 +344,4 @@ void Sys_CloseClipboard(char *bf) } void Sys_SaveClipboard(char *text) { -} \ No newline at end of file +}