X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=sys_win.c;h=8e3c628f850ef06d14d2beb96aa4fee1db77458e;hb=40a6f67c7fc621ac5a0e531856e11a1ca8c40a96;hp=1479e7c8f9a7ab8a5cdc8fb6a78283a2d0b98bdf;hpb=483aebc27ed79f1477b144add31c6b09c58c2966;p=xonotic%2Fdarkplaces.git diff --git a/sys_win.c b/sys_win.c index 1479e7c8..8e3c628f 100644 --- a/sys_win.c +++ b/sys_win.c @@ -20,12 +20,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // sys_win.c -- Win32 system interface code #include "quakedef.h" -#include "winquake.h" +#include +#include #include "errno.h" #include "resource.h" #include "conproc.h" #include "direct.h" +extern void S_BlockSound (void); + cvar_t sys_usetimegettime = {CVAR_SAVE, "sys_usetimegettime", "1"}; // # of seconds to wait on Sys_Error running dedicated before exiting @@ -35,8 +38,6 @@ cvar_t sys_usetimegettime = {CVAR_SAVE, "sys_usetimegettime", "1"}; // sleep time when not focus #define NOT_FOCUS_SLEEP 20 -int starttime; - static qboolean sc_return_on_enter = false; HANDLE hinput, houtput; @@ -45,129 +46,6 @@ static HANDLE hFile; static HANDLE heventParent; static HANDLE heventChild; -/* -=============================================================================== - -QFile IO - -=============================================================================== -*/ - -// 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))) + while (*lpCmdLine && *lpCmdLine <= 32) lpCmdLine++; if (*lpCmdLine) { - argv[host_parms.argc] = lpCmdLine; - host_parms.argc++; + if (*lpCmdLine == '\"') + { + // quoted string + argv[com_argc] = lpCmdLine; + com_argc++; - while (*lpCmdLine && ((*lpCmdLine > 32) && (*lpCmdLine <= 126))) - lpCmdLine++; + while (*lpCmdLine && (*lpCmdLine != '\"')) + lpCmdLine++; - if (*lpCmdLine) - { - *lpCmdLine = 0; - lpCmdLine++; + if (*lpCmdLine) + { + *lpCmdLine = 0; + lpCmdLine++; + } + + if (*lpCmdLine == '\"') + lpCmdLine++; } + else + { + // unquoted word + argv[com_argc] = lpCmdLine; + com_argc++; + + while (*lpCmdLine && *lpCmdLine > 32) + lpCmdLine++; + if (*lpCmdLine) + { + *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) @@ -581,7 +438,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin Sys_Shared_LateInit(); frameoldtime = Sys_DoubleTime (); - + /* main window message loop */ while (1) { @@ -605,4 +462,3 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin /* return success of application */ return true; } -