about summary refs log tree commit diff
path: root/src/game/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/client')
-rw-r--r--src/game/client/gc_client.cpp2
-rw-r--r--src/game/client/gc_client.h14
-rw-r--r--src/game/client/gc_console.cpp4
-rw-r--r--src/game/client/gc_hooks.cpp28
-rw-r--r--src/game/client/gc_render.cpp12
-rw-r--r--src/game/client/gc_render_obj.cpp7
6 files changed, 59 insertions, 8 deletions
diff --git a/src/game/client/gc_client.cpp b/src/game/client/gc_client.cpp
index 7032637f..d891ec84 100644
--- a/src/game/client/gc_client.cpp
+++ b/src/game/client/gc_client.cpp
@@ -25,7 +25,7 @@ extern "C" {
 #include "gc_console.h"
 
 struct data_container *data = 0;
-static int64 debug_firedelay = 0;
+int64 debug_firedelay = 0;
 
 player_input input_data = {0};
 int input_target_lock = 0;
diff --git a/src/game/client/gc_client.h b/src/game/client/gc_client.h
index 63c74d77..857a9088 100644
--- a/src/game/client/gc_client.h
+++ b/src/game/client/gc_client.h
@@ -36,6 +36,20 @@ extern int picked_up_weapon;
 extern player_input input_data;
 extern int input_target_lock;
 
+// debug
+extern int64 debug_firedelay;
+
+// extra projs
+enum
+{
+	MAX_EXTRA_PROJECTILES=32,
+};
+
+extern obj_projectile extraproj_projectiles[MAX_EXTRA_PROJECTILES];
+extern int extraproj_num;
+
+void extraproj_reset();
+
 // chat
 enum
 {
diff --git a/src/game/client/gc_console.cpp b/src/game/client/gc_console.cpp
index c04477a1..1f596e79 100644
--- a/src/game/client/gc_console.cpp
+++ b/src/game/client/gc_console.cpp
@@ -265,14 +265,14 @@ void console_render()
 
 	gfx_texture_set(data->images[IMAGE_CONSOLE_BG].id);
     gfx_quads_begin();
-    gfx_setcolor(0.2f, 0.2f, 0.2f,0.8f);
+    gfx_setcolor(0.2f, 0.2f, 0.2f,0.9f);
     gfx_quads_setsubset(0,-console_height*0.075f,screen.w*0.075f*0.5f,0);
     gfx_quads_drawTL(0,0,screen.w,console_height);
     gfx_quads_end();
 
 	gfx_texture_set(data->images[IMAGE_CONSOLE_BAR].id);
     gfx_quads_begin();
-    gfx_setcolor(1.0f, 1.0f, 1.0f, 0.8f);
+    gfx_setcolor(1.0f, 1.0f, 1.0f, 0.9f);
     gfx_quads_setsubset(0,0.1f,screen.w*0.015f,1-0.1f);
     gfx_quads_drawTL(0,console_height-10.0f,screen.w,10.0f);
     gfx_quads_end();
diff --git a/src/game/client/gc_hooks.cpp b/src/game/client/gc_hooks.cpp
index f04af5cb..4ab5cf6a 100644
--- a/src/game/client/gc_hooks.cpp
+++ b/src/game/client/gc_hooks.cpp
@@ -394,6 +394,15 @@ extern "C" void modc_statechange(int state, int old)
 	}
 }
 
+
+obj_projectile extraproj_projectiles[MAX_EXTRA_PROJECTILES];
+int extraproj_num;
+
+void extraproj_reset()
+{
+	extraproj_num = 0;
+}
+
 extern "C" void modc_message(int msg)
 {
 	if(msg == MSG_CHAT)
@@ -409,6 +418,23 @@ extern "C" void modc_message(int msg)
 		else
 			snd_play(CHN_GUI, data->sounds[SOUND_CHAT_SERVER].sounds[0].id, 0);
 	}
+	else if(msg == MSG_EXTRA_PROJECTILE)
+	{
+		int num = msg_unpack_int();
+		
+		for(int k = 0; k < num; k++)
+		{
+			obj_projectile proj;
+			for(unsigned i = 0; i < sizeof(obj_projectile)/sizeof(int); i++)
+				((int *)&proj)[i] = msg_unpack_int();
+				
+			if(extraproj_num != MAX_EXTRA_PROJECTILES)
+			{
+				extraproj_projectiles[extraproj_num] = proj;
+				extraproj_num++;
+			}
+		}
+	}
 	else if(msg == MSG_SETINFO)
 	{
 		int cid = msg_unpack_int();
@@ -487,8 +513,8 @@ extern "C" void modc_connected()
 	
 	//tilemap_init();
 	chat_reset();
-
 	particle_reset();
+	extraproj_reset();
 	
 	clear_object_pointers();
 	last_new_predicted_tick = -1;
diff --git a/src/game/client/gc_render.cpp b/src/game/client/gc_render.cpp
index f201a87c..1d276ec3 100644
--- a/src/game/client/gc_render.cpp
+++ b/src/game/client/gc_render.cpp
@@ -370,6 +370,18 @@ static void render_items()
 				render_flag((const obj_flag *)prev, (const obj_flag *)data);
 		}
 	}
+
+	// render extra projectiles	
+	for(int i = 0; i < extraproj_num; i++)
+	{
+		if(extraproj_projectiles[i].start_tick < client_tick())
+		{
+			extraproj_projectiles[i] = extraproj_projectiles[extraproj_num-1];
+			extraproj_num--;
+		}
+		else
+			render_projectile(&extraproj_projectiles[i], 0);
+	}
 }
 
 
diff --git a/src/game/client/gc_render_obj.cpp b/src/game/client/gc_render_obj.cpp
index 39705444..cedfc129 100644
--- a/src/game/client/gc_render_obj.cpp
+++ b/src/game/client/gc_render_obj.cpp
@@ -13,13 +13,12 @@
 
 void render_projectile(const obj_projectile *current, int itemid)
 {
-	/*
 	if(debug_firedelay)
 	{
-		debug_firedelay = time_get()-debug_firedelay;
-		dbg_msg("game", "firedelay=%.2f ms", debug_firedelay/(float)time_freq()*1000.0f);
+		int64 delay = time_get()-debug_firedelay;
+		dbg_msg("game", "firedelay=%.2f ms", delay/(float)time_freq()*1000.0f);
 		debug_firedelay = 0;
-	}*/
+	}
 	
 	gfx_texture_set(data->images[IMAGE_GAME].id);
 	gfx_quads_begin();