]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/client/main.qh
Merge branch 'bones_was_here/sv_playerthink_optimise' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / main.qh
1 #pragma once
2
3 #include <common/constants.qh>
4 #include <common/weapons/_all.qh>
5
6 bool autocvar_cl_db_saveasdump;
7 bool autocvar_cl_spawn_event_particles;
8 bool autocvar_cl_spawn_event_sound = 1;
9 // float autocvar_cl_spawn_point_model;
10 bool autocvar_cl_spawn_point_particles;
11 float autocvar_cl_spawn_point_dist_max = 1200;
12 bool autocvar_cl_unpress_zoom_on_spawn = true;
13 bool autocvar_cl_unpress_zoom_on_death = true;
14 bool autocvar_cl_unpress_zoom_on_weapon_switch = true;
15 bool autocvar_cl_unpress_attack_on_weapon_switch = false;
16 bool autocvar_hud_showbinds;
17 bool autocvar_hud_showbinds_limit;
18 bool autocvar__hud_showbinds_reload;
19 bool autocvar_developer_csqcentities;
20 bool autocvar_cl_race_cptimes_onlyself; // TODO: move to race gamemode
21 bool autocvar_cl_race_cptimes_showself = false;
22 bool autocvar_cl_welcome = true;
23 bool autocvar_menu_gamemenu = true;
24
25 // Map coordinate base calculations need these
26 vector mi_center;
27 vector mi_scale;
28 // Minimap
29 string minimapname;
30
31 bool postinit;
32 entity gametype;
33 // temporary hack
34 #define ISGAMETYPE(NAME) (gametype == MAPINFO_TYPE_##NAME)
35
36 float FONT_USER = 8;
37
38
39 void PostInit();
40
41 void Ent_Remove(entity this);
42
43 void Gamemode_Init();
44
45 entity players;
46 entity teams;
47 float team_count; // real teams
48
49 void AuditLists();
50
51 float RegisterPlayer(entity player);
52
53 void RemovePlayer(entity player);
54
55 void MoveToLast(entity e);
56
57 float RegisterTeam(entity Team);
58
59 void RemoveTeam(entity Team);
60
61 entity GetTeam(int Team, bool add);
62
63 bool SetTeam(entity pl, int Team);
64
65 vector hud_fontsize;
66
67 float RANKINGS_RECEIVED_CNT;
68 float RANKINGS_DISPLAY_CNT;
69 string grecordholder[RANKINGS_CNT];
70 float grecordtime[RANKINGS_CNT];
71
72 entity playerslots[255]; // 255 is engine limit on maxclients
73 entity teamslots[17];    // 17 teams (including "spectator team")
74 .bool gotscores;
75 .entity owner;
76 .bool ready;
77 .bool eliminated;
78
79 IntrusiveList g_drawables;
80 IntrusiveList g_drawables_2d;
81 IntrusiveList g_damagetext;
82 IntrusiveList g_radarlinks;
83 IntrusiveList g_radaricons;
84 STATIC_INIT(main)
85 {
86         g_drawables = IL_NEW();
87         g_drawables_2d = IL_NEW();
88         g_damagetext = IL_NEW();
89         g_radarlinks = IL_NEW();
90         g_radaricons = IL_NEW();
91 }
92
93 .void(entity) draw;
94 .void(entity) draw2d;
95 .void(entity) entremove;
96 float drawframetime;
97 vector view_origin, view_forward, view_right, view_up;
98
99 .float renderflags; // engine field
100
101 bool button_zoom;
102 bool spectatorbutton_zoom;
103 bool observe_blocked;
104 bool button_attack2;
105
106 float current_viewzoom;
107 float zoomin_effect;
108 bool warmup_stage;
109
110 bool campaign;
111 string hostname;
112 string welcome_msg;
113 int srv_minplayers;
114 int srv_maxplayers;
115 float welcome_msg_menu_check_maxtime;
116 void Welcome_Message_Show_Try();
117
118 void Fog_Force();
119
120 string _getcommandkey(string text, string command, bool forcename);
121 #define getcommandkey(cmd_name, command) _getcommandkey(cmd_name, command, false)
122 #define getcommandkey_forcename(cmd_name, command) _getcommandkey(cmd_name, command, true)
123
124 void Release_Common_Keys();
125
126 string vote_called_vote;
127 bool ready_waiting;
128 bool ready_waiting_for_me;
129 bool vote_waiting;
130 bool vote_waiting_for_me;
131
132 float current_zoomfraction;
133
134 int vid_width, vid_height;
135 float vid_pixelheight;
136
137 float camera_active;            // Demo camera is active if set to true
138 float chase_active_backup;
139 float camera_roll;
140 vector camera_direction;
141
142 const float ALPHA_MIN_VISIBLE = 0.003;
143
144 float armorblockpercent;
145 float damagepush_speedfactor;
146
147 //hooks
148 int calledhooks;
149 const int HOOK_START =    1;
150 const int HOOK_END =      2;
151
152 .float ping, ping_packetloss, ping_movementloss;
153
154 float g_trueaim_minrange;
155
156 int hud;
157 float view_quality;
158
159 int num_spectators;
160 const int MAX_SPECTATORS = 7;
161 int spectatorlist[MAX_SPECTATORS];
162
163 int framecount;
164
165 float GetSpeedUnitFactor(int speed_unit);
166 string GetSpeedUnit(int speed_unit);
167
168 .int enttype; // entity type sent from server
169 .int sv_entnum; // entity number sent from server
170
171 .int team;
172 .int team_size;
173
174 int binddb;
175
176 // Spectating
177 // -1 - observing
178 // 0 - playing
179 // >0 - id of spectated player
180 float spectatee_status;
181 float spectatee_status_changed_time;
182
183 #define player_currententnum (spectatee_status > 0 ? spectatee_status : player_localnum + 1)
184
185 // database for misc stuff
186 int tempdb;
187 int ClientProgsDB;
188 vector hook_shotorigin[4]; // WEAPONTODO
189 vector lightning_shotorigin[4]; // TODO: unused
190
191 float serverprevtime, serverdeltatime;
192
193 float ticrate;
194
195 int serverflags;