about summary refs log tree commit diff
path: root/src/engine/client
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-04-06 11:52:00 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-04-06 11:52:00 +0000
commitd15bef7ede6b07dbbc2f6b6a3e23b1ed83e6b6ea (patch)
treef5c299c768a761177065855c25be7506488b95b4 /src/engine/client
parent34c3a1c1426e6443ba30b8e2852b73bf92757dff (diff)
downloadzcatch-d15bef7ede6b07dbbc2f6b6a3e23b1ed83e6b6ea.tar.gz
zcatch-d15bef7ede6b07dbbc2f6b6a3e23b1ed83e6b6ea.zip
loads of changes here and there. added flushing of packets when connection is started
Diffstat (limited to 'src/engine/client')
-rw-r--r--src/engine/client/ec_client.c7
-rw-r--r--src/engine/client/ec_gfx.c32
2 files changed, 13 insertions, 26 deletions
diff --git a/src/engine/client/ec_client.c b/src/engine/client/ec_client.c
index c2143121..6faf0f25 100644
--- a/src/engine/client/ec_client.c
+++ b/src/engine/client/ec_client.c
@@ -304,7 +304,7 @@ int client_send_msg()
 
 static void client_send_info()
 {
-	msg_pack_start_system(NETMSG_INFO, MSGFLAG_VITAL);
+	msg_pack_start_system(NETMSG_INFO, MSGFLAG_VITAL|MSGFLAG_FLUSH);
 	msg_pack_string(modc_net_version(), 128);
 	msg_pack_string(config.player_name, 128);
 	msg_pack_string(config.clan_name, 128);
@@ -316,14 +316,14 @@ static void client_send_info()
 
 static void client_send_entergame()
 {
-	msg_pack_start_system(NETMSG_ENTERGAME, MSGFLAG_VITAL);
+	msg_pack_start_system(NETMSG_ENTERGAME, MSGFLAG_VITAL|MSGFLAG_FLUSH);
 	msg_pack_end();
 	client_send_msg();
 }
 
 static void client_send_ready()
 {
-	msg_pack_start_system(NETMSG_READY, MSGFLAG_VITAL);
+	msg_pack_start_system(NETMSG_READY, MSGFLAG_VITAL|MSGFLAG_FLUSH);
 	msg_pack_end();
 	client_send_msg();
 }
@@ -461,6 +461,7 @@ void client_entergame()
 	/* to finish the connection */
 	client_send_entergame();
 	client_on_enter_game();
+	/*netclient_flush(net);*/
 }
 
 void client_connect(const char *server_address_str)
diff --git a/src/engine/client/ec_gfx.c b/src/engine/client/ec_gfx.c
index 18b17a74..3a9f11d1 100644
--- a/src/engine/client/ec_gfx.c
+++ b/src/engine/client/ec_gfx.c
@@ -47,6 +47,7 @@ static COLOR color[4];
 static TEXCOORD texture[4];
 
 static int do_screenshot = 0;
+static int render_enable = 1;
 
 static int screen_width = -1;
 static int screen_height = -1;
@@ -104,10 +105,13 @@ static void flush()
 	glEnableClientState(GL_TEXTURE_COORD_ARRAY);
 	glEnableClientState(GL_COLOR_ARRAY);
 	
-	if(drawing == DRAWING_QUADS)
-		glDrawArrays(GL_QUADS, 0, num_vertices);
-	else if(drawing == DRAWING_LINES)
-		glDrawArrays(GL_LINES, 0, num_vertices);
+	if(render_enable)
+	{
+		if(drawing == DRAWING_QUADS)
+			glDrawArrays(GL_QUADS, 0, num_vertices);
+		else if(drawing == DRAWING_LINES)
+			glDrawArrays(GL_LINES, 0, num_vertices);
+	}
 	
 	/* Reset pointer */
 	num_vertices = 0;	
@@ -651,27 +655,9 @@ void gfx_swap()
 		perf_end();
 	}
 	
-	if(config.gfx_finish)
+	if(render_enable && config.gfx_finish)
 		glFinish();
 
-	/*	
-	if(inp_key_pressed('P'))
-	{
-		{
-			static PERFORMACE_INFO pscope = {"glFlush", 0};
-			perf_start(&pscope);
-			glFlush();
-			perf_end();
-		}
-
-		{
-			static PERFORMACE_INFO pscope = {"glFinish", 0};
-			perf_start(&pscope);
-			glFinish();
-			perf_end();
-		}
-	}*/
-
 	{
 		static PERFORMACE_INFO pscope = {"glfwPollEvents", 0};
 		perf_start(&pscope);