]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/client/main.c
add csqc skeleton for Nexuiz
[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         if(f <= 0 && !(player_flags & PFL_DEAD))
17                 player_flags |= PFL_DEAD;
18         else if(f > 0 && player_flags & PFL_DEAD)
19                 player_flags -= player_flags & (PFL_DEAD | PFL_GIBBED);
20
21         if(nxt_cmd < time)
22         {
23                 nxt_cmd = time + 5;
24                 localcmd("r_showtris 0\n");
25         }
26
27 }
28
29 void CSQC_Ent_Update (float isnew)
30 {
31         float i;
32         i = ReadByte();
33 }
34
35 void CSQC_Ent_Remove ()
36 {
37         remove(self);
38 }; 
39
40
41 void CSQC_Init (void)
42 {
43 }
44
45 void CSQC_Shutdown (void)
46 {
47 }
48
49 void CSQC_ConsoleCommand (string str)
50 {
51 }
52
53 void CSQC_UpdateView (void)
54 {
55         SysParms_UPDATE();
56         View_Update();
57
58         R_ClearScene();
59
60         R_SetView(VF_DRAWWORLD, 1);
61
62         if(getstati(STAT_HEALTH) == 6666)
63         {
64                 R_SetView(VF_DRAWCROSSHAIR, 0);
65                 R_SetView(VF_DRAWENGINESBAR, 0);
66         }
67         else
68         {
69                 R_SetView(VF_DRAWCROSSHAIR, 1);
70                 R_SetView(VF_DRAWENGINESBAR, 1);
71         }
72         
73         R_AddEntities(MASK_NORMAL | MASK_ENGINE | MASK_ENGINEVIEWMODELS);
74         R_RenderScene();
75 }
76
77 float CSQC_InputEvent (float event, float parama)
78 {
79         return false;
80 }
81
82 void CSQC_Parse_StuffCmd (string msg)
83 {
84         // doesn't work, dp obviously doesn't execute csprogs.dat on demo playback
85         if(isdemo() && msg == "menu_showteamselect\n")
86                 return;
87         localcmd(msg);
88 }
89
90 void CSQC_Parse_Print (string msg)
91 {
92         print(msg);
93 }
94
95 void CSQC_Parse_CenterPrint (string msg)
96 {
97         cprint(msg);
98 }