73359e7e127637cfcd3c23b77bccd97a76fad8ff
[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 bool SetTeam(entity pl, int Team);
27
28 vector hud_fontsize;
29
30 float RANKINGS_RECEIVED_CNT;
31 float RANKINGS_DISPLAY_CNT;
32 string grecordholder[RANKINGS_CNT];
33 float grecordtime[RANKINGS_CNT];
34
35 entity playerslots[255]; // 255 is engine limit on maxclients
36 entity teamslots[17];    // 17 teams (including "spectator team")
37 .bool gotscores;
38 .entity owner;
39 .bool ready;
40 .bool eliminated;
41
42 IntrusiveList g_drawables;
43 IntrusiveList g_drawables_2d;
44 IntrusiveList g_radarlinks;
45 IntrusiveList g_radaricons;
46 STATIC_INIT(main)
47 {
48         g_drawables = IL_NEW();
49         g_drawables_2d = IL_NEW();
50         g_radarlinks = IL_NEW();
51         g_radaricons = IL_NEW();
52 }
53
54 .void(entity) draw;
55 .void(entity) draw2d;
56 .void(entity) entremove;
57 float drawframetime;
58 vector view_origin, view_forward, view_right, view_up;
59
60 .float renderflags; // engine field
61
62 bool button_zoom;
63 bool spectatorbutton_zoom;
64 bool button_attack2;
65
66 float current_viewzoom;
67 float zoomin_effect;
68 bool warmup_stage;
69
70 void Fog_Force();
71
72 string _getcommandkey(string text, string command, bool forcename);
73 #define getcommandkey(cmd_name, command) _getcommandkey(cmd_name, command, false)
74 #define getcommandkey_forcename(cmd_name, command) _getcommandkey(cmd_name, command, true)
75
76 string vote_called_vote;
77 bool ready_waiting;
78 bool ready_waiting_for_me;
79 bool vote_waiting;
80 bool vote_waiting_for_me;
81
82 float current_zoomfraction;
83
84 int cs_project_is_b0rked;
85 int vid_width, vid_height;
86 float vid_pixelheight;
87
88 float camera_active;            // Demo camera is active if set to true
89 float chase_active_backup;
90 float camera_roll;
91 vector camera_direction;
92
93 const float ALPHA_MIN_VISIBLE = 0.003;
94
95 float armorblockpercent;
96 float damagepush_speedfactor;
97
98 //hooks
99 int calledhooks;
100 const int HOOK_START =    1;
101 const int HOOK_END =      2;
102
103 .float ping, ping_packetloss, ping_movementloss;
104
105 float g_trueaim_minrange;
106
107 int hud;
108 float view_quality;
109
110 int num_spectators;
111 const int MAX_SPECTATORS = 7;
112 int spectatorlist[MAX_SPECTATORS];
113
114 int framecount;
115
116 float GetSpeedUnitFactor(int speed_unit);
117 string GetSpeedUnit(int speed_unit);