r5103 - in trunk/data/qcsrc: client common
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Nov 26 04:37:12 EST 2008
Author: div0
Date: 2008-11-26 04:37:02 -0500 (Wed, 26 Nov 2008)
New Revision: 5103
Modified:
trunk/data/qcsrc/client/teamradar.qc
trunk/data/qcsrc/client/teamradar.qh
trunk/data/qcsrc/client/waypointsprites.qc
trunk/data/qcsrc/common/constants.qh
Log:
allow 32 concurrent radar pings
Modified: trunk/data/qcsrc/client/teamradar.qc
===================================================================
--- trunk/data/qcsrc/client/teamradar.qc 2008-11-26 09:20:21 UTC (rev 5102)
+++ trunk/data/qcsrc/client/teamradar.qc 2008-11-26 09:37:02 UTC (rev 5103)
@@ -121,20 +121,28 @@
R_EndPolygon();
};
-void draw_teamradar_icon(vector coord, float icon, float pingtime, vector rgb, float a)
+void draw_teamradar_icon(vector coord, float icon, entity pingdata, vector rgb, float a)
{
float dt;
vector v;
+ float i;
coord = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(coord));
drawpic(coord - '4 4 0', strcat("gfx/teamradar_icon_", ftos(icon)), '8 8 0', rgb, a, 0);
- if(pingtime != 0)
+
+ if(pingdata)
{
- dt = time - pingtime;
- if(dt > 1)
- return;
- v = '2 2 0' * teamradar_size * dt;
- drawpic(coord - 0.5 * v, "gfx/teamradar_ping", v, '1 1 1', 1 - dt, DRAWFLAG_ADDITIVE);
+ for(i = 0; i < MAX_TEAMRADAR_TIMES; ++i)
+ {
+ dt = pingdata.(teamradar_times[i]);
+ if(dt == 0)
+ continue;
+ dt = time - dt;
+ if(dt > 1)
+ continue;
+ v = '2 2 0' * teamradar_size * dt;
+ drawpic(coord - 0.5 * v, "gfx/teamradar_ping", v, '1 1 1', 1 - dt, DRAWFLAG_ADDITIVE);
+ }
}
}
@@ -325,7 +333,7 @@
for(tm = world; (tm = find(tm, classname, "radarlink")); )
draw_teamradar_link(tm.origin, tm.velocity, tm.team);
for(tm = world; (tm = findflags(tm, teamradar_icon, 0xFFFFFF)); )
- draw_teamradar_icon(tm.origin, tm.teamradar_icon, tm.teamradar_time, tm.teamradar_color, tm.alpha);
+ draw_teamradar_icon(tm.origin, tm.teamradar_icon, tm, tm.teamradar_color, tm.alpha);
for(tm = world; (tm = find(tm, classname, "entcs_receiver")); )
{
color2 = GetPlayerColor(tm.sv_entnum);
Modified: trunk/data/qcsrc/client/teamradar.qh
===================================================================
--- trunk/data/qcsrc/client/teamradar.qh 2008-11-26 09:20:21 UTC (rev 5102)
+++ trunk/data/qcsrc/client/teamradar.qh 2008-11-26 09:37:02 UTC (rev 5103)
@@ -1,6 +1,9 @@
void teamradar_view();
+#define MAX_TEAMRADAR_TIMES 32
+
// to make entities have dots on the team radar
.float teamradar_icon;
-.float teamradar_time;
+.float teamradar_times[MAX_TEAMRADAR_TIMES];
+.float teamradar_time_index;
.vector teamradar_color;
Modified: trunk/data/qcsrc/client/waypointsprites.qc
===================================================================
--- trunk/data/qcsrc/client/waypointsprites.qc 2008-11-26 09:20:21 UTC (rev 5102)
+++ trunk/data/qcsrc/client/waypointsprites.qc 2008-11-26 09:37:02 UTC (rev 5103)
@@ -254,7 +254,10 @@
f = ReadByte();
self.teamradar_icon = (f & 0x7F);
if(f & 0x80)
- self.teamradar_time = time;
+ {
+ self.(teamradar_times[self.teamradar_time_index]) = time;
+ self.teamradar_time_index = mod(self.teamradar_time_index + 1, MAX_TEAMRADAR_TIMES);
+ }
self.teamradar_color_x = ReadByte() / 255.0;
self.teamradar_color_y = ReadByte() / 255.0;
self.teamradar_color_z = ReadByte() / 255.0;
Modified: trunk/data/qcsrc/common/constants.qh
===================================================================
--- trunk/data/qcsrc/common/constants.qh 2008-11-26 09:20:21 UTC (rev 5102)
+++ trunk/data/qcsrc/common/constants.qh 2008-11-26 09:37:02 UTC (rev 5103)
@@ -66,6 +66,7 @@
const float RADARICON_HELPME = 1;
const float RADARICON_CONTROLPOINT = 1;
const float RADARICON_GENERATOR = 1;
+const float RADARICON_OBJECTIVE = 1;
///////////////////////////
// key constants
More information about the nexuiz-commits
mailing list