X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=sys_win.c;h=e5655b653768b125371f396bd8e60ec9b8c82fb5;hb=f7c977317897310bddfd6f32e179a79e2c1caa14;hp=7ec988cc567c47ea94df7c8648a69db1c60276b5;hpb=c294ce3a35d87288b409172ca109a734cfadb21c;p=xonotic%2Fdarkplaces.git diff --git a/sys_win.c b/sys_win.c index 7ec988cc..e5655b65 100644 --- a/sys_win.c +++ b/sys_win.c @@ -19,8 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // sys_win.c -- Win32 system interface code -#define WIN32_USETIMEGETTIME 0 - #include "quakedef.h" #include "winquake.h" #include "errno.h" @@ -28,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "conproc.h" #include "direct.h" +cvar_t sys_usetimegettime = {CVAR_SAVE, "sys_usetimegettime", "1"}; + // # of seconds to wait on Sys_Error running dedicated before exiting #define CONSOLE_ERROR_TIMEOUT 60.0 // sleep time on pause or minimization @@ -36,7 +36,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define NOT_FOCUS_SLEEP 20 int starttime; -qboolean ActiveApp, Minimized; static qboolean sc_return_on_enter = false; HANDLE hinput, houtput; @@ -46,127 +45,28 @@ static HANDLE hFile; static HANDLE heventParent; static HANDLE heventChild; + /* =============================================================================== -QFile IO +DLL MANAGEMENT =============================================================================== */ -// LordHavoc: 256 pak files (was 10) -#define MAX_HANDLES 256 -QFile *sys_handles[MAX_HANDLES]; - -int findhandle (void) -{ - int i; - - for (i=1 ; i 126))) lpCmdLine++; if (*lpCmdLine) { - argv[host_parms.argc] = lpCmdLine; - host_parms.argc++; + argv[com_argc] = lpCmdLine; + com_argc++; while (*lpCmdLine && ((*lpCmdLine > 32) && (*lpCmdLine <= 126))) lpCmdLine++; @@ -513,19 +413,14 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin *lpCmdLine = 0; lpCmdLine++; } - } } - - host_parms.argv = argv; - - COM_InitArgv (host_parms.argc, host_parms.argv); - - host_parms.argc = com_argc; - host_parms.argv = com_argv; + com_argv = argv; Sys_Shared_EarlyInit(); + Cvar_RegisterVariable(&sys_usetimegettime); + tevent = CreateEvent(NULL, false, false, NULL); if (!tevent) @@ -570,7 +465,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin Sys_Shared_LateInit(); - oldtime = Sys_DoubleTime (); + frameoldtime = Sys_DoubleTime (); /* main window message loop */ while (1) @@ -578,18 +473,18 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin if (cls.state != ca_dedicated) { // yield the CPU for a little while when paused, minimized, or not the focus - if ((cl.paused && !ActiveApp) || Minimized) + if ((cl.paused && !vid_activewindow) || vid_hidden) { SleepUntilInput (PAUSE_SLEEP); scr_skipupdate = 1; // no point in bothering to draw } - else if (!ActiveApp) + else if (!vid_activewindow) SleepUntilInput (NOT_FOCUS_SLEEP); } - newtime = Sys_DoubleTime (); - Host_Frame (newtime - oldtime); - oldtime = newtime; + framenewtime = Sys_DoubleTime (); + Host_Frame (framenewtime - frameoldtime); + frameoldtime = framenewtime; } /* return success of application */