]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Rename teamradar to radar, and also allow it in non-team games by default
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 15 Mar 2012 15:42:18 +0000 (17:42 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 15 Mar 2012 15:42:18 +0000 (17:42 +0200)
24 files changed:
data/defaultVT.cfg
data/gfx/radar_icon_1.tga [new file with mode: 0644]
data/gfx/radar_icon_2.tga [new file with mode: 0644]
data/gfx/radar_ping.tga [new file with mode: 0644]
data/gfx/teamradar_icon_1.tga [deleted file]
data/gfx/teamradar_icon_2.tga [deleted file]
data/gfx/teamradar_ping.tga [deleted file]
data/qcsrc/client/View.qc
data/qcsrc/client/progs.src
data/qcsrc/client/radar.qc [new file with mode: 0644]
data/qcsrc/client/radar.qh [new file with mode: 0644]
data/qcsrc/client/teamradar.qc [deleted file]
data/qcsrc/client/teamradar.qh [deleted file]
data/qcsrc/client/waypointsprites.qc
data/qcsrc/menu/voret/dialog_multiplayer_playersetup_hud.c
data/qcsrc/server/assault.qc
data/qcsrc/server/cl_impulse.qc
data/qcsrc/server/ctf.qc
data/qcsrc/server/domination.qc
data/qcsrc/server/keyhunt.qc
data/qcsrc/server/mode_onslaught.qc
data/qcsrc/server/t_items.qc
data/qcsrc/server/waypointsprites.qc
docs/TODO.txt

index b655404e8ee0964db7ef5dde35d70e1bb4c4f5b7..30179cbc1118a235166f1bc9e45ed05cd16a1b37 100644 (file)
@@ -1381,15 +1381,15 @@ seta cl_weaponpriority_useforcycling 0 "when set, weapon cycling by the mouse wh
 seta sv_status_privacy 1       "hide IP addresses from \"status\" replies shown to clients"\r
 \r
 \r
-seta cl_teamradar 1    "show radar in teammatches when available"\r
-seta cl_teamradar_background_alpha 0.6 "set to -1 to disable"\r
-seta cl_teamradar_foreground_alpha 0.8 "alpha of the map"\r
-seta cl_teamradar_scale 4096 "distance you can see on the team radar"\r
-seta cl_teamradar_rotation 0   "rotation mode: you set what points up. 0 = player, 1 = west, 2 = south, 3 = east, 4 = north"\r
-seta cl_teamradar_size "128 128" "size of the team radar in pixels"\r
-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"\r
-seta cl_teamradar_zoommode 0   "zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out"\r
-alias cl_teamradar_rotate "toggle cl_teamradar_rotation 0 1 2 3 4"\r
+seta cl_radar 2        "show radar. 1 in team maches, 2 always"\r
+seta cl_radar_background_alpha -1      "set to -1 to disable"\r
+seta cl_radar_foreground_alpha 0.8     "alpha of the map"\r
+seta cl_radar_scale 4096 "distance you can see on the radar"\r
+seta cl_radar_rotation 0       "rotation mode: you set what points up. 0 = player, 1 = west, 2 = south, 3 = east, 4 = north"\r
+seta cl_radar_size "128 128" "size of the radar in pixels"\r
+seta cl_radar_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"\r
+seta cl_radar_zoommode 0       "zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out"\r
+alias cl_radar_rotate "toggle cl_radar_rotation 0 1 2 3 4"\r
 \r
 set g_maplist_allow_hidden 0           "allow hidden maps to be, e.g., voted for and in the maplist"\r
 set g_maplist_allow_frustrating 0      "allow impossible maps to be, e.g., voted for and in the maplist (if set to 2, ONLY impossible maps are allowed)"\r
diff --git a/data/gfx/radar_icon_1.tga b/data/gfx/radar_icon_1.tga
new file mode 100644 (file)
index 0000000..88c70d0
Binary files /dev/null and b/data/gfx/radar_icon_1.tga differ
diff --git a/data/gfx/radar_icon_2.tga b/data/gfx/radar_icon_2.tga
new file mode 100644 (file)
index 0000000..88c70d0
Binary files /dev/null and b/data/gfx/radar_icon_2.tga differ
diff --git a/data/gfx/radar_ping.tga b/data/gfx/radar_ping.tga
new file mode 100644 (file)
index 0000000..0422de7
Binary files /dev/null and b/data/gfx/radar_ping.tga differ
diff --git a/data/gfx/teamradar_icon_1.tga b/data/gfx/teamradar_icon_1.tga
deleted file mode 100644 (file)
index 88c70d0..0000000
Binary files a/data/gfx/teamradar_icon_1.tga and /dev/null differ
diff --git a/data/gfx/teamradar_icon_2.tga b/data/gfx/teamradar_icon_2.tga
deleted file mode 100644 (file)
index 88c70d0..0000000
Binary files a/data/gfx/teamradar_icon_2.tga and /dev/null differ
diff --git a/data/gfx/teamradar_ping.tga b/data/gfx/teamradar_ping.tga
deleted file mode 100644 (file)
index 0422de7..0000000
Binary files a/data/gfx/teamradar_ping.tga and /dev/null differ
index 3e48e2d36fc871205507a80f4a954362b5860732..8a7462fcd89dc5b11599eaec6fcdbab1e0ed1568 100644 (file)
@@ -1036,16 +1036,16 @@ void CSQC_UpdateView(float w, float h)
                        (\r
                         !scoreboard_active\r
                         &&\r
-                        cvar_string("cl_teamradar") != "0"\r
+                        cvar_string("cl_radar") != "0"\r
                         &&\r
                         (\r
-                         cvar("cl_teamradar") == 2\r
+                         cvar("cl_radar") == 2\r
                          ||\r
                          teamplay\r
                         )\r
                        )\r
          )\r
-               teamradar_view();\r
+               radar_view();\r
 \r
        // Draw artwork and play intermission music\r
        if(intermission && !isdemo() && gametype != GAME_RPG && !spectatee_status) // the match has ended. Don't do this for RPG because no one wins or loses there\r
index 8d8e56b828da5cd3aca5220b76d3bedd4089558b..dd2592cf39e1c41ae1221ad8511c5321f66c9d1a 100644 (file)
@@ -20,7 +20,7 @@ csqc_builtins.qc
 autocvars.qh\r
 \r
 interpolate.qh\r
-teamradar.qh\r
+radar.qh\r
 waypointsprites.qh\r
 movetypes.qh\r
 prandom.qh\r
@@ -57,7 +57,7 @@ shownames.qc
 Main.qc\r
 View.qc\r
 interpolate.qc\r
-teamradar.qc\r
+radar.qc\r
 waypointsprites.qc\r
 movetypes.qc\r
 prandom.qc\r
diff --git a/data/qcsrc/client/radar.qc b/data/qcsrc/client/radar.qc
new file mode 100644 (file)
index 0000000..c0778f5
--- /dev/null
@@ -0,0 +1,409 @@
+float radar_angle; // player yaw angle\r
+vector radar_origin3d_in_texcoord; // player origin\r
+vector radar_origin2d; // 2D origin\r
+vector radar_size2d; // 2D size\r
+vector radar_extraclip_mins, radar_extraclip_maxs; // don't even ask\r
+float radar_size; // 2D scale factor\r
+float cl_radar_scale; // window size = ...qu\r
+float cl_radar_nohudhack;\r
+float v_flipped;\r
+\r
+float vlen2d(vector v)\r
+{\r
+       return sqrt(v_x * v_x + v_y * v_y);\r
+}\r
+\r
+float vlen_maxnorm2d(vector v)\r
+{\r
+       return max4(v_x, v_y, -v_x, -v_y);\r
+}\r
+\r
+float vlen_minnorm2d(vector v)\r
+{\r
+       return min(max(v_x, -v_x), max(v_y, -v_y));\r
+}\r
+\r
+vector radar_3dcoord_to_texcoord(vector in)\r
+{\r
+       vector out;\r
+       out_x = (in_x - mi_picmin_x) / (mi_picmax_x - mi_picmin_x);\r
+       out_y = (in_y - mi_picmin_y) / (mi_picmax_y - mi_picmin_y);\r
+       out_z = 0;\r
+       return out;\r
+}\r
+\r
+vector radar_texcoord_to_2dcoord(vector in)\r
+{\r
+       vector out;\r
+       in -= radar_origin3d_in_texcoord;\r
+\r
+       out = rotate(in, radar_angle * DEG2RAD);\r
+       out_y = - out_y; // screen space is reversed\r
+\r
+       out = out * radar_size;\r
+       if(v_flipped)\r
+               out_x = -out_x;\r
+       out += radar_origin2d;\r
+       return out;\r
+}\r
+\r
+vector yinvert(vector v)\r
+{\r
+       v_y = 1 - v_y;\r
+       return v;\r
+}\r
+\r
+void draw_radar_background(float bg, float fg)\r
+{\r
+       float fga;\r
+       vector fgc;\r
+       if(bg > 0)\r
+       {\r
+               R_BeginPolygon("", 0);\r
+               R_PolygonVertex('1 0 0' * (radar_origin2d_x - radar_size2d_x * 0.5 + radar_extraclip_mins_x) + '0 1 0' * (radar_origin2d_y - radar_size2d_y * 0.5 + radar_extraclip_mins_y), '0 0 0', '0 0 0', bg);\r
+               R_PolygonVertex('1 0 0' * (radar_origin2d_x + radar_size2d_x * 0.5 + radar_extraclip_maxs_x) + '0 1 0' * (radar_origin2d_y - radar_size2d_y * 0.5 + radar_extraclip_mins_y), '0 0 0', '0 0 0', bg);\r
+               R_PolygonVertex('1 0 0' * (radar_origin2d_x + radar_size2d_x * 0.5 + radar_extraclip_maxs_x) + '0 1 0' * (radar_origin2d_y + radar_size2d_y * 0.5 + radar_extraclip_maxs_y), '0 0 0', '0 0 0', bg);\r
+               R_PolygonVertex('1 0 0' * (radar_origin2d_x - radar_size2d_x * 0.5 + radar_extraclip_mins_x) + '0 1 0' * (radar_origin2d_y + radar_size2d_y * 0.5 + radar_extraclip_maxs_y), '0 0 0', '0 0 0', bg);\r
+               R_EndPolygon();\r
+       }\r
+\r
+       if(fg > 0 && minimapname != "")\r
+       {\r
+               fga = 1;\r
+               fgc = '1 1 1' * fg;\r
+               R_BeginPolygon(minimapname, DRAWFLAG_SCREEN | DRAWFLAG_MIPMAP);\r
+               if(v_flipped)\r
+               {\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord3), yinvert(mi_pictexcoord3), fgc, fga);\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord2), yinvert(mi_pictexcoord2), fgc, fga);\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord1), yinvert(mi_pictexcoord1), fgc, fga);\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord0), yinvert(mi_pictexcoord0), fgc, fga);\r
+               }\r
+               else\r
+               {\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord0), yinvert(mi_pictexcoord0), fgc, fga);\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord1), yinvert(mi_pictexcoord1), fgc, fga);\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord2), yinvert(mi_pictexcoord2), fgc, fga);\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord3), yinvert(mi_pictexcoord3), fgc, fga);\r
+               }\r
+               R_EndPolygon();\r
+       }\r
+}\r
+\r
+void(vector coord3d, vector pangles, vector rgb) draw_radar_player =\r
+{\r
+       vector coord, rgb2;\r
+\r
+       coord = radar_texcoord_to_2dcoord(radar_3dcoord_to_texcoord(coord3d));\r
+\r
+       makevectors(pangles - '0 1 0' * radar_angle);\r
+       if(v_flipped)\r
+       {\r
+               v_forward_x = -v_forward_x;\r
+               v_right_x = -v_right_x;\r
+               v_up_x = -v_up_x;\r
+       }\r
+       v_forward_z = 0;\r
+       v_forward = normalize(v_forward);\r
+       v_forward_y *= -1.0;\r
+       v_right_x = -v_forward_y;\r
+       v_right_y = v_forward_x;\r
+\r
+       if(rgb == '1 1 1')\r
+               rgb2 = '0 0 0';\r
+       else\r
+               rgb2 = '1 1 1';\r
+\r
+       R_BeginPolygon("", 0);\r
+       R_PolygonVertex(coord+v_forward*3, '0 0 0', rgb2, sbar_alpha_fg);\r
+       R_PolygonVertex(coord+v_right*4-v_forward*2.5, '0 1 0', rgb2, sbar_alpha_fg);\r
+       R_PolygonVertex(coord-v_forward*2, '1 0 0', rgb2, sbar_alpha_fg);\r
+       R_PolygonVertex(coord-v_right*4-v_forward*2.5, '1 1 0', rgb2, sbar_alpha_fg);\r
+       R_EndPolygon();\r
+\r
+       R_BeginPolygon("", 0);\r
+       R_PolygonVertex(coord+v_forward*2, '0 0 0', rgb, sbar_alpha_fg);\r
+       R_PolygonVertex(coord+v_right*3-v_forward*2, '0 1 0', rgb, sbar_alpha_fg);\r
+       R_PolygonVertex(coord-v_forward, '1 0 0', rgb, sbar_alpha_fg);\r
+       R_PolygonVertex(coord-v_right*3-v_forward*2, '1 1 0', rgb, sbar_alpha_fg);\r
+       R_EndPolygon();\r
+};\r
+\r
+void draw_radar_icon(vector coord, float icon, entity pingdata, vector rgb, float a)\r
+{\r
+       float dt;\r
+       vector v;\r
+       float i;\r
+\r
+       coord = radar_texcoord_to_2dcoord(radar_3dcoord_to_texcoord(coord));\r
+       drawpic(coord - '4 4 0', strcat("gfx/radar_icon_", ftos(icon)), '8 8 0', rgb, a, 0);\r
+\r
+       if(pingdata)\r
+       {\r
+               for(i = 0; i < MAX_RADAR_TIMES; ++i)\r
+               {\r
+                       dt = pingdata.(radar_times[i]);\r
+                       if(dt == 0)\r
+                               continue;\r
+                       dt = time - dt;\r
+                       if(dt >= 1 || dt <= 0)\r
+                               continue;\r
+                       v = '2 2 0' * radar_size * dt;\r
+                       drawpic(coord - 0.5 * v, "gfx/radar_ping", v, '1 1 1', (1 - dt) * a, DRAWFLAG_ADDITIVE);\r
+               }\r
+       }\r
+}\r
+\r
+void draw_radar_link(vector start, vector end, float colors)\r
+{\r
+       vector c0, c1, norm;\r
+\r
+       start = radar_texcoord_to_2dcoord(radar_3dcoord_to_texcoord(start));\r
+       end = radar_texcoord_to_2dcoord(radar_3dcoord_to_texcoord(end));\r
+       norm = normalize(start - end);\r
+       norm_z = norm_x;\r
+       norm_x = -norm_y;\r
+       norm_y = norm_z;\r
+       norm_z = 0;\r
+\r
+       c0 = colormapPaletteColor(colors & 0x0F, FALSE);\r
+       c1 = colormapPaletteColor((colors & 0xF0) / 0x10, FALSE);\r
+\r
+       R_BeginPolygon("", 0);\r
+       R_PolygonVertex(start - norm, '0 0 0', c0, sbar_alpha_fg);\r
+       R_PolygonVertex(start + norm, '0 1 0', c0, sbar_alpha_fg);\r
+       R_PolygonVertex(end + norm, '1 1 0', c1, sbar_alpha_fg);\r
+       R_PolygonVertex(end - norm, '1 0 0', c1, sbar_alpha_fg);\r
+       R_EndPolygon();\r
+}\r
+\r
+float cl_radar_scale;\r
+float cl_radar_background_alpha;\r
+float cl_radar_foreground_alpha;\r
+float cl_radar_rotation;\r
+vector cl_radar_size;\r
+vector cl_radar_position;\r
+float cl_radar_zoommode;\r
+\r
+void radar_loadcvars()\r
+{\r
+       v_flipped = cvar("v_flipped");\r
+       if(ons_showmap)\r
+       {\r
+               cl_radar_scale = 42; // dummy, not used (see zoommode)\r
+               cl_radar_background_alpha = 1 * (1 - cvar("_menu_alpha"));\r
+               cl_radar_foreground_alpha = 1 * (1 - cvar("_menu_alpha"));\r
+               cl_radar_rotation = cvar("cl_radar_rotation");\r
+               if(!cl_radar_rotation)\r
+                       cl_radar_rotation = 4;\r
+               cl_radar_size = '256 256 0'; // TODO make somewhat variable?\r
+               cl_radar_position = '0.5 0.5 0';\r
+               cl_radar_zoommode = 3;\r
+               cl_radar_nohudhack = 0;\r
+       }\r
+       else\r
+       {\r
+               cl_radar_scale = cvar("cl_radar_scale");\r
+               cl_radar_background_alpha = cvar("cl_radar_background_alpha") * sbar_alpha_fg;\r
+               cl_radar_foreground_alpha = cvar("cl_radar_foreground_alpha") * sbar_alpha_fg;\r
+               cl_radar_rotation = cvar("cl_radar_rotation");\r
+               cl_radar_size = stov(cvar_string("cl_radar_size"));\r
+               cl_radar_position = stov(cvar_string("cl_radar_position"));\r
+               cl_radar_zoommode = cvar("cl_radar_zoommode");\r
+\r
+               // others default to 0\r
+               // match this to defaultVoretournament.cfg!\r
+               if(!cl_radar_scale) cl_radar_scale = 4096;\r
+               if(!cl_radar_background_alpha) cl_radar_background_alpha = 0.4 * sbar_alpha_fg;\r
+               if(!cl_radar_foreground_alpha) cl_radar_foreground_alpha = 0.8 * sbar_alpha_fg;\r
+               if(!cl_radar_size_x) cl_radar_size_x = 128;\r
+               if(!cl_radar_size_y) cl_radar_size_y = cl_radar_size_x;\r
+\r
+               cl_radar_size_z = 0;\r
+               cl_radar_nohudhack = cl_radar_position_z;\r
+               cl_radar_position_z = 0;\r
+       }\r
+}\r
+\r
+void() radar_view =\r
+{\r
+       local float color1, color2; // color already declared as a global in hud.qc\r
+       local vector rgb;\r
+       local entity tm;\r
+       float scale2d, normalsize, bigsize;\r
+       float f;\r
+\r
+       if(minimapname == "" && !ons_showmap)\r
+               return;\r
+\r
+       radar_loadcvars();\r
+\r
+       switch(cl_radar_zoommode)\r
+       {\r
+               default:\r
+               case 0:\r
+                       f = current_zoomfraction;\r
+                       break;\r
+               case 1:\r
+                       f = 1 - current_zoomfraction;\r
+                       break;\r
+               case 2:\r
+                       f = 0;\r
+                       break;\r
+               case 3:\r
+                       f = 1;\r
+                       break;\r
+       }\r
+\r
+       switch(cl_radar_rotation)\r
+       {\r
+               case 0:\r
+                       radar_angle = view_angles_y - 90;\r
+                       break;\r
+               default:\r
+                       radar_angle = 90 * cl_radar_rotation;\r
+                       break;\r
+       }\r
+\r
+       scale2d = vlen_maxnorm2d(mi_picmax - mi_picmin);\r
+       radar_size2d = cl_radar_size;\r
+\r
+       radar_origin2d =\r
+                 '1 0 0' * (0.5 * radar_size2d_x + cl_radar_position_x * (vid_conwidth - radar_size2d_x))\r
+               + '0 1 0' * (0.5 * radar_size2d_y + cl_radar_position_y * (vid_conheight - radar_size2d_y));\r
+       \r
+       radar_extraclip_mins = radar_extraclip_maxs = '0 0 0';\r
+       if(cl_radar_position == '1 0 0')\r
+       {\r
+               if(cl_radar_nohudhack < 2)\r
+                       radar_origin2d_y += 25;\r
+               if(cl_radar_nohudhack < 1)\r
+                       radar_extraclip_mins_y -= 25;\r
+       }\r
+       else if(cl_radar_position == '0 1 0' || cl_radar_position == '1 1 0')\r
+       {\r
+               if(cl_radar_nohudhack < 2)\r
+                       radar_origin2d_y -= 50;\r
+               //if(cl_radar_nohudhack < 1)\r
+                       //radar_extraclip_size_y += 50; // don't, the HUD looks nice\r
+       }\r
+\r
+       // pixels per world qu to match the radar_size2d_x range in the longest dimension\r
+       if(cl_radar_rotation == 0)\r
+       {\r
+               // max-min distance must fit the radar in any rotation\r
+               bigsize = vlen_minnorm2d(radar_size2d) * scale2d / (1.05 * vlen2d(mi_max - mi_min));\r
+       }\r
+       else\r
+       {\r
+               vector c0, c1, c2, c3, span;\r
+               c0 = rotate(mi_min, radar_angle * DEG2RAD);\r
+               c1 = rotate(mi_max, radar_angle * DEG2RAD);\r
+               c2 = rotate('1 0 0' * mi_min_x + '0 1 0' * mi_max_y, radar_angle * DEG2RAD);\r
+               c3 = rotate('1 0 0' * mi_max_x + '0 1 0' * mi_min_y, radar_angle * DEG2RAD);\r
+               span = '0 0 0';\r
+               span_x = max4(c0_x, c1_x, c2_x, c3_x) - min4(c0_x, c1_x, c2_x, c3_x);\r
+               span_y = max4(c0_y, c1_y, c2_y, c3_y) - min4(c0_y, c1_y, c2_y, c3_y);\r
+\r
+               // max-min distance must fit the radar in x=x, y=y\r
+               bigsize = min(\r
+                       radar_size2d_x * scale2d / (1.05 * span_x),\r
+                       radar_size2d_y * scale2d / (1.05 * span_y)\r
+               );\r
+       }\r
+\r
+       normalsize = vlen_maxnorm2d(radar_size2d) * scale2d / cl_radar_scale;\r
+       if(bigsize > normalsize)\r
+               normalsize = bigsize;\r
+\r
+       radar_size =\r
+                 f * bigsize\r
+               + (1 - f) * normalsize;\r
+       radar_origin3d_in_texcoord = radar_3dcoord_to_texcoord(\r
+                 f * (mi_min + mi_max) * 0.5\r
+               + (1 - f) * view_origin);\r
+\r
+       color1 = GetPlayerColor(player_localentnum-1);\r
+       rgb = GetTeamRGB(color1);\r
+\r
+       drawsetcliparea(\r
+               radar_origin2d_x - radar_size2d_x * 0.5 + radar_extraclip_mins_x,\r
+               radar_origin2d_y - radar_size2d_y * 0.5 + radar_extraclip_mins_y,\r
+               radar_size2d_x + radar_extraclip_maxs_x - radar_extraclip_mins_x,\r
+               radar_size2d_y + radar_extraclip_maxs_y - radar_extraclip_mins_y\r
+       );\r
+\r
+       draw_radar_background(cl_radar_background_alpha, cl_radar_foreground_alpha);\r
+\r
+       if(ons_showmap)\r
+       {\r
+               drawresetcliparea();\r
+\r
+               vector frame_origin, frame_size;\r
+               frame_origin = frame_size = '0 0 0';\r
+\r
+               frame_origin_x = radar_origin2d_x - radar_size2d_x * 0.55859375; // matches the picture\r
+               frame_origin_y = radar_origin2d_y - radar_size2d_y * 0.55859375; // matches the picture\r
+               frame_size_x = radar_size2d_x * 1.1171875; // matches the picture\r
+               frame_size_y = radar_size2d_y * 1.1171875; // matches the picture\r
+               drawpic(frame_origin, "gfx/ons-frame.tga", frame_size, '1 1 1', sbar_alpha_fg, 0);\r
+               drawpic(frame_origin, "gfx/ons-frame-team.tga", frame_size, rgb, sbar_alpha_fg, 0);\r
+\r
+               drawsetcliparea(\r
+                       radar_origin2d_x - radar_size2d_x * 0.5,\r
+                       radar_origin2d_y - radar_size2d_y * 0.5,\r
+                       radar_size2d_x,\r
+                       radar_size2d_y\r
+               );\r
+       }\r
+\r
+       for(tm = world; (tm = find(tm, classname, "radarlink")); )\r
+               draw_radar_link(tm.origin, tm.velocity, tm.team);\r
+       for(tm = world; (tm = findflags(tm, radar_icon, 0xFFFFFF)); )\r
+               draw_radar_icon(tm.origin, tm.radar_icon, tm, tm.radar_color, tm.alpha * sbar_alpha_fg);\r
+       for(tm = world; (tm = find(tm, classname, "entcs_receiver")); )\r
+       {\r
+               color2 = GetPlayerColor(tm.sv_entnum);\r
+               //if(color == COLOR_SPECTATOR || color == color2)\r
+                       draw_radar_player(tm.origin, tm.angles, GetTeamRGB(color2));\r
+       }\r
+       draw_radar_player(view_origin, view_angles, '1 1 1');\r
+\r
+       drawresetcliparea();\r
+};\r
+\r
+\r
+\r
+// radar links\r
+\r
+void Ent_RadarLink()\r
+{\r
+       float sendflags;\r
+       sendflags = ReadByte();\r
+\r
+       InterpolateOrigin_Undo();\r
+\r
+       self.iflags = IFLAG_VELOCITY;\r
+       self.classname = "radarlink";\r
+\r
+       if(sendflags & 1)\r
+       {\r
+               self.origin_x = ReadCoord();\r
+               self.origin_y = ReadCoord();\r
+               self.origin_z = ReadCoord();\r
+       }\r
+\r
+       if(sendflags & 2)\r
+       {\r
+               self.velocity_x = ReadCoord();\r
+               self.velocity_y = ReadCoord();\r
+               self.velocity_z = ReadCoord();\r
+       }\r
+\r
+       if(sendflags & 4)\r
+       {\r
+               self.team = ReadByte();\r
+       }\r
+\r
+       InterpolateOrigin_Note();\r
+}\r
diff --git a/data/qcsrc/client/radar.qh b/data/qcsrc/client/radar.qh
new file mode 100644 (file)
index 0000000..8b702c4
--- /dev/null
@@ -0,0 +1,9 @@
+void radar_view();\r
+\r
+#define MAX_RADAR_TIMES 32\r
+\r
+// to make entities have dots on the team radar\r
+.float radar_icon;\r
+.float radar_times[MAX_RADAR_TIMES];\r
+.float radar_time_index;\r
+.vector radar_color;\r
diff --git a/data/qcsrc/client/teamradar.qc b/data/qcsrc/client/teamradar.qc
deleted file mode 100644 (file)
index 9e66865..0000000
+++ /dev/null
@@ -1,409 +0,0 @@
-float teamradar_angle; // player yaw angle\r
-vector teamradar_origin3d_in_texcoord; // player origin\r
-vector teamradar_origin2d; // 2D origin\r
-vector teamradar_size2d; // 2D size\r
-vector teamradar_extraclip_mins, teamradar_extraclip_maxs; // don't even ask\r
-float teamradar_size; // 2D scale factor\r
-float cl_teamradar_scale; // window size = ...qu\r
-float cl_teamradar_nohudhack;\r
-float v_flipped;\r
-\r
-float vlen2d(vector v)\r
-{\r
-       return sqrt(v_x * v_x + v_y * v_y);\r
-}\r
-\r
-float vlen_maxnorm2d(vector v)\r
-{\r
-       return max4(v_x, v_y, -v_x, -v_y);\r
-}\r
-\r
-float vlen_minnorm2d(vector v)\r
-{\r
-       return min(max(v_x, -v_x), max(v_y, -v_y));\r
-}\r
-\r
-vector teamradar_3dcoord_to_texcoord(vector in)\r
-{\r
-       vector out;\r
-       out_x = (in_x - mi_picmin_x) / (mi_picmax_x - mi_picmin_x);\r
-       out_y = (in_y - mi_picmin_y) / (mi_picmax_y - mi_picmin_y);\r
-       out_z = 0;\r
-       return out;\r
-}\r
-\r
-vector teamradar_texcoord_to_2dcoord(vector in)\r
-{\r
-       vector out;\r
-       in -= teamradar_origin3d_in_texcoord;\r
-\r
-       out = rotate(in, teamradar_angle * DEG2RAD);\r
-       out_y = - out_y; // screen space is reversed\r
-\r
-       out = out * teamradar_size;\r
-       if(v_flipped)\r
-               out_x = -out_x;\r
-       out += teamradar_origin2d;\r
-       return out;\r
-}\r
-\r
-vector yinvert(vector v)\r
-{\r
-       v_y = 1 - v_y;\r
-       return v;\r
-}\r
-\r
-void draw_teamradar_background(float bg, float fg)\r
-{\r
-       float fga;\r
-       vector fgc;\r
-       if(bg > 0)\r
-       {\r
-               R_BeginPolygon("", 0);\r
-               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
-               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
-               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
-               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
-               R_EndPolygon();\r
-       }\r
-\r
-       if(fg > 0 && minimapname != "")\r
-       {\r
-               fga = 1;\r
-               fgc = '1 1 1' * fg;\r
-               R_BeginPolygon(minimapname, DRAWFLAG_SCREEN | DRAWFLAG_MIPMAP);\r
-               if(v_flipped)\r
-               {\r
-                       R_PolygonVertex(teamradar_texcoord_to_2dcoord(mi_pictexcoord3), yinvert(mi_pictexcoord3), fgc, fga);\r
-                       R_PolygonVertex(teamradar_texcoord_to_2dcoord(mi_pictexcoord2), yinvert(mi_pictexcoord2), fgc, fga);\r
-                       R_PolygonVertex(teamradar_texcoord_to_2dcoord(mi_pictexcoord1), yinvert(mi_pictexcoord1), fgc, fga);\r
-                       R_PolygonVertex(teamradar_texcoord_to_2dcoord(mi_pictexcoord0), yinvert(mi_pictexcoord0), fgc, fga);\r
-               }\r
-               else\r
-               {\r
-                       R_PolygonVertex(teamradar_texcoord_to_2dcoord(mi_pictexcoord0), yinvert(mi_pictexcoord0), fgc, fga);\r
-                       R_PolygonVertex(teamradar_texcoord_to_2dcoord(mi_pictexcoord1), yinvert(mi_pictexcoord1), fgc, fga);\r
-                       R_PolygonVertex(teamradar_texcoord_to_2dcoord(mi_pictexcoord2), yinvert(mi_pictexcoord2), fgc, fga);\r
-                       R_PolygonVertex(teamradar_texcoord_to_2dcoord(mi_pictexcoord3), yinvert(mi_pictexcoord3), fgc, fga);\r
-               }\r
-               R_EndPolygon();\r
-       }\r
-}\r
-\r
-void(vector coord3d, vector pangles, vector rgb) draw_teamradar_player =\r
-{\r
-       vector coord, rgb2;\r
-\r
-       coord = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(coord3d));\r
-\r
-       makevectors(pangles - '0 1 0' * teamradar_angle);\r
-       if(v_flipped)\r
-       {\r
-               v_forward_x = -v_forward_x;\r
-               v_right_x = -v_right_x;\r
-               v_up_x = -v_up_x;\r
-       }\r
-       v_forward_z = 0;\r
-       v_forward = normalize(v_forward);\r
-       v_forward_y *= -1.0;\r
-       v_right_x = -v_forward_y;\r
-       v_right_y = v_forward_x;\r
-\r
-       if(rgb == '1 1 1')\r
-               rgb2 = '0 0 0';\r
-       else\r
-               rgb2 = '1 1 1';\r
-\r
-       R_BeginPolygon("", 0);\r
-       R_PolygonVertex(coord+v_forward*3, '0 0 0', rgb2, sbar_alpha_fg);\r
-       R_PolygonVertex(coord+v_right*4-v_forward*2.5, '0 1 0', rgb2, sbar_alpha_fg);\r
-       R_PolygonVertex(coord-v_forward*2, '1 0 0', rgb2, sbar_alpha_fg);\r
-       R_PolygonVertex(coord-v_right*4-v_forward*2.5, '1 1 0', rgb2, sbar_alpha_fg);\r
-       R_EndPolygon();\r
-\r
-       R_BeginPolygon("", 0);\r
-       R_PolygonVertex(coord+v_forward*2, '0 0 0', rgb, sbar_alpha_fg);\r
-       R_PolygonVertex(coord+v_right*3-v_forward*2, '0 1 0', rgb, sbar_alpha_fg);\r
-       R_PolygonVertex(coord-v_forward, '1 0 0', rgb, sbar_alpha_fg);\r
-       R_PolygonVertex(coord-v_right*3-v_forward*2, '1 1 0', rgb, sbar_alpha_fg);\r
-       R_EndPolygon();\r
-};\r
-\r
-void draw_teamradar_icon(vector coord, float icon, entity pingdata, vector rgb, float a)\r
-{\r
-       float dt;\r
-       vector v;\r
-       float i;\r
-\r
-       coord = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(coord));\r
-       drawpic(coord - '4 4 0', strcat("gfx/teamradar_icon_", ftos(icon)), '8 8 0', rgb, a, 0);\r
-\r
-       if(pingdata)\r
-       {\r
-               for(i = 0; i < MAX_TEAMRADAR_TIMES; ++i)\r
-               {\r
-                       dt = pingdata.(teamradar_times[i]);\r
-                       if(dt == 0)\r
-                               continue;\r
-                       dt = time - dt;\r
-                       if(dt >= 1 || dt <= 0)\r
-                               continue;\r
-                       v = '2 2 0' * teamradar_size * dt;\r
-                       drawpic(coord - 0.5 * v, "gfx/teamradar_ping", v, '1 1 1', (1 - dt) * a, DRAWFLAG_ADDITIVE);\r
-               }\r
-       }\r
-}\r
-\r
-void draw_teamradar_link(vector start, vector end, float colors)\r
-{\r
-       vector c0, c1, norm;\r
-\r
-       start = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(start));\r
-       end = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(end));\r
-       norm = normalize(start - end);\r
-       norm_z = norm_x;\r
-       norm_x = -norm_y;\r
-       norm_y = norm_z;\r
-       norm_z = 0;\r
-\r
-       c0 = colormapPaletteColor(colors & 0x0F, FALSE);\r
-       c1 = colormapPaletteColor((colors & 0xF0) / 0x10, FALSE);\r
-\r
-       R_BeginPolygon("", 0);\r
-       R_PolygonVertex(start - norm, '0 0 0', c0, sbar_alpha_fg);\r
-       R_PolygonVertex(start + norm, '0 1 0', c0, sbar_alpha_fg);\r
-       R_PolygonVertex(end + norm, '1 1 0', c1, sbar_alpha_fg);\r
-       R_PolygonVertex(end - norm, '1 0 0', c1, sbar_alpha_fg);\r
-       R_EndPolygon();\r
-}\r
-\r
-float cl_teamradar_scale;\r
-float cl_teamradar_background_alpha;\r
-float cl_teamradar_foreground_alpha;\r
-float cl_teamradar_rotation;\r
-vector cl_teamradar_size;\r
-vector cl_teamradar_position;\r
-float cl_teamradar_zoommode;\r
-\r
-void teamradar_loadcvars()\r
-{\r
-       v_flipped = cvar("v_flipped");\r
-       if(ons_showmap)\r
-       {\r
-               cl_teamradar_scale = 42; // dummy, not used (see zoommode)\r
-               cl_teamradar_background_alpha = 1 * (1 - cvar("_menu_alpha"));\r
-               cl_teamradar_foreground_alpha = 1 * (1 - cvar("_menu_alpha"));\r
-               cl_teamradar_rotation = cvar("cl_teamradar_rotation");\r
-               if(!cl_teamradar_rotation)\r
-                       cl_teamradar_rotation = 4;\r
-               cl_teamradar_size = '256 256 0'; // TODO make somewhat variable?\r
-               cl_teamradar_position = '0.5 0.5 0';\r
-               cl_teamradar_zoommode = 3;\r
-               cl_teamradar_nohudhack = 0;\r
-       }\r
-       else\r
-       {\r
-               cl_teamradar_scale = cvar("cl_teamradar_scale");\r
-               cl_teamradar_background_alpha = cvar("cl_teamradar_background_alpha") * sbar_alpha_fg;\r
-               cl_teamradar_foreground_alpha = cvar("cl_teamradar_foreground_alpha") * sbar_alpha_fg;\r
-               cl_teamradar_rotation = cvar("cl_teamradar_rotation");\r
-               cl_teamradar_size = stov(cvar_string("cl_teamradar_size"));\r
-               cl_teamradar_position = stov(cvar_string("cl_teamradar_position"));\r
-               cl_teamradar_zoommode = cvar("cl_teamradar_zoommode");\r
-\r
-               // others default to 0\r
-               // match this to defaultVoretournament.cfg!\r
-               if(!cl_teamradar_scale) cl_teamradar_scale = 4096;\r
-               if(!cl_teamradar_background_alpha) cl_teamradar_background_alpha = 0.4 * sbar_alpha_fg;\r
-               if(!cl_teamradar_foreground_alpha) cl_teamradar_foreground_alpha = 0.8 * sbar_alpha_fg;\r
-               if(!cl_teamradar_size_x) cl_teamradar_size_x = 128;\r
-               if(!cl_teamradar_size_y) cl_teamradar_size_y = cl_teamradar_size_x;\r
-\r
-               cl_teamradar_size_z = 0;\r
-               cl_teamradar_nohudhack = cl_teamradar_position_z;\r
-               cl_teamradar_position_z = 0;\r
-       }\r
-}\r
-\r
-void() teamradar_view =\r
-{\r
-       local float color1, color2; // color already declared as a global in hud.qc\r
-       local vector rgb;\r
-       local entity tm;\r
-       float scale2d, normalsize, bigsize;\r
-       float f;\r
-\r
-       if(minimapname == "" && !ons_showmap)\r
-               return;\r
-\r
-       teamradar_loadcvars();\r
-\r
-       switch(cl_teamradar_zoommode)\r
-       {\r
-               default:\r
-               case 0:\r
-                       f = current_zoomfraction;\r
-                       break;\r
-               case 1:\r
-                       f = 1 - current_zoomfraction;\r
-                       break;\r
-               case 2:\r
-                       f = 0;\r
-                       break;\r
-               case 3:\r
-                       f = 1;\r
-                       break;\r
-       }\r
-\r
-       switch(cl_teamradar_rotation)\r
-       {\r
-               case 0:\r
-                       teamradar_angle = view_angles_y - 90;\r
-                       break;\r
-               default:\r
-                       teamradar_angle = 90 * cl_teamradar_rotation;\r
-                       break;\r
-       }\r
-\r
-       scale2d = vlen_maxnorm2d(mi_picmax - mi_picmin);\r
-       teamradar_size2d = cl_teamradar_size;\r
-\r
-       teamradar_origin2d =\r
-                 '1 0 0' * (0.5 * teamradar_size2d_x + cl_teamradar_position_x * (vid_conwidth - teamradar_size2d_x))\r
-               + '0 1 0' * (0.5 * teamradar_size2d_y + cl_teamradar_position_y * (vid_conheight - teamradar_size2d_y));\r
-       \r
-       teamradar_extraclip_mins = teamradar_extraclip_maxs = '0 0 0';\r
-       if(cl_teamradar_position == '1 0 0')\r
-       {\r
-               if(cl_teamradar_nohudhack < 2)\r
-                       teamradar_origin2d_y += 25;\r
-               if(cl_teamradar_nohudhack < 1)\r
-                       teamradar_extraclip_mins_y -= 25;\r
-       }\r
-       else if(cl_teamradar_position == '0 1 0' || cl_teamradar_position == '1 1 0')\r
-       {\r
-               if(cl_teamradar_nohudhack < 2)\r
-                       teamradar_origin2d_y -= 50;\r
-               //if(cl_teamradar_nohudhack < 1)\r
-                       //teamradar_extraclip_size_y += 50; // don't, the HUD looks nice\r
-       }\r
-\r
-       // pixels per world qu to match the teamradar_size2d_x range in the longest dimension\r
-       if(cl_teamradar_rotation == 0)\r
-       {\r
-               // max-min distance must fit the radar in any rotation\r
-               bigsize = vlen_minnorm2d(teamradar_size2d) * scale2d / (1.05 * vlen2d(mi_max - mi_min));\r
-       }\r
-       else\r
-       {\r
-               vector c0, c1, c2, c3, span;\r
-               c0 = rotate(mi_min, teamradar_angle * DEG2RAD);\r
-               c1 = rotate(mi_max, teamradar_angle * DEG2RAD);\r
-               c2 = rotate('1 0 0' * mi_min_x + '0 1 0' * mi_max_y, teamradar_angle * DEG2RAD);\r
-               c3 = rotate('1 0 0' * mi_max_x + '0 1 0' * mi_min_y, teamradar_angle * DEG2RAD);\r
-               span = '0 0 0';\r
-               span_x = max4(c0_x, c1_x, c2_x, c3_x) - min4(c0_x, c1_x, c2_x, c3_x);\r
-               span_y = max4(c0_y, c1_y, c2_y, c3_y) - min4(c0_y, c1_y, c2_y, c3_y);\r
-\r
-               // max-min distance must fit the radar in x=x, y=y\r
-               bigsize = min(\r
-                       teamradar_size2d_x * scale2d / (1.05 * span_x),\r
-                       teamradar_size2d_y * scale2d / (1.05 * span_y)\r
-               );\r
-       }\r
-\r
-       normalsize = vlen_maxnorm2d(teamradar_size2d) * scale2d / cl_teamradar_scale;\r
-       if(bigsize > normalsize)\r
-               normalsize = bigsize;\r
-\r
-       teamradar_size =\r
-                 f * bigsize\r
-               + (1 - f) * normalsize;\r
-       teamradar_origin3d_in_texcoord = teamradar_3dcoord_to_texcoord(\r
-                 f * (mi_min + mi_max) * 0.5\r
-               + (1 - f) * view_origin);\r
-\r
-       color1 = GetPlayerColor(player_localentnum-1);\r
-       rgb = GetTeamRGB(color1);\r
-\r
-       drawsetcliparea(\r
-               teamradar_origin2d_x - teamradar_size2d_x * 0.5 + teamradar_extraclip_mins_x,\r
-               teamradar_origin2d_y - teamradar_size2d_y * 0.5 + teamradar_extraclip_mins_y,\r
-               teamradar_size2d_x + teamradar_extraclip_maxs_x - teamradar_extraclip_mins_x,\r
-               teamradar_size2d_y + teamradar_extraclip_maxs_y - teamradar_extraclip_mins_y\r
-       );\r
-\r
-       draw_teamradar_background(cl_teamradar_background_alpha, cl_teamradar_foreground_alpha);\r
-\r
-       if(ons_showmap)\r
-       {\r
-               drawresetcliparea();\r
-\r
-               vector frame_origin, frame_size;\r
-               frame_origin = frame_size = '0 0 0';\r
-\r
-               frame_origin_x = teamradar_origin2d_x - teamradar_size2d_x * 0.55859375; // matches the picture\r
-               frame_origin_y = teamradar_origin2d_y - teamradar_size2d_y * 0.55859375; // matches the picture\r
-               frame_size_x = teamradar_size2d_x * 1.1171875; // matches the picture\r
-               frame_size_y = teamradar_size2d_y * 1.1171875; // matches the picture\r
-               drawpic(frame_origin, "gfx/ons-frame.tga", frame_size, '1 1 1', sbar_alpha_fg, 0);\r
-               drawpic(frame_origin, "gfx/ons-frame-team.tga", frame_size, rgb, sbar_alpha_fg, 0);\r
-\r
-               drawsetcliparea(\r
-                       teamradar_origin2d_x - teamradar_size2d_x * 0.5,\r
-                       teamradar_origin2d_y - teamradar_size2d_y * 0.5,\r
-                       teamradar_size2d_x,\r
-                       teamradar_size2d_y\r
-               );\r
-       }\r
-\r
-       for(tm = world; (tm = find(tm, classname, "radarlink")); )\r
-               draw_teamradar_link(tm.origin, tm.velocity, tm.team);\r
-       for(tm = world; (tm = findflags(tm, teamradar_icon, 0xFFFFFF)); )\r
-               draw_teamradar_icon(tm.origin, tm.teamradar_icon, tm, tm.teamradar_color, tm.alpha * sbar_alpha_fg);\r
-       for(tm = world; (tm = find(tm, classname, "entcs_receiver")); )\r
-       {\r
-               color2 = GetPlayerColor(tm.sv_entnum);\r
-               //if(color == COLOR_SPECTATOR || color == color2)\r
-                       draw_teamradar_player(tm.origin, tm.angles, GetTeamRGB(color2));\r
-       }\r
-       draw_teamradar_player(view_origin, view_angles, '1 1 1');\r
-\r
-       drawresetcliparea();\r
-};\r
-\r
-\r
-\r
-// radar links\r
-\r
-void Ent_RadarLink()\r
-{\r
-       float sendflags;\r
-       sendflags = ReadByte();\r
-\r
-       InterpolateOrigin_Undo();\r
-\r
-       self.iflags = IFLAG_VELOCITY;\r
-       self.classname = "radarlink";\r
-\r
-       if(sendflags & 1)\r
-       {\r
-               self.origin_x = ReadCoord();\r
-               self.origin_y = ReadCoord();\r
-               self.origin_z = ReadCoord();\r
-       }\r
-\r
-       if(sendflags & 2)\r
-       {\r
-               self.velocity_x = ReadCoord();\r
-               self.velocity_y = ReadCoord();\r
-               self.velocity_z = ReadCoord();\r
-       }\r
-\r
-       if(sendflags & 4)\r
-       {\r
-               self.team = ReadByte();\r
-       }\r
-\r
-       InterpolateOrigin_Note();\r
-}\r
diff --git a/data/qcsrc/client/teamradar.qh b/data/qcsrc/client/teamradar.qh
deleted file mode 100644 (file)
index a892cc3..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-void teamradar_view();\r
-\r
-#define MAX_TEAMRADAR_TIMES 32\r
-\r
-// to make entities have dots on the team radar\r
-.float teamradar_icon;\r
-.float teamradar_times[MAX_TEAMRADAR_TIMES];\r
-.float teamradar_time_index;\r
-.vector teamradar_color;\r
index 3d0d3084e7537ed9eab5dda4342edb10b9c51824..020e8953f74c97e1faa6f1507b01f8dc2439c559 100644 (file)
@@ -293,7 +293,7 @@ void Draw_WaypointSprite()
                        align = 0.5;\r
                else\r
                        align = 0;\r
-               drawhealthbar(o, rot * 90 * DEG2RAD, self.health, SPRITE_SIZE * t, SPRITE_HOTSPOT * t, SPRITE_HEALTHBAR_WIDTH * t, SPRITE_HEALTHBAR_HEIGHT * t, SPRITE_HEALTHBAR_MARGIN * t, SPRITE_HEALTHBAR_BORDER * t, align, self.teamradar_color, a * SPRITE_HEALTHBAR_BORDERALPHA, self.teamradar_color, a * SPRITE_HEALTHBAR_HEALTHALPHA, DRAWFLAG_NORMAL);\r
+               drawhealthbar(o, rot * 90 * DEG2RAD, self.health, SPRITE_SIZE * t, SPRITE_HOTSPOT * t, SPRITE_HEALTHBAR_WIDTH * t, SPRITE_HEALTHBAR_HEIGHT * t, SPRITE_HEALTHBAR_MARGIN * t, SPRITE_HEALTHBAR_BORDER * t, align, self.radar_color, a * SPRITE_HEALTHBAR_BORDERALPHA, self.radar_color, a * SPRITE_HEALTHBAR_HEALTHALPHA, DRAWFLAG_NORMAL);\r
        }\r
 }\r
 \r
@@ -391,15 +391,15 @@ void Ent_WaypointSprite()
        if(sendflags & 32)\r
        {\r
                f = ReadByte();\r
-               self.teamradar_icon = (f & 0x7F);\r
+               self.radar_icon = (f & 0x7F);\r
                if(f & 0x80)\r
                {\r
-                       self.(teamradar_times[self.teamradar_time_index]) = time;\r
-                       self.teamradar_time_index = mod(self.teamradar_time_index + 1, MAX_TEAMRADAR_TIMES);\r
+                       self.(radar_times[self.radar_time_index]) = time;\r
+                       self.radar_time_index = mod(self.radar_time_index + 1, MAX_RADAR_TIMES);\r
                }\r
-               self.teamradar_color_x = ReadByte() / 255.0;\r
-               self.teamradar_color_y = ReadByte() / 255.0;\r
-               self.teamradar_color_z = ReadByte() / 255.0;\r
+               self.radar_color_x = ReadByte() / 255.0;\r
+               self.radar_color_y = ReadByte() / 255.0;\r
+               self.radar_color_z = ReadByte() / 255.0;\r
        }\r
 \r
        InterpolateOrigin_Note();\r
index 317cac2edf25b9670cf18fedbe7ee993deadd968..7e4077c1e0812cd96f51eab38fc9501a5e086c47 100644 (file)
@@ -92,13 +92,13 @@ void fillVoretHudDialog(entity me)
        me.TR(me);\r
                me.TDempty(me, 0.2);\r
                me.TD(me, 1, 0.8, e = makeVoretTextLabel(0, "Position:"));\r
-               me.TD(me, 1, 1, e = makeVoretRadioButton(1, "cl_teamradar_position", "0 0", "Top left"));\r
-               me.TD(me, 1, 1, e = makeVoretRadioButton(1, "cl_teamradar_position", "0.5 0", "Top middle"));\r
-               me.TD(me, 1, 1, e = makeVoretRadioButton(1, "cl_teamradar_position", "1 0", "Top right"));\r
+               me.TD(me, 1, 1, e = makeVoretRadioButton(1, "cl_radar_position", "0 0", "Top left"));\r
+               me.TD(me, 1, 1, e = makeVoretRadioButton(1, "cl_radar_position", "0.5 0", "Top middle"));\r
+               me.TD(me, 1, 1, e = makeVoretRadioButton(1, "cl_radar_position", "1 0", "Top right"));\r
        me.TR(me);\r
                me.TDempty(me, 0.2);\r
                me.TD(me, 1, 0.8, e = makeVoretTextLabel(0, "Size:"));\r
-               me.TD(me, 1, 3, e = makeVoretTextSlider("cl_teamradar_size"));\r
+               me.TD(me, 1, 3, e = makeVoretTextSlider("cl_radar_size"));\r
                        e.addValue(e, "96x96", "96 96");\r
                        e.addValue(e, "128x96", "128 96");\r
                        e.addValue(e, "128x128", "128 128");\r
@@ -109,7 +109,7 @@ void fillVoretHudDialog(entity me)
                        e.configureVoretTextSliderValues(e);\r
        me.TR(me);\r
                me.TDempty(me, 0.2);\r
-               sl = makeVoretSlider(0.20, 1, 0.01, "cl_teamradar_background_alpha");\r
+               sl = makeVoretSlider(0.20, 1, 0.01, "cl_radar_background_alpha");\r
                me.TD(me, 1, 0.8, e = makeVoretSliderCheckBox(-1, 1, sl, "Background:"));\r
                me.TD(me, 1, 3, sl);\r
        me.TR(me);\r
index 91941e3c5d8bcaef085dd1451c83cb478942951e..8f4148cdd24123f03846b98091c3244f86649ccc 100644 (file)
@@ -148,7 +148,7 @@ void target_objective_decrease_activate()
                        WaypointSprite_UpdateSprites(spr, "as-defend", "as-destroy", "as-destroy");\r
                else\r
                        WaypointSprite_UpdateSprites(spr, "as-defend", "as-push", "as-push");\r
-               WaypointSprite_UpdateTeamRadar(spr, RADARICON_OBJECTIVE, '1 0.5 0');\r
+               WaypointSprite_UpdateRadar(spr, RADARICON_OBJECTIVE, '1 0.5 0');\r
        }\r
 }\r
 \r
index f3d35ea0ef10fb4baebfaa86fbb8ef35a3f5ab0c..e52b0e133cebfbde5a60025640fe4e828903e972 100644 (file)
@@ -133,7 +133,7 @@ void ImpulseCommands (void)
                                wp = WaypointSprite_DeployPersonal("waypoint", self.origin);\r
                                if(wp)\r
                                {\r
-                                       WaypointSprite_UpdateTeamRadar(wp, RADARICON_WAYPOINT, '0 1 1');\r
+                                       WaypointSprite_UpdateRadar(wp, RADARICON_WAYPOINT, '0 1 1');\r
                                        WaypointSprite_Ping(wp);\r
                                }\r
                                sprint(self, "personal waypoint spawned at location\n");\r
@@ -143,7 +143,7 @@ void ImpulseCommands (void)
                                wp = WaypointSprite_DeployPersonal("waypoint", trace_endpos);\r
                                if(wp)\r
                                {\r
-                                       WaypointSprite_UpdateTeamRadar(wp, RADARICON_WAYPOINT, '0 1 1');\r
+                                       WaypointSprite_UpdateRadar(wp, RADARICON_WAYPOINT, '0 1 1');\r
                                        WaypointSprite_Ping(wp);\r
                                }\r
                                sprint(self, "personal waypoint spawned at crosshair\n");\r
@@ -154,7 +154,7 @@ void ImpulseCommands (void)
                                        wp = WaypointSprite_DeployPersonal("waypoint", self.death_origin);\r
                                        if(wp)\r
                                        {\r
-                                               WaypointSprite_UpdateTeamRadar(wp, RADARICON_WAYPOINT, '0 1 1');\r
+                                               WaypointSprite_UpdateRadar(wp, RADARICON_WAYPOINT, '0 1 1');\r
                                                WaypointSprite_Ping(wp);\r
                                        }\r
                                        sprint(self, "personal waypoint spawned at death location\n");\r
@@ -165,7 +165,7 @@ void ImpulseCommands (void)
                                {\r
                                        wp = WaypointSprite_Attach("helpme", TRUE);\r
                                        if(wp)\r
-                                               WaypointSprite_UpdateTeamRadar(wp, RADARICON_HELPME, '1 0.5 0'); // TODO choose better color\r
+                                               WaypointSprite_UpdateRadar(wp, RADARICON_HELPME, '1 0.5 0'); // TODO choose better color\r
                                        if(!wp)\r
                                                wp = self.waypointsprite_attachedforcarrier; // flag sprite?\r
                                        if(wp)\r
@@ -177,7 +177,7 @@ void ImpulseCommands (void)
                                wp = WaypointSprite_DeployFixed("here", FALSE, self.origin);\r
                                if(wp)\r
                                {\r
-                                       WaypointSprite_UpdateTeamRadar(wp, RADARICON_HERE, '0 1 0');\r
+                                       WaypointSprite_UpdateRadar(wp, RADARICON_HERE, '0 1 0');\r
                                        WaypointSprite_Ping(wp);\r
                                }\r
                                sprint(self, "HERE spawned at location\n");\r
@@ -187,7 +187,7 @@ void ImpulseCommands (void)
                                wp = WaypointSprite_DeployFixed("here", FALSE, trace_endpos);\r
                                if(wp)\r
                                {\r
-                                       WaypointSprite_UpdateTeamRadar(wp, RADARICON_HERE, '0 1 0');\r
+                                       WaypointSprite_UpdateRadar(wp, RADARICON_HERE, '0 1 0');\r
                                        WaypointSprite_Ping(wp);\r
                                }\r
                                sprint(self, "HERE spawned at crosshair\n");\r
@@ -198,7 +198,7 @@ void ImpulseCommands (void)
                                        wp = WaypointSprite_DeployFixed("here", FALSE, self.death_origin);\r
                                        if(wp)\r
                                        {\r
-                                               WaypointSprite_UpdateTeamRadar(wp, RADARICON_HERE, '0 1 0');\r
+                                               WaypointSprite_UpdateRadar(wp, RADARICON_HERE, '0 1 0');\r
                                                WaypointSprite_Ping(wp);\r
                                        }\r
                                        sprint(self, "HERE spawned at death location\n");\r
@@ -208,7 +208,7 @@ void ImpulseCommands (void)
                                wp = WaypointSprite_DeployFixed("danger", FALSE, self.origin);\r
                                if(wp)\r
                                {\r
-                                       WaypointSprite_UpdateTeamRadar(wp, RADARICON_DANGER, '1 0.5 0');\r
+                                       WaypointSprite_UpdateRadar(wp, RADARICON_DANGER, '1 0.5 0');\r
                                        WaypointSprite_Ping(wp);\r
                                }\r
                                sprint(self, "DANGER spawned at location\n");\r
@@ -218,7 +218,7 @@ void ImpulseCommands (void)
                                wp = WaypointSprite_DeployFixed("danger", FALSE, trace_endpos);\r
                                if(wp)\r
                                {\r
-                                       WaypointSprite_UpdateTeamRadar(wp, RADARICON_DANGER, '1 0.5 0');\r
+                                       WaypointSprite_UpdateRadar(wp, RADARICON_DANGER, '1 0.5 0');\r
                                        WaypointSprite_Ping(wp);\r
                                }\r
                                sprint(self, "DANGER spawned at crosshair\n");\r
@@ -229,7 +229,7 @@ void ImpulseCommands (void)
                                        wp = WaypointSprite_DeployFixed("danger", FALSE, self.death_origin);\r
                                        if(wp)\r
                                        {\r
-                                               WaypointSprite_UpdateTeamRadar(wp, RADARICON_DANGER, '1 0.5 0');\r
+                                               WaypointSprite_UpdateRadar(wp, RADARICON_DANGER, '1 0.5 0');\r
                                                WaypointSprite_Ping(wp);\r
                                        }\r
                                        sprint(self, "DANGER spawned at death location\n");\r
index 25a20e2c009c8ba9a320fcb86c1b7f97a2a6ceae..38f476f3fad9ded1ca4f4cfe4ac0416520289c7c 100644 (file)
@@ -127,12 +127,12 @@ void ctf_flag_spawnstuff()
        if(self.team == COLOR_TEAM1)\r
        {\r
                WaypointSprite_SpawnFixed("redbase", self.origin + '0 0 61', self, sprite);\r
-               WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_FLAG, colormapPaletteColor(COLOR_TEAM1 - 1, FALSE));\r
+               WaypointSprite_UpdateRadar(self.sprite, RADARICON_FLAG, colormapPaletteColor(COLOR_TEAM1 - 1, FALSE));\r
        }\r
        else\r
        {\r
                WaypointSprite_SpawnFixed("bluebase", self.origin + '0 0 61', self, sprite);\r
-               WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_FLAG, colormapPaletteColor(COLOR_TEAM2 - 1, FALSE));\r
+               WaypointSprite_UpdateRadar(self.sprite, RADARICON_FLAG, colormapPaletteColor(COLOR_TEAM2 - 1, FALSE));\r
        }\r
 }\r
 \r
@@ -557,7 +557,7 @@ void FlagTouch()
                setorigin(self, FLAG_CARRY_POS);\r
                setattachment(self, other, "");\r
                WaypointSprite_AttachCarrier("flagcarrier", other);\r
-               WaypointSprite_UpdateTeamRadar(other.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '1 1 0');\r
+               WaypointSprite_UpdateRadar(other.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '1 1 0');\r
                WaypointSprite_Ping(self.sprite);\r
 \r
                return;\r
@@ -645,7 +645,7 @@ void FlagTouch()
                        self.damageforcescale = 0;\r
                        self.takedamage = DAMAGE_NO;\r
                        WaypointSprite_AttachCarrier("flagcarrier", other);\r
-                       WaypointSprite_UpdateTeamRadar(other.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '1 1 0');\r
+                       WaypointSprite_UpdateRadar(other.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '1 1 0');\r
                }\r
        }\r
 };\r
index 960189e67fd9c0af7f005a5f2582aa6cf5ffb2d3..42d578e551cad70048a19ef6319647b7ace60c53 100644 (file)
@@ -110,7 +110,7 @@ void dompoint_captured ()
                        WaypointSprite_UpdateSprites(self.sprite, "dom-pink", "", "");\r
                        break;\r
        }\r
-       WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, colormapPaletteColor(self.goalentity.team - 1, 0));\r
+       WaypointSprite_UpdateRadar(self.sprite, RADARICON_DOMPOINT, colormapPaletteColor(self.goalentity.team - 1, 0));\r
        WaypointSprite_Ping(self.sprite);\r
 \r
        self.captime = time;\r
@@ -211,7 +211,7 @@ void dompointtouch()
                return;\r
 \r
        WaypointSprite_UpdateSprites(self.sprite, "dom-neut", "", "");\r
-       WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, '0 1 1');\r
+       WaypointSprite_UpdateRadar(self.sprite, RADARICON_DOMPOINT, '0 1 1');\r
        WaypointSprite_Ping(self.sprite);\r
 \r
        self.goalentity = head;\r
@@ -314,7 +314,7 @@ void dom_controlpoint_setup()
 \r
        waypoint_spawnforitem(self);\r
        WaypointSprite_SpawnFixed("dom-neut", self.origin + '0 0 32', self, sprite);\r
-       WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, '0 1 1');\r
+       WaypointSprite_UpdateRadar(self.sprite, RADARICON_DOMPOINT, '0 1 1');\r
 };\r
 \r
 \r
index dd0570f8af5ea145c9adf02b12775e7620454b6b..7ffc580a9ed45543b175e58f3712bb823a91e466 100644 (file)
@@ -308,7 +308,7 @@ void kh_Key_AssignTo(entity key, entity player)  // runs every time a key is pic
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, "keycarrier-yellow", "keycarrier-friend", "keycarrier-yellow");\r
                        else if(player.team == COLOR_TEAM4)\r
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, "keycarrier-pink", "keycarrier-friend", "keycarrier-pink");\r
-                       WaypointSprite_UpdateTeamRadar(player.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, colormapPaletteColor(player.team - 1, 0));\r
+                       WaypointSprite_UpdateRadar(player.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, colormapPaletteColor(player.team - 1, 0));\r
                        if(!kh_no_radar_circles)\r
                                WaypointSprite_Ping(player.waypointsprite_attachedforcarrier);\r
                }\r
@@ -414,7 +414,7 @@ void kh_Key_Spawn(entity initial_owner, float angle, float i)  // runs every tim
 \r
        WaypointSprite_Spawn("key-dropped", 0, 0, key, '0 0 1' * KH_KEY_WP_ZSHIFT, world, key.team, key, waypointsprite_attachedforcarrier, FALSE);\r
        key.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = kh_Key_waypointsprite_visible_for_player;\r
-       WaypointSprite_UpdateTeamRadar(key.waypointsprite_attachedforcarrier, RADARICON_FLAG, '0 1 1');\r
+       WaypointSprite_UpdateRadar(key.waypointsprite_attachedforcarrier, RADARICON_FLAG, '0 1 1');\r
 \r
        kh_Key_AssignTo(key, initial_owner);\r
 }\r
index d2b1ce99534cb5265f869ada87b826e4e9a33323..0826d1efd1a3f265a387f18c528af8cf48748d09 100644 (file)
@@ -700,16 +700,16 @@ void onslaught_generator_updatesprite(entity e)
                if(e.lastshielded)\r
                {\r
                        if(e.team == COLOR_TEAM1 || e.team == COLOR_TEAM2)\r
-                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, 0.5 * colormapPaletteColor(e.team - 1, FALSE));\r
+                               WaypointSprite_UpdateRadar(e.sprite, RADARICON_GENERATOR, 0.5 * colormapPaletteColor(e.team - 1, FALSE));\r
                        else\r
-                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, '0.5 0.5 0.5');\r
+                               WaypointSprite_UpdateRadar(e.sprite, RADARICON_GENERATOR, '0.5 0.5 0.5');\r
                }\r
                else\r
                {\r
                        if(e.team == COLOR_TEAM1 || e.team == COLOR_TEAM2)\r
-                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, colormapPaletteColor(e.team - 1, FALSE));\r
+                               WaypointSprite_UpdateRadar(e.sprite, RADARICON_GENERATOR, colormapPaletteColor(e.team - 1, FALSE));\r
                        else\r
-                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, '0.75 0.75 0.75');\r
+                               WaypointSprite_UpdateRadar(e.sprite, RADARICON_GENERATOR, '0.75 0.75 0.75');\r
                }\r
                WaypointSprite_Ping(e.sprite);\r
        }\r
@@ -787,16 +787,16 @@ void onslaught_controlpoint_updatesprite(entity e)
                if(e.lastshielded)\r
                {\r
                        if(e.team == COLOR_TEAM1 || e.team == COLOR_TEAM2)\r
-                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, 0.5 * colormapPaletteColor(e.team - 1, FALSE));\r
+                               WaypointSprite_UpdateRadar(e.sprite, RADARICON_CONTROLPOINT, 0.5 * colormapPaletteColor(e.team - 1, FALSE));\r
                        else\r
-                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, '0.5 0.5 0.5');\r
+                               WaypointSprite_UpdateRadar(e.sprite, RADARICON_CONTROLPOINT, '0.5 0.5 0.5');\r
                }\r
                else\r
                {\r
                        if(e.team == COLOR_TEAM1 || e.team == COLOR_TEAM2)\r
-                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, colormapPaletteColor(e.team - 1, FALSE));\r
+                               WaypointSprite_UpdateRadar(e.sprite, RADARICON_CONTROLPOINT, colormapPaletteColor(e.team - 1, FALSE));\r
                        else\r
-                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, '0.75 0.75 0.75');\r
+                               WaypointSprite_UpdateRadar(e.sprite, RADARICON_CONTROLPOINT, '0.75 0.75 0.75');\r
                }\r
                WaypointSprite_Ping(e.sprite);\r
 \r
index 5517fa30dfedb8fa859a0eeb6604ce187737384d..83ec80f4704c137863e95387b82d9aeaeaf62f18 100644 (file)
@@ -174,7 +174,7 @@ void Item_RespawnCountdown (void)
                                WaypointSprite_Spawn(name, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE);\r
                                if(self.waypointsprite_attached)\r
                                {\r
-                                       WaypointSprite_UpdateTeamRadar(self.waypointsprite_attached, RADARICON_POWERUP, rgb);\r
+                                       WaypointSprite_UpdateRadar(self.waypointsprite_attached, RADARICON_POWERUP, rgb);\r
                                        //WaypointSprite_UpdateMaxHealth(self.waypointsprite_attached, ITEM_RESPAWN_TICKS + 1);\r
                                        WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, time + ITEM_RESPAWN_TICKS);\r
                                }\r
index 40211538c3604febbfaeabe57cffd93e0e8d5991..a392f76e56ebe30e661bbf569e9ceef89810c0b2 100644 (file)
@@ -73,7 +73,7 @@ void WaypointSprite_UpdateRule(entity e, float t, float r)
        e.SendFlags |= 1;\r
 }\r
 \r
-void WaypointSprite_UpdateTeamRadar(entity e, float icon, vector col)\r
+void WaypointSprite_UpdateRadar(entity e, float icon, vector col)\r
 {\r
        // no check, as this is never called without doing an actual change (usually only once)\r
        e.cnt = (icon & 0x7F) | (e.cnt & 0x80);\r
index c074f59a0a04825842f59916bbfd0372a1a92175..a867cb3413c7eaa499d4a6d1cde4d389be46bea0 100644 (file)
 \r
 - 0.7 | 0.8: Allow more bots from the menu?\r
 \r
-- 0.8: Maybe turn the HEAL teammate into a sign, not part of shownames\r
-\r
-- 0.7 | 0.8: Allow radar not only in team games, and rename it from teamradar to radar
\ No newline at end of file
+- 0.8: Maybe turn the HEAL teammate into a sign, not part of shownames
\ No newline at end of file