r4599 - in trunk/data: . qcsrc/client qcsrc/common
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Fri Oct 3 06:20:35 EDT 2008
Author: div0
Date: 2008-10-03 06:20:34 -0400 (Fri, 03 Oct 2008)
New Revision: 4599
Modified:
trunk/data/defaultNexuiz.cfg
trunk/data/qcsrc/client/teamradar.qc
trunk/data/qcsrc/common/util.qh
Log:
radar update: allow negative teamradar scale to switch zoomed in/out
Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg 2008-10-03 10:09:49 UTC (rev 4598)
+++ trunk/data/defaultNexuiz.cfg 2008-10-03 10:20:34 UTC (rev 4599)
@@ -1145,6 +1145,6 @@
seta cl_teamradar 1
seta cl_teamradar_background_alpha 0.75 // set to -1 to disable
-seta cl_teamradar_scale 2048
+seta cl_teamradar_scale 4096
seta cl_teamradar_rotation 0 // rotation mode: you set what points up. 0 = player, 1 = west, 2 = south, 3 = east, 4 = north
alias cl_teamradar_rotate "toggle cl_teamradar_rotation 0 1 2 3 4"
Modified: trunk/data/qcsrc/client/teamradar.qc
===================================================================
--- trunk/data/qcsrc/client/teamradar.qc 2008-10-03 10:09:49 UTC (rev 4598)
+++ trunk/data/qcsrc/client/teamradar.qc 2008-10-03 10:20:34 UTC (rev 4599)
@@ -108,7 +108,7 @@
local vector rgb;
local entity tm;
float scale2d, normalsize, bigsize;
- float a;
+ float a, f;
if(!cvar("cl_teamradar"))
return;
@@ -121,16 +121,23 @@
mi_picmax_y - mi_picmin_y
);
+ f = current_zoomfraction;
teamradar_scale = cvar("cl_teamradar_scale");
a = cvar("cl_teamradar_background_alpha");
teamradar_angle = cvar("cl_teamradar_rotation") * 90;
// fix undefined cvars first
if(!teamradar_scale)
- teamradar_scale = 2048;
+ teamradar_scale = 4096;
if(!a)
a = 0.75;
+ if(teamradar_scale < 0)
+ {
+ current_zoomfraction = 1 - current_zoomfraction;
+ teamradar_scale = -teamradar_scale;
+ }
+
if(!teamradar_angle)
teamradar_angle = input_angles_y - 90;
teamradar_origin2d = '64 64 0';
@@ -141,11 +148,11 @@
if(bigsize > normalsize)
normalsize = bigsize;
teamradar_size =
- current_zoomfraction * bigsize
- + (1 - current_zoomfraction) * normalsize;
+ f * bigsize
+ + (1 - f) * normalsize;
teamradar_origin3d_in_texcoord = teamradar_3dcoord_to_texcoord(
- current_zoomfraction * (mi_min + mi_max) * 0.5
- + (1 - current_zoomfraction) * pmove_org);
+ f * (mi_min + mi_max) * 0.5
+ + (1 - f) * pmove_org);
drawsetcliparea(
teamradar_origin2d_x - teamradar_size2d_x * 0.5,
Modified: trunk/data/qcsrc/common/util.qh
===================================================================
--- trunk/data/qcsrc/common/util.qh 2008-10-03 10:09:49 UTC (rev 4598)
+++ trunk/data/qcsrc/common/util.qh 2008-10-03 10:20:34 UTC (rev 4599)
@@ -94,3 +94,5 @@
vector mi_pictexcoord3; // texcoords of the image corners (after transforming, these are 2D coords too)
void get_mi_min_max();
#endif
+
+#define FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(x) void reference_##x() { x = x; }
More information about the nexuiz-commits
mailing list