summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2006-01-23 00:37:14 +0000
committerSimon Howard2006-01-23 00:37:14 +0000
commita9a551bdcc08d10de8f8f526b66e042c30486cf3 (patch)
tree842c93e8edfbc8d4c1949889d34b51b197deb9c6
parent92b3eeba514afec641892ecb090356027156f9ee (diff)
downloadchocolate-doom-a9a551bdcc08d10de8f8f526b66e042c30486cf3.tar.gz
chocolate-doom-a9a551bdcc08d10de8f8f526b66e042c30486cf3.tar.bz2
chocolate-doom-a9a551bdcc08d10de8f8f526b66e042c30486cf3.zip
Make the network waiting screen not thrash the CPU so much.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 335
-rw-r--r--src/net_gui.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/net_gui.c b/src/net_gui.c
index 3cf3ad0c..b830279f 100644
--- a/src/net_gui.c
+++ b/src/net_gui.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: net_gui.c 294 2006-01-14 00:27:16Z fraggle $
+// $Id: net_gui.c 335 2006-01-23 00:37:14Z fraggle $
//
// Copyright(C) 2005 Simon Howard
//
@@ -21,6 +21,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.13 2006/01/23 00:37:14 fraggle
+// Make the network waiting screen not thrash the CPU so much.
+//
// Revision 1.12 2006/01/14 00:27:16 fraggle
// Set the window caption and title
//
@@ -168,14 +171,22 @@ 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)
{
- ProcessEvents();
- DrawScreen();
+ if (I_GetTimeMS() > last_draw_time + 50)
+ {
+ ProcessEvents();
+ DrawScreen();
+ last_draw_time = I_GetTimeMS();
+ }
NET_CL_Run();
NET_SV_Run();
@@ -185,7 +196,7 @@ void NET_WaitForStart(void)
I_Error("Disconnected from server");
}
- I_Sleep(50);
+ I_Sleep(1);
}
TXT_Shutdown();