]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/client/view.c
nothing to see here...
[divverent/nexuiz.git] / data / qcsrc / client / view.c
1 float max_ups;
2 vector angle_alive;
3
4 void View_Update (void)
5 {
6         float f;
7         string s;
8
9         vieworg = pmove_org;
10         angle_alive = input_angles;
11
12         if(player_flags & PFL_DEAD)
13         {
14                 R_SetView(VF_ORIGIN, vieworg+'0 0 4');
15                 angle_alive_z = 80;
16                 R_SetView(VF_ANGLES, angle_alive);
17                 R_SetView(VF_CL_VIEWANGLES, angle_alive);
18                 return;
19         }
20
21         if(input_buttons & 16 && getstati(STAT_HEALTH) != 6666)
22                 vieworg += PL_CROUCH_VIEW_OFS;
23         else
24                 vieworg += PL_VIEW_OFS;
25
26         R_SetView(VF_ORIGIN, vieworg);
27         R_SetView(VF_ANGLES, input_angles);
28
29         if(!cvar("cg_showvelocity"))
30                 return;
31
32         f = pl_xyspeed;
33         if(max_ups < f)
34                 max_ups = f;
35         s = ftos(f);
36         s = strcat(s, " ups");
37         drawstring('1 0 0'*vid_width + '-64 64 0', s, '8 8 0', VEC_1, 1, 0);
38         s = ftos(max_ups);
39         s = strcat(s, " max");
40         drawstring('1 0 0'*vid_width + '-64 72 0', s, '8 8 0', VEC_1, 1, 0);
41 }