X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=sys_win.c;h=34f82380330afe6abc830bd18d617b3bb0fc4a13;hb=ce694ae34316a68c27c20a5f7ddbed0fa8729d94;hp=e23c8b3fee1bbc5aa64b744e98611e3195126d4b;hpb=7fa5957d85ab7a56eba255510a3aa4e5fe4106f2;p=xonotic%2Fdarkplaces.git diff --git a/sys_win.c b/sys_win.c index e23c8b3f..34f82380 100644 --- a/sys_win.c +++ b/sys_win.c @@ -35,8 +35,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; @@ -46,30 +44,6 @@ static HANDLE heventParent; static HANDLE heventChild; -/* -=============================================================================== - -DLL MANAGEMENT - -=============================================================================== -*/ - -dllhandle_t Sys_LoadLibrary (const char* name) -{ - return LoadLibrary (name); -} - -void Sys_UnloadLibrary (dllhandle_t handle) -{ - FreeLibrary (handle); -} - -void* Sys_GetProcAddress (dllhandle_t handle, const char* name) -{ - return (void *)GetProcAddress (handle, name); -} - - /* =============================================================================== @@ -89,7 +63,7 @@ void Sys_Error (const char *error, ...) static int in_sys_error2 = 0; va_start (argptr, error); - vsprintf (text, error, argptr); + vsnprintf (text, sizeof (text), error, argptr); va_end (argptr); // close video so the message box is visible, unless we already tried that @@ -132,6 +106,13 @@ void Sys_Quit (void) exit (0); } +void Sys_Print(const char *text) +{ + DWORD dummy; + extern HANDLE houtput; + if (cls.state == ca_dedicated) + WriteFile(houtput, text, strlen (text), &dummy, NULL); +} /* ================ @@ -431,7 +412,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin Sys_Shared_LateInit(); frameoldtime = Sys_DoubleTime (); - + /* main window message loop */ while (1) {