From 6a667cee0a53a21a1e617efb004b44a458d5b58f Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 25 Nov 2004 20:41:29 +0000 Subject: [PATCH] removed some windows cruft (like scr_skipupdate, and the SleepUntilInput stuff) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4795 d7cf8633-e32d-0410-b094-e92efae38249 --- screen.h | 3 --- sys_win.c | 35 ----------------------------------- vid_wgl.c | 7 +------ 3 files changed, 1 insertion(+), 44 deletions(-) diff --git a/screen.h b/screen.h index e21f4563..bb7ba5b9 100644 --- a/screen.h +++ b/screen.h @@ -33,9 +33,6 @@ extern float scr_conlines; // lines of console to display extern int sb_lines; -extern qboolean scr_disabled_for_loading; -extern qboolean scr_skipupdate; - extern cvar_t scr_viewsize; extern cvar_t scr_fov; extern cvar_t showfps; diff --git a/sys_win.c b/sys_win.c index c2892da9..36ab6e59 100644 --- a/sys_win.c +++ b/sys_win.c @@ -31,14 +31,6 @@ 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 -#define CONSOLE_ERROR_TIMEOUT 60.0 -// sleep time on pause or minimization -#define PAUSE_SLEEP 50 -// sleep time when not focus -#define NOT_FOCUS_SLEEP 20 - -static qboolean sc_return_on_enter = false; HANDLE hinput, houtput; static HANDLE tevent; @@ -55,8 +47,6 @@ SYSTEM IO =============================================================================== */ -void SleepUntilInput (int time); - void Sys_Error (const char *error, ...) { va_list argptr; @@ -242,13 +232,6 @@ char *Sys_ConsoleInput (void) len = 0; return text; } - else if (sc_return_on_enter) - { - // special case to allow exiting from the error handler on Enter - text[0] = '\r'; - len = 0; - return text; - } break; @@ -317,12 +300,6 @@ WINDOWS CRAP */ -void SleepUntilInput (int time) -{ - MsgWaitForMultipleObjects(1, &tevent, false, time, QS_ALLINPUT); -} - - /* ================== WinMain @@ -441,18 +418,6 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin /* main window message loop */ while (1) { - if (cls.state != ca_dedicated) - { - // yield the CPU for a little while when paused, minimized, or not the focus - if ((cl.paused && !vid_activewindow) || vid_hidden) - { - SleepUntilInput (PAUSE_SLEEP); - scr_skipupdate = 1; // no point in bothering to draw - } - else if (!vid_activewindow) - SleepUntilInput (NOT_FOCUS_SLEEP); - } - framenewtime = Sys_DoubleTime (); Host_Frame (framenewtime - frameoldtime); frameoldtime = framenewtime; diff --git a/vid_wgl.c b/vid_wgl.c index af3475f7..4649e672 100644 --- a/vid_wgl.c +++ b/vid_wgl.c @@ -73,8 +73,6 @@ static dllfunction_t wglswapintervalfuncs[] = {NULL, NULL} }; -qboolean scr_skipupdate; - static DEVMODE gdevmode; static qboolean vid_initialized = false; static qboolean vid_wassuspended = false; @@ -315,7 +313,7 @@ void VID_Finish (void) qwglSwapIntervalEXT (old_vsync); } - if (r_render.integer && !scr_skipupdate) + if (r_render.integer && !vid_hidden) { if (r_speeds.integer || gl_finish.integer) qglFinish(); @@ -523,9 +521,6 @@ void Sys_SendKeyEvents (void) while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE)) { - // we always update if there are any event, even if we're paused - scr_skipupdate = 0; - if (!GetMessage (&msg, NULL, 0, 0)) Sys_Quit (); -- 2.39.2