[nexuiz-commits] r6959 - in trunk/data: . qcsrc/client
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Jun 10 12:09:04 EDT 2009
Author: div0
Date: 2009-06-10 12:09:03 -0400 (Wed, 10 Jun 2009)
New Revision: 6959
Modified:
trunk/data/defaultNexuiz.cfg
trunk/data/qcsrc/client/teamradar.qc
Log:
teamradar HUD hack so it can be at the right
Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg 2009-06-10 15:50:13 UTC (rev 6958)
+++ trunk/data/defaultNexuiz.cfg 2009-06-10 16:09:03 UTC (rev 6959)
@@ -1251,7 +1251,7 @@
con_chatsize 10
con_chatwidth 0.6
con_notifysize 10
-con_notifyalign 0.5 // TODO change this to 0 when we finally can move the radar right
+con_notifyalign 0
sbar_info_pos 50
seta sbar_alpha_bg 0.7
@@ -1397,12 +1397,12 @@
seta cl_teamradar 1 "show radar in teammatches when available"
-seta cl_teamradar_background_alpha 0.4 "set to -1 to disable"
+seta cl_teamradar_background_alpha 0 "set to -1 to disable"
seta cl_teamradar_foreground_alpha 0.8 "alpha of the map"
seta cl_teamradar_scale 4096 "distance you can see on the team radar"
seta cl_teamradar_rotation 0 "rotation mode: you set what points up. 0 = player, 1 = west, 2 = south, 3 = east, 4 = north"
seta cl_teamradar_size "128 128" "size of the team radar in pixels"
-seta cl_teamradar_position "0 0" "1 0 would be upper right corner, 0.5 0.5 the center"
+seta cl_teamradar_position "1 0" "1 0 would be upper right corner, 0.5 0.5 the center, append a 2 at the end to disable the corner hack, and a 1 to disable half the hack"
seta cl_teamradar_zoommode 0 "zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out"
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 2009-06-10 15:50:13 UTC (rev 6958)
+++ trunk/data/qcsrc/client/teamradar.qc 2009-06-10 16:09:03 UTC (rev 6959)
@@ -2,8 +2,10 @@
vector teamradar_origin3d_in_texcoord; // player origin
vector teamradar_origin2d; // 2D origin
vector teamradar_size2d; // 2D size
+vector teamradar_extraclip_mins, teamradar_extraclip_maxs; // don't even ask
float teamradar_size; // 2D scale factor
float cl_teamradar_scale; // window size = ...qu
+float cl_teamradar_nohudhack;
float v_flipped;
float vlen2d(vector v)
@@ -58,10 +60,10 @@
if(bg > 0)
{
R_BeginPolygon("", 0);
- R_PolygonVertex('1 0 0' * (teamradar_origin2d_x - teamradar_size2d_x * 0.5) + '0 1 0' * (teamradar_origin2d_y - teamradar_size2d_y * 0.5), '0 0 0', '0 0 0', bg);
- R_PolygonVertex('1 0 0' * (teamradar_origin2d_x + teamradar_size2d_x * 0.5) + '0 1 0' * (teamradar_origin2d_y - teamradar_size2d_y * 0.5), '0 0 0', '0 0 0', bg);
- R_PolygonVertex('1 0 0' * (teamradar_origin2d_x + teamradar_size2d_x * 0.5) + '0 1 0' * (teamradar_origin2d_y + teamradar_size2d_y * 0.5), '0 0 0', '0 0 0', bg);
- R_PolygonVertex('1 0 0' * (teamradar_origin2d_x - teamradar_size2d_x * 0.5) + '0 1 0' * (teamradar_origin2d_y + teamradar_size2d_y * 0.5), '0 0 0', '0 0 0', bg);
+ R_PolygonVertex('1 0 0' * (teamradar_origin2d_x - teamradar_size2d_x * 0.5 + teamradar_extraclip_mins_x) + '0 1 0' * (teamradar_origin2d_y - teamradar_size2d_y * 0.5 + teamradar_extraclip_mins_y), '0 0 0', '0 0 0', bg);
+ R_PolygonVertex('1 0 0' * (teamradar_origin2d_x + teamradar_size2d_x * 0.5 + teamradar_extraclip_maxs_x) + '0 1 0' * (teamradar_origin2d_y - teamradar_size2d_y * 0.5 + teamradar_extraclip_mins_y), '0 0 0', '0 0 0', bg);
+ R_PolygonVertex('1 0 0' * (teamradar_origin2d_x + teamradar_size2d_x * 0.5 + teamradar_extraclip_maxs_x) + '0 1 0' * (teamradar_origin2d_y + teamradar_size2d_y * 0.5 + teamradar_extraclip_maxs_y), '0 0 0', '0 0 0', bg);
+ R_PolygonVertex('1 0 0' * (teamradar_origin2d_x - teamradar_size2d_x * 0.5 + teamradar_extraclip_mins_x) + '0 1 0' * (teamradar_origin2d_y + teamradar_size2d_y * 0.5 + teamradar_extraclip_maxs_y), '0 0 0', '0 0 0', bg);
R_EndPolygon();
}
@@ -197,6 +199,7 @@
cl_teamradar_size = '256 256 0'; // TODO make somewhat variable?
cl_teamradar_position = '0.5 0.5 0';
cl_teamradar_zoommode = 3;
+ cl_teamradar_nohudhack = 0;
}
else
{
@@ -217,6 +220,7 @@
if(!cl_teamradar_size_y) cl_teamradar_size_y = cl_teamradar_size_x;
cl_teamradar_size_z = 0;
+ cl_teamradar_nohudhack = cl_teamradar_position_z;
cl_teamradar_position_z = 0;
}
}
@@ -263,9 +267,26 @@
scale2d = vlen_maxnorm2d(mi_picmax - mi_picmin);
teamradar_size2d = cl_teamradar_size;
+
teamradar_origin2d =
'1 0 0' * (0.5 * teamradar_size2d_x + cl_teamradar_position_x * (vid_conwidth - teamradar_size2d_x))
+ '0 1 0' * (0.5 * teamradar_size2d_y + cl_teamradar_position_y * (vid_conheight - teamradar_size2d_y));
+
+ teamradar_extraclip_mins = teamradar_extraclip_maxs = '0 0 0';
+ if(cl_teamradar_position == '1 0 0')
+ {
+ if(cl_teamradar_nohudhack < 2)
+ teamradar_origin2d_y += 25;
+ if(cl_teamradar_nohudhack < 1)
+ teamradar_extraclip_mins_y -= 25;
+ }
+ else if(cl_teamradar_position == '0 1 0' || cl_teamradar_position == '1 1 0')
+ {
+ if(cl_teamradar_nohudhack < 2)
+ teamradar_origin2d_y -= 50;
+ //if(cl_teamradar_nohudhack < 1)
+ //teamradar_extraclip_size_y += 50; // don't, the HUD looks nice
+ }
// pixels per world qu to match the teamradar_size2d_x range in the longest dimension
if(cl_teamradar_rotation == 0)
@@ -306,10 +327,10 @@
rgb = GetTeamRGB(color1);
drawsetcliparea(
- teamradar_origin2d_x - teamradar_size2d_x * 0.5,
- teamradar_origin2d_y - teamradar_size2d_y * 0.5,
- teamradar_size2d_x,
- teamradar_size2d_y
+ teamradar_origin2d_x - teamradar_size2d_x * 0.5 + teamradar_extraclip_mins_x,
+ teamradar_origin2d_y - teamradar_size2d_y * 0.5 + teamradar_extraclip_mins_y,
+ teamradar_size2d_x + teamradar_extraclip_maxs_x - teamradar_extraclip_mins_x,
+ teamradar_size2d_y + teamradar_extraclip_maxs_y - teamradar_extraclip_mins_y
);
draw_teamradar_background(cl_teamradar_background_alpha, cl_teamradar_foreground_alpha);
More information about the nexuiz-commits
mailing list