ref: b8e4404ea229a40defa7515877a892eab5d9acb9
parent: d04ad8b877e08307a0813d1e183515a1f2fcd3ee
author: Simon Howard <[email protected]>
date: Fri Mar 24 16:43:43 EST 2006
Adjust anti-CPU-hogging sleep times. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 440
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: d_main.c 438 2006-03-24 20:40:08Z fraggle $
+// $Id: d_main.c 440 2006-03-24 21:43:43Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -184,7 +184,7 @@
//-----------------------------------------------------------------------------
-static const char rcsid[] = "$Id: d_main.c 438 2006-03-24 20:40:08Z fraggle $";
+static const char rcsid[] = "$Id: d_main.c 440 2006-03-24 21:43:43Z fraggle $";
#define BGCOLOR 7
#define FGCOLOR 8
@@ -532,7 +532,9 @@
{
nowtime = I_GetTime ();
tics = nowtime - wipestart;
- } while (!tics);
+ I_Sleep(1);
+ } while (tics <= 0);
+
wipestart = nowtime;
done = wipe_ScreenWipe(wipe_Melt
, 0, 0, SCREENWIDTH, SCREENHEIGHT, tics);
--- a/src/net_client.c
+++ b/src/net_client.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: net_client.c 413 2006-03-07 18:25:32Z fraggle $
+// $Id: net_client.c 440 2006-03-24 21:43:43Z fraggle $
//
// Copyright(C) 2005 Simon Howard
//
@@ -1091,7 +1091,7 @@
// Don't hog the CPU
- I_Sleep(10);
+ I_Sleep(1);
}
if (client_connection.state == NET_CONN_STATE_CONNECTED)
@@ -1143,7 +1143,7 @@
NET_CL_Run();
NET_SV_Run();
- I_Sleep(10);
+ I_Sleep(1);
}
// Finished sending disconnect packets, etc.
--- a/src/net_gui.c
+++ b/src/net_gui.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: net_gui.c 416 2006-03-11 21:28:21Z fraggle $
+// $Id: net_gui.c 440 2006-03-24 21:43:43Z fraggle $
//
// Copyright(C) 2005 Simon Howard
//
@@ -173,22 +173,14 @@
void NET_WaitForStart(void)
{
- int last_draw_time;
-
TXT_Init();
I_SetWindowCaption();
I_SetWindowIcon();
- last_draw_time = -1;
-
while (net_waiting_for_start)
{
- if (I_GetTimeMS() > last_draw_time + 50)
- {
- ProcessEvents();
- DrawScreen();
- last_draw_time = I_GetTimeMS();
- }
+ ProcessEvents();
+ DrawScreen();
NET_CL_Run();
NET_SV_Run();
@@ -198,7 +190,7 @@
I_Error("Disconnected from server");
}
- I_Sleep(1);
+ I_Sleep(50);
}
TXT_Shutdown();
--- a/src/net_server.c
+++ b/src/net_server.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: net_server.c 412 2006-03-07 18:24:12Z fraggle $
+// $Id: net_server.c 440 2006-03-24 21:43:43Z fraggle $
//
// Copyright(C) 2005 Simon Howard
//
@@ -1409,7 +1409,7 @@
// Don't hog the CPU
- I_Sleep(10);
+ I_Sleep(1);
}
}