aboutsummaryrefslogtreecommitdiffstats
path: root/code/sys/sys_win32.c
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-08-03 19:42:53 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-08-03 19:42:53 +0000
commit4901c4880e652e5ff74bd759049ccf628d8fb4b4 (patch)
tree5342b157682affcfa7feb607c86e2007d3fe73e2 /code/sys/sys_win32.c
parent7e79fa2629cce14e4ee4649dec92468748109b59 (diff)
downloadioquake3-aero-4901c4880e652e5ff74bd759049ccf628d8fb4b4.tar.gz
ioquake3-aero-4901c4880e652e5ff74bd759049ccf628d8fb4b4.zip
* Change win32 client Sys_Sleep so it ONLY sleeps since before it was waking on
more or less any input event; fine for the server, not so much use for the client * In the main loop, don't bother sleeping if it's going to be less than 10ms as the methods we're using to sleep at the moment aren't very precise * Add Sys_PlatformInit for platform specific initialisation * In win32 Sys_PlatformInit force selection of the DirectX SDL backend in order to get better fullscreen mouse input (in conjunction with a patched SDL DLL http://bugzilla.libsdl.org/show_bug.cgi?id=265) git-svn-id: svn://svn.icculus.org/quake3/trunk@1434 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/sys/sys_win32.c')
-rw-r--r--code/sys/sys_win32.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/code/sys/sys_win32.c b/code/sys/sys_win32.c
index fb924e6..79998dc 100644
--- a/code/sys/sys_win32.c
+++ b/code/sys/sys_win32.c
@@ -514,7 +514,7 @@ void Sys_FreeFileList( char **list )
==============
Sys_Sleep
-Block execution for msec or until input is recieved.
+Block execution for msec or until input is received.
==============
*/
void Sys_Sleep( int msec )
@@ -522,10 +522,18 @@ void Sys_Sleep( int msec )
if( msec == 0 )
return;
+#ifdef DEDICATED
if( msec < 0 )
WaitForSingleObject( GetStdHandle( STD_INPUT_HANDLE ), INFINITE );
else
WaitForSingleObject( GetStdHandle( STD_INPUT_HANDLE ), msec );
+#else
+ // Client Sys_Sleep doesn't support waiting on stdin
+ if( msec < 0 )
+ return;
+
+ Sleep( msec );
+#endif
}
/*
@@ -568,3 +576,18 @@ void Sys_ErrorDialog( const char *error )
}
}
}
+
+/*
+==============
+Sys_PlatformInit
+
+Windows specific initialisation
+==============
+*/
+void Sys_PlatformInit( void )
+{
+#ifndef DEDICATED
+ // Force the DirectX SDL backend to be used
+ _putenv( "SDL_VIDEODRIVER=directx" );
+#endif
+}