]> git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Big improvements to the radar, and us a good set of images for it. Not yet finished...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 15 Mar 2012 16:45:08 +0000 (18:45 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 15 Mar 2012 16:45:08 +0000 (18:45 +0200)
data/defaultVT.cfg
data/gfx/hud/bg_radar.tga [new file with mode: 0644]
data/gfx/hud/fg_radar.tga [new file with mode: 0644]
data/gfx/hud/fg_radar_team.tga [new file with mode: 0644]
data/gfx/ons-frame-team.tga [deleted file]
data/gfx/ons-frame.tga [deleted file]
data/qcsrc/client/Main.qc
data/qcsrc/client/radar.qc
docs/TODO.txt

index 30179cbc1118a235166f1bc9e45ed05cd16a1b37..b524ae356931798960dc68f3dd254e860ad520ab 100644 (file)
@@ -1382,8 +1382,9 @@ seta sv_status_privacy 1  "hide IP addresses from \"status\" replies shown to cli
 \r
 \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_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_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
diff --git a/data/gfx/hud/bg_radar.tga b/data/gfx/hud/bg_radar.tga
new file mode 100644 (file)
index 0000000..8c8bcb5
Binary files /dev/null and b/data/gfx/hud/bg_radar.tga differ
diff --git a/data/gfx/hud/fg_radar.tga b/data/gfx/hud/fg_radar.tga
new file mode 100644 (file)
index 0000000..13a8912
Binary files /dev/null and b/data/gfx/hud/fg_radar.tga differ
diff --git a/data/gfx/hud/fg_radar_team.tga b/data/gfx/hud/fg_radar_team.tga
new file mode 100644 (file)
index 0000000..fb97397
Binary files /dev/null and b/data/gfx/hud/fg_radar_team.tga differ
diff --git a/data/gfx/ons-frame-team.tga b/data/gfx/ons-frame-team.tga
deleted file mode 100644 (file)
index fb97397..0000000
Binary files a/data/gfx/ons-frame-team.tga and /dev/null differ
diff --git a/data/gfx/ons-frame.tga b/data/gfx/ons-frame.tga
deleted file mode 100644 (file)
index 13a8912..0000000
Binary files a/data/gfx/ons-frame.tga and /dev/null differ
index 7006f429558aa6c2f6748bae78d77c481c692259..567c9ba6ba9f0d0d36ec5ca9d665c6a77eca2e5c 100644 (file)
@@ -176,6 +176,9 @@ void CSQC_Init(void)
                else\r
                        get_mi_min_max_texcoords(0); // load new texcoords\r
        }\r
+       precache_pic("gfx/hud/bg_radar.tga");\r
+       precache_pic("gfx/hud/fg_radar.tga");\r
+       precache_pic("gfx/hud/fg_radar_team.tga");\r
 \r
        mi_center = (mi_min + mi_max) * 0.5;\r
        mi_scale = mi_max - mi_min;\r
index c0778f51a3a31c18530df0a4b10860e55fd666f9..97ea2444574695e3536c07a7f2b48ed146da883c 100644 (file)
@@ -53,41 +53,60 @@ vector yinvert(vector v)
        return v;\r
 }\r
 \r
-void draw_radar_background(float bg, float fg)\r
+void draw_radar_background(float ca, float bg, float fg)\r
 {\r
-       float fga;\r
-       vector fgc;\r
+       vector cgc;\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_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_EndPolygon();\r
        }\r
 \r
-       if(fg > 0 && minimapname != "")\r
+       if(ca > 0 && minimapname != "")\r
        {\r
-               fga = 1;\r
-               fgc = '1 1 1' * fg;\r
+               cgc = '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), 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_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
                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_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
                R_EndPolygon();\r
        }\r
+\r
+       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_EndPolygon();\r
+       }\r
+       vector rgb;\r
+       rgb = GetTeamRGB(GetPlayerColor(player_localentnum - 1));\r
+       if(fg > 0)\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_EndPolygon();\r
+       }\r
 }\r
 \r
 void(vector coord3d, vector pangles, vector rgb) draw_radar_player =\r
@@ -178,6 +197,7 @@ void draw_radar_link(vector start, vector end, float colors)
 }\r
 \r
 float cl_radar_scale;\r
+float cl_radar_content_alpha;\r
 float cl_radar_background_alpha;\r
 float cl_radar_foreground_alpha;\r
 float cl_radar_rotation;\r
@@ -191,6 +211,7 @@ void radar_loadcvars()
        if(ons_showmap)\r
        {\r
                cl_radar_scale = 42; // dummy, not used (see zoommode)\r
+               cl_radar_content_alpha = 1 * (1 - cvar("_menu_alpha"));\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
@@ -204,6 +225,7 @@ void radar_loadcvars()
        else\r
        {\r
                cl_radar_scale = cvar("cl_radar_scale");\r
+               cl_radar_content_alpha = cvar("cl_radar_content_alpha") * sbar_alpha_fg;\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
@@ -214,6 +236,7 @@ void radar_loadcvars()
                // others default to 0\r
                // match this to defaultVoretournament.cfg!\r
                if(!cl_radar_scale) cl_radar_scale = 4096;\r
+               if(!cl_radar_content_alpha) cl_radar_content_alpha = 0.4 * sbar_alpha_fg;\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
@@ -227,8 +250,7 @@ void radar_loadcvars()
 \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 float color1; // color already declared as a global in hud.qc\r
        local entity tm;\r
        float scale2d, normalsize, bigsize;\r
        float f;\r
@@ -323,9 +345,6 @@ void() radar_view =
                  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
@@ -333,22 +352,11 @@ void() radar_view =
                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
+       draw_radar_background(cl_radar_content_alpha, 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
@@ -363,9 +371,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
-               color2 = GetPlayerColor(tm.sv_entnum);\r
-               //if(color == COLOR_SPECTATOR || color == color2)\r
-                       draw_radar_player(tm.origin, tm.angles, GetTeamRGB(color2));\r
+               color1 = GetPlayerColor(tm.sv_entnum);\r
+               //if(color == COLOR_SPECTATOR || color == color1)\r
+                       draw_radar_player(tm.origin, tm.angles, GetTeamRGB(color1));\r
        }\r
        draw_radar_player(view_origin, view_angles, '1 1 1');\r
 \r
index a867cb3413c7eaa499d4a6d1cde4d389be46bea0..2089145c8fcb2f9fa57b992843c22a0f6c98c913 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
\ No newline at end of file
+- 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
+\r
+- 0.7: Remove _mini
\ No newline at end of file