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