]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/client/ons.qc
some missing files; g_race_qualifying is still broken (ignores fraglimit, no idea...
[divverent/nexuiz.git] / data / qcsrc / client / ons.qc
1 void() Cmd_ons_map =
2 {
3         ons_showmap = !ons_showmap;
4 };
5
6 vector(vector coord) mapcoords =
7 {
8         local vector ret;
9         ret = coord; // put that up to ret's definition and it's '0 0 0' ... stupid fteqcc
10         ret -= mi_center;
11         ret_x = ret_x * 256.0 / mi_scale_x;
12         ret_y = -ret_y * 256.0 / mi_scale_y;
13         ret_z = 0;
14         ret = ret + '400 178 0';
15         return ret;
16 };
17
18 void(vector coord, vector pangles, vector rgb) drawplayer =
19 {
20         makevectors(pangles);
21         v_forward_z = 0;
22         v_forward = normalize(v_forward);
23         v_forward_y *= -1.0;
24         v_right_x = -v_forward_y;
25         v_right_y = v_forward_x;
26         // Ryling on !tex[0] => texture_white
27         // beware of the order, it has to be clockwise!
28         R_BeginPolygon("", 0);
29         R_PolygonVertex(coord+v_forward*2, '0 0 0', rgb, 1);
30         R_PolygonVertex(coord+v_right*3-v_forward*2, '0 1 0', rgb, 1);
31         R_PolygonVertex(coord-v_forward, '1 0 0', rgb, 1);
32         R_PolygonVertex(coord-v_right*3-v_forward*2, '1 1 0', rgb, 1);
33         R_EndPolygon();
34 };
35
36 void() ons_view =
37 {
38         if(ons_showmap) {
39                 local float color;
40                 local vector coord, rgb;
41
42                 color = GetPlayerColor(player_localentnum-1);
43                 rgb = GetTeamRGB(color);
44
45                 coord = mapcoords(pmove_org);
46                         
47                 drawpic('272 50 0', minimapname, '256 256 0', '1 1 1', 1, 0);
48                 drawpic('257 35 0', "gfx/ons-frame.tga", '286 286 0', '1 1 1', 1, 0);
49                 drawpic('257 35 0', "gfx/ons-frame-team.tga", '286 286 0', rgb, 1, 0);
50
51                 drawplayer(coord, input_angles, '1 1 1');
52
53                 local entity tm;
54                 for(tm = gps_start; tm != world; tm = tm.chain)
55                 {
56                         //print(strcat("GPS: ", ftos(tm.sv_entnum), " - ", vtos(tm.origin), "\n"));
57                         drawplayer(mapcoords(tm.origin), tm.angles, rgb);
58                 }
59         }
60 };