]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/client/main.c
fixed tilted view in spectator mode with csqc and readded "team_*" aliases (they...
[divverent/nexuiz.git] / data / qcsrc / client / main.c
1 float nxt_cmd;
2
3 void SysParms_UPDATE (void)
4 {
5         float f;
6
7         vid_width = cvar("vid_conwidth");
8         vid_height = cvar("vid_conheight");
9         makevectors(input_angles);
10         pl_view_forward = v_forward;
11         pl_view_right = v_right;
12         pl_view_up = v_up;
13         pl_xyspeed = floor(sqrt(pmove_vel_x*pmove_vel_x + pmove_vel_y*pmove_vel_y));
14
15         f = getstati(STAT_HEALTH);
16         spec = (f == -666);
17         if(f <= 1 && !(player_flags & PFL_DEAD))
18                 player_flags |= PFL_DEAD;
19         else if(f > 1 && player_flags & PFL_DEAD)
20                 player_flags -= player_flags & (PFL_DEAD | PFL_GIBBED);
21
22         if(nxt_cmd < time)
23         {
24                 nxt_cmd = time + 5;
25                 localcmd("r_showtris 0\n");
26         }
27
28 }
29
30 void CSQC_Ent_Update (float isnew)
31 {
32         float i;
33         i = ReadByte();
34 }
35
36 void CSQC_Ent_Remove ()
37 {
38         remove(self);
39 }; 
40
41
42 void CSQC_Init (void)
43 {
44 }
45
46 void CSQC_Shutdown (void)
47 {
48 }
49
50 void CSQC_ConsoleCommand (string str)
51 {
52 }
53
54 void CSQC_UpdateView (void)
55 {
56         SysParms_UPDATE();
57         View_Update();
58
59         R_ClearScene();
60
61         R_SetView(VF_DRAWWORLD, 1);
62
63         if(getstati(STAT_HEALTH) == 6666)
64         {
65                 R_SetView(VF_DRAWCROSSHAIR, 0);
66                 R_SetView(VF_DRAWENGINESBAR, 0);
67         }
68         else
69         {
70                 R_SetView(VF_DRAWCROSSHAIR, 1);
71                 R_SetView(VF_DRAWENGINESBAR, 1);
72         }
73         
74         R_AddEntities(MASK_NORMAL | MASK_ENGINE | MASK_ENGINEVIEWMODELS);
75         R_RenderScene();
76 }
77
78 float CSQC_InputEvent (float event, float parama)
79 {
80         return false;
81 }
82
83 void CSQC_Parse_StuffCmd (string msg)
84 {
85         // doesn't work, dp obviously doesn't execute csprogs.dat on demo playback
86         if(isdemo() && msg == "menu_showteamselect\n")
87                 return;
88         localcmd(msg);
89 }
90
91 void CSQC_Parse_Print (string msg)
92 {
93         print(msg);
94 }
95
96 void CSQC_Parse_CenterPrint (string msg)
97 {
98         cprint(msg);
99 }