]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Cleanup radar code. I'll adapt the radar menu to the new changes later
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 15 Mar 2012 17:02:27 +0000 (19:02 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 15 Mar 2012 17:02:27 +0000 (19:02 +0200)
data/defaultVT.cfg
data/qcsrc/client/Main.qc
data/qcsrc/client/View.qc
data/qcsrc/client/main.qh
data/qcsrc/client/radar.qc
docs/Release notes.txt
docs/TODO.txt

index b524ae356931798960dc68f3dd254e860ad520ab..f9d099a5d64f02024b4acfa33ab68aa19c8cfc91 100644 (file)
@@ -1384,7 +1384,7 @@ seta sv_status_privacy 1  "hide IP addresses from \"status\" replies shown to cli
 seta cl_radar 2        "show radar. 1 in team maches, 2 always"\r
 seta cl_radar_content_alpha 1  "alpha of the minimap"\r
 seta cl_radar_background_alpha 0.5     "set to -1 to disable"\r
-seta cl_radar_foreground_alpha 1       "set to -1 to disable"\r
+seta cl_radar_foreground_alpha 0.9     "set to -1 to disable"\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
index 567c9ba6ba9f0d0d36ec5ca9d665c6a77eca2e5c..b3aeb438617715a115e8a98ca6539804d230f692 100644 (file)
@@ -552,7 +552,7 @@ void GameCommand(string msg)
                cvar_clientsettemp(argv(1), argv(2));\r
        }\r
        else if(cmd == "radar") {\r
-               ons_showmap = !ons_showmap;\r
+               showmap = !showmap;\r
        }\r
        else if(cmd == "sbar_columns_set") {\r
                Cmd_Sbar_SetFields(argc);\r
index 8a7462fcd89dc5b11599eaec6fcdbab1e0ed1568..557a0d9b916488f105139dfeaf0f56bc7b53b59d 100644 (file)
@@ -1031,7 +1031,7 @@ void CSQC_UpdateView(float w, float h)
 \r
        // draw radar\r
        if(\r
-                       ons_showmap\r
+                       showmap\r
                        ||\r
                        (\r
                         !scoreboard_active\r
@@ -1186,7 +1186,7 @@ void CSQC_UpdateView(float w, float h)
        if not(getstati(STAT_ARMOR) < g_power || time <= power_boot)\r
        {\r
                // crosshair goes VERY LAST\r
-               if(!scoreboard_active && !ons_showmap && !camera_active) {\r
+               if(!scoreboard_active && !showmap && !camera_active) {\r
                        // TrueAim check\r
                        float shottype;\r
                        // wcross_origin = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight;\r
index ed68d7665669cce48ef8450b2e6c83e9869b3f78..a868ae402be64c37ee3d9cbdaa5899a446b4ddcd 100644 (file)
@@ -31,7 +31,7 @@ vector mi_center;
 vector mi_scale;\r
 // Minimap\r
 string minimapname;\r
-float ons_showmap;\r
+float showmap;\r
 \r
 // --------------------------------------------------------------------------\r
 // General stuff\r
index 97ea2444574695e3536c07a7f2b48ed146da883c..f266d2970dd855a78b086c71810002a271e53dc6 100644 (file)
@@ -55,34 +55,41 @@ vector yinvert(vector v)
 \r
 void draw_radar_background(float ca, float bg, float fg)\r
 {\r
-       vector cgc;\r
+       vector col, rgb;\r
+       vector pos1, pos2, pos3, pos4;\r
+       pos1 = '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);\r
+       pos2 = '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);\r
+       pos3 = '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);\r
+       pos4 = '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);\r
+       rgb = GetTeamRGB(GetPlayerColor(player_localentnum - 1));\r
+\r
        if(bg > 0)\r
        {\r
                R_BeginPolygon("gfx/hud/bg_radar.tga", DRAWFLAG_NORMAL);\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), yinvert(mi_pictexcoord1), '1 1 1', 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), yinvert(mi_pictexcoord2), '1 1 1', 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), yinvert(mi_pictexcoord3), '1 1 1', 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), yinvert(mi_pictexcoord0), '1 1 1', bg);\r
+               R_PolygonVertex(pos1, yinvert(mi_pictexcoord1), '1 1 1', bg);\r
+               R_PolygonVertex(pos2, yinvert(mi_pictexcoord2), '1 1 1', bg);\r
+               R_PolygonVertex(pos3, yinvert(mi_pictexcoord3), '1 1 1', bg);\r
+               R_PolygonVertex(pos4, yinvert(mi_pictexcoord0), '1 1 1', bg);\r
                R_EndPolygon();\r
        }\r
 \r
        if(ca > 0 && minimapname != "")\r
        {\r
-               cgc = '1 1 1' * ca;\r
+               col = '1 1 1' * ca;\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), cgc, 1);\r
-                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord2), yinvert(mi_pictexcoord2), cgc, 1);\r
-                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord1), yinvert(mi_pictexcoord1), cgc, 1);\r
-                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord0), yinvert(mi_pictexcoord0), cgc, 1);\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord3), yinvert(mi_pictexcoord3), col, 1);\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord2), yinvert(mi_pictexcoord2), col, 1);\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord1), yinvert(mi_pictexcoord1), col, 1);\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord0), yinvert(mi_pictexcoord0), col, 1);\r
                }\r
                else\r
                {\r
-                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord0), yinvert(mi_pictexcoord0), cgc, 1);\r
-                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord1), yinvert(mi_pictexcoord1), cgc, 1);\r
-                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord2), yinvert(mi_pictexcoord2), cgc, 1);\r
-                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord3), yinvert(mi_pictexcoord3), cgc, 1);\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord0), yinvert(mi_pictexcoord0), col, 1);\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord1), yinvert(mi_pictexcoord1), col, 1);\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord2), yinvert(mi_pictexcoord2), col, 1);\r
+                       R_PolygonVertex(radar_texcoord_to_2dcoord(mi_pictexcoord3), yinvert(mi_pictexcoord3), col, 1);\r
                }\r
                R_EndPolygon();\r
        }\r
@@ -90,21 +97,17 @@ void draw_radar_background(float ca, float bg, float fg)
        if(fg > 0)\r
        {\r
                R_BeginPolygon("gfx/hud/fg_radar.tga", DRAWFLAG_NORMAL);\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), yinvert(mi_pictexcoord1), '1 1 1', fg);\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), yinvert(mi_pictexcoord2), '1 1 1', fg);\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), yinvert(mi_pictexcoord3), '1 1 1', fg);\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), yinvert(mi_pictexcoord0), '1 1 1', fg);\r
+               R_PolygonVertex(pos1, yinvert(mi_pictexcoord1), '1 1 1', fg);\r
+               R_PolygonVertex(pos2, yinvert(mi_pictexcoord2), '1 1 1', fg);\r
+               R_PolygonVertex(pos3, yinvert(mi_pictexcoord3), '1 1 1', fg);\r
+               R_PolygonVertex(pos4, yinvert(mi_pictexcoord0), '1 1 1', fg);\r
                R_EndPolygon();\r
-       }\r
-       vector rgb;\r
-       rgb = GetTeamRGB(GetPlayerColor(player_localentnum - 1));\r
-       if(fg > 0)\r
-       {\r
+\r
                R_BeginPolygon("gfx/hud/fg_radar_team.tga", DRAWFLAG_NORMAL);\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), yinvert(mi_pictexcoord1), rgb, fg);\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), yinvert(mi_pictexcoord2), rgb, fg);\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), yinvert(mi_pictexcoord3), rgb, fg);\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), yinvert(mi_pictexcoord0), rgb, fg);\r
+               R_PolygonVertex(pos1, yinvert(mi_pictexcoord1), rgb, fg);\r
+               R_PolygonVertex(pos2, yinvert(mi_pictexcoord2), rgb, fg);\r
+               R_PolygonVertex(pos3, yinvert(mi_pictexcoord3), rgb, fg);\r
+               R_PolygonVertex(pos4, yinvert(mi_pictexcoord0), rgb, fg);\r
                R_EndPolygon();\r
        }\r
 }\r
@@ -208,7 +211,7 @@ float cl_radar_zoommode;
 void radar_loadcvars()\r
 {\r
        v_flipped = cvar("v_flipped");\r
-       if(ons_showmap)\r
+       if(showmap)\r
        {\r
                cl_radar_scale = 42; // dummy, not used (see zoommode)\r
                cl_radar_content_alpha = 1 * (1 - cvar("_menu_alpha"));\r
@@ -250,12 +253,12 @@ void radar_loadcvars()
 \r
 void() radar_view =\r
 {\r
-       local float color1; // color already declared as a global in hud.qc\r
+       local float col; // color already declared as a global in hud.qc\r
        local entity tm;\r
        float scale2d, normalsize, bigsize;\r
        float f;\r
 \r
-       if(minimapname == "" && !ons_showmap)\r
+       if(minimapname == "" && !showmap)\r
                return;\r
 \r
        radar_loadcvars();\r
@@ -354,7 +357,7 @@ void() radar_view =
 \r
        draw_radar_background(cl_radar_content_alpha, cl_radar_background_alpha, cl_radar_foreground_alpha);\r
 \r
-       if(ons_showmap)\r
+       if(showmap)\r
        {\r
                drawresetcliparea();\r
                drawsetcliparea(\r
@@ -371,9 +374,9 @@ void() radar_view =
                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
-               color1 = GetPlayerColor(tm.sv_entnum);\r
-               //if(color == COLOR_SPECTATOR || color == color1)\r
-                       draw_radar_player(tm.origin, tm.angles, GetTeamRGB(color1));\r
+               col = GetPlayerColor(tm.sv_entnum);\r
+               //if(color == COLOR_SPECTATOR || color == col)\r
+                       draw_radar_player(tm.origin, tm.angles, GetTeamRGB(col));\r
        }\r
        draw_radar_player(view_origin, view_angles, '1 1 1');\r
 \r
index 777d5d50caf9243ef37f6a85c201f726df27220d..d93a52b82928574da305253ce9bfe9b6de324bb6 100644 (file)
@@ -313,3 +313,5 @@ Features:
 - Visuals: Cubemap reflections on several map textures. You'll commonly see them on metal surfaces, but also on some stone floors.\r
 \r
 - Character portraits, which show when getting fragged or shooting team mates.\r
+\r
+- Improved radar (minimap), which shows in both team games and standalone games by default.\r
index 2089145c8fcb2f9fa57b992843c22a0f6c98c913..cedef23160bef2abc50553b8c6fc3fff6b175633 100644 (file)
 \r
 - 0.8: Maybe turn the HEAL teammate into a sign, not part of shownames\r
 \r
-- 0.7: Don't name the large map "ons map"\r
+- 0.7: Remove _mini\r
 \r
-- 0.7: Remove _mini
\ No newline at end of file
+- 0.7: Adapt radar menu
\ No newline at end of file