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