(svn r170) -Fix: [1022902] network fix .. console fix bug [1018523]. Fixes some variable initialization errors and a console.h warning (sign_de)
authordarkvater
Mon, 06 Sep 2004 21:27:26 +0000
changeset 169 4081f1d1f393
parent 168 79f9ed5b23e6
child 170 8b184d95b4fe
(svn r170) -Fix: [1022902] network fix .. console fix bug [1018523]. Fixes some variable initialization errors and a console.h warning (sign_de)
console.c
console.h
network.c
--- a/console.c	Mon Sep 06 21:20:01 2004 +0000
+++ b/console.c	Mon Sep 06 21:27:26 2004 +0000
@@ -65,8 +65,8 @@
 {
 	switch(e->event) {
 
-	case WE_PAINT:
-
+	case WE_PAINT:
+
 		GfxFillRect(w->left,w->top,w->width,w->height-1,0);
 		{
 		int i=_iconsole_scroll;
@@ -100,6 +100,11 @@
 			}
 		break;
 
+	case WE_DESTROY:
+		_iconsole_win=NULL;
+		_iconsole_mode=ICONSOLE_CLOSED;
+		break;
+
 	case WE_KEYPRESS:
 		e->keypress.cont=false;
 		if (e->keypress.keycode == (WKC_UP))
@@ -257,7 +262,7 @@
 }
 
 void IConsoleClose() {
-if (_iconsole_mode==ICONSOLE_OPENED)  IConsoleSwitch();
+if (_iconsole_mode==ICONSOLE_OPENED)  IConsoleSwitch();
 _iconsole_mode=ICONSOLE_CLOSED;
 }
 
@@ -333,7 +338,7 @@
 }
 
 
-void IConsolePrintF(byte color_code, const char *s, ...)
+void CDECL IConsolePrintF(byte color_code, const char *s, ...)
 {
 	va_list va;
 	char buf[1024];
--- a/console.h	Mon Sep 06 21:20:01 2004 +0000
+++ b/console.h	Mon Sep 06 21:27:26 2004 +0000
@@ -65,7 +65,7 @@
 
 // ** console output ** //
 void IConsolePrint(byte color_code, byte* string);
-void IConsolePrintF(byte color_code, const char *s, ...);
+void CDECL IConsolePrintF(byte color_code, const char *s, ...);
 void IConsoleDebug(byte* string);
 void IConsoleError(byte* string);
 
--- a/network.c	Mon Sep 06 21:20:01 2004 +0000
+++ b/network.c	Mon Sep 06 21:27:26 2004 +0000
@@ -1100,7 +1100,12 @@
 
 void NetworkShutdown()
 {
-
+	_networking_server = false;	
+	_networking = false;
+	_networking_sync = false;
+	_frame_counter = 0;
+	_frame_counter_max = 0;
+	_frame_counter_srv = 0;
 }
 
 // switch to synced mode.
@@ -1491,8 +1496,6 @@
 		NetworkClose(true);
 		}
 	
-	_networking_server = false;	
-	_networking = false;
 	NetworkShutdown();
 }