From 26c0d830b2c68f3b21f69e49a08f6e431dd762c3 Mon Sep 17 00:00:00 2001 From: Marcus Sundberg Date: Tue, 4 Jan 2000 23:36:31 +0000 Subject: [PATCH] Fix includes. filelength() is unused and breaks compile on mingw32. Copied Sys_FileOpenRead() and Sys_DoubleTime() from qw_client/sys_win.c --- uquake/sys_win.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/uquake/sys_win.c b/uquake/sys_win.c index 510dbac..414ff09 100644 --- a/uquake/sys_win.c +++ b/uquake/sys_win.c @@ -21,9 +21,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" #include "winquake.h" -#include "errno.h" #include "resource.h" -#include "conproc.h" +#include +#include +#include #define MINIMUM_WIN_MEMORY 0x0880000 #define MAXIMUM_WIN_MEMORY 0x1000000 @@ -108,6 +109,7 @@ int findhandle (void) return -1; } +#if 0 /* ================ filelength @@ -130,6 +132,7 @@ int filelength (FILE *f) return end; } +#endif int Sys_FileOpenRead (char *path, int *hndl) { @@ -304,6 +307,7 @@ void Sys_Init (void) MaskExceptions (); Sys_SetFPCW (); +#if 0 if (!QueryPerformanceFrequency (&PerformanceFreq)) Sys_Error ("No hardware timer available"); @@ -324,6 +328,7 @@ void Sys_Init (void) pfreq = 1.0 / (double)lowpart; Sys_InitFloatTime (); +#endif vinfo.dwOSVersionInfoSize = sizeof(vinfo); @@ -459,6 +464,7 @@ void Sys_Quit (void) } +#if 0 /* ================ Sys_DoubleTime @@ -550,7 +556,31 @@ void Sys_InitFloatTime (void) lastcurtime = curtime; } +#endif +double Sys_DoubleTime (void) +{ + static DWORD starttime; + static qboolean first = true; + DWORD now; + double t; + + now = timeGetTime(); + + if (first) { + first = false; + starttime = now; + return 0.0; + } + + if (now < starttime) // wrapped? + return (now / 1000.0) + (LONG_MAX - starttime / 1000.0); + + if (now - starttime == 0) + return 0.0; + + return (now - starttime) / 1000.0; +} char *Sys_ConsoleInput (void) {