diff options
author | Simon Howard | 2006-03-24 21:43:43 +0000 |
---|---|---|
committer | Simon Howard | 2006-03-24 21:43:43 +0000 |
commit | b8e4404ea229a40defa7515877a892eab5d9acb9 (patch) | |
tree | 19aff1810e94c39eec1e4087b35cc3fdb7b7944f /src | |
parent | d04ad8b877e08307a0813d1e183515a1f2fcd3ee (diff) | |
download | chocolate-doom-b8e4404ea229a40defa7515877a892eab5d9acb9.tar.gz chocolate-doom-b8e4404ea229a40defa7515877a892eab5d9acb9.tar.bz2 chocolate-doom-b8e4404ea229a40defa7515877a892eab5d9acb9.zip |
Adjust anti-CPU-hogging sleep times.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 440
Diffstat (limited to 'src')
-rw-r--r-- | src/d_main.c | 8 | ||||
-rw-r--r-- | src/net_client.c | 6 | ||||
-rw-r--r-- | src/net_gui.c | 16 | ||||
-rw-r--r-- | src/net_server.c | 4 |
4 files changed, 14 insertions, 20 deletions
diff --git a/src/d_main.c b/src/d_main.c index 353dcbd4..77787312 100644 --- 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 @@ void D_Display (void) { 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); diff --git a/src/net_client.c b/src/net_client.c index ef28ccdb..eb99489b 100644 --- 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 @@ boolean NET_CL_Connect(net_addr_t *addr) // Don't hog the CPU - I_Sleep(10); + I_Sleep(1); } if (client_connection.state == NET_CONN_STATE_CONNECTED) @@ -1143,7 +1143,7 @@ void NET_CL_Disconnect(void) NET_CL_Run(); NET_SV_Run(); - I_Sleep(10); + I_Sleep(1); } // Finished sending disconnect packets, etc. diff --git a/src/net_gui.c b/src/net_gui.c index 2e60b4d0..b6cb4c6c 100644 --- 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 @@ static void DrawScreen(void) 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 @@ void NET_WaitForStart(void) I_Error("Disconnected from server"); } - I_Sleep(1); + I_Sleep(50); } TXT_Shutdown(); diff --git a/src/net_server.c b/src/net_server.c index 773aea96..d8e73453 100644 --- 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 @@ void NET_SV_Shutdown(void) // Don't hog the CPU - I_Sleep(10); + I_Sleep(1); } } |