2 #define COMPAT_NO_MOD_IS_XONOTIC
7 #ifndef QCC_SUPPORT_INT
11 #ifndef QCC_SUPPORT_BOOL
15 #include <dpdefs/pre.qh>
18 #include <dpdefs/csprogsdefs.qh>
19 #include <dpdefs/keycodes.qh>
21 #include <server/sys-pre.qh>
22 #include <dpdefs/progsdefs.qh>
23 #include <dpdefs/dpextensions.qh>
24 #include <server/sys-post.qh>
26 #include <dpdefs/menudefs.qh>
27 #include <dpdefs/keycodes.qh>
30 #include <dpdefs/post.qh>
34 #define USING(name, T) typedef T name
42 #define TC(T, sym) MACRO_BEGIN MACRO_END
44 #define TC(T, sym) MACRO_BEGIN \
46 LOG_WARNINGF("Type check failed: " #sym " :: " #T); \
52 #define is_float(this) (true || ftoe(this))
53 #define isnt_float(this)
54 #define is_vector(this) (true || vtos(this))
55 #define isnt_vector(this)
56 #define is_string(this) (true || stof(this))
57 #define isnt_string(this)
58 #define is_entity(this) (true || etof(this))
59 #define isnt_entity(this)
60 bool is_int(float this) { return this == floor(this); }
61 void isnt_int(float this) { print(ftos(this)); }
62 bool is_bool(float this) { return this == true || this == false; }
63 void isnt_bool(float this) { print(ftos(this)); }
65 #include "warpzone/mathlib.qc"
67 #include "accumulate.qh"
69 #include "arraylist.qh"
72 #include "counting.qh"
76 #include "enumclass.qh"
78 #include "functional.qh"
83 #include "linkedlist.qh"
86 #include "markdown.qh"
93 #include "p2mathlib.qc"
94 #include "progname.qh"
96 #include "registry.qh"
97 #include "registry_net.qh"
98 #include "replicate.qh"
99 #include "sortlist.qc"
101 #include "spawnfunc.qh"
112 #include "matrix/_mod.inc"
116 void m_init() { if (_m_init) _m_init(); }
117 #define m_init _m_init
120 void m_shutdown() { if (_m_shutdown) _m_shutdown(); }
121 #define m_shutdown _m_shutdown
123 void _m_draw(float width, float height);
124 void m_draw(float width, float height) { if (_m_draw) _m_draw(width, height); }
125 #define m_draw _m_draw
127 void _m_keydown(int keynr, int ascii);
128 void m_keydown(int keynr, int ascii) { if (_m_keydown) _m_keydown(keynr, ascii); }
129 #define m_keydown _m_keydown
131 void _m_toggle(int mode);
132 void m_toggle(int mode) { if (_m_toggle) _m_toggle(mode); }
133 #define m_toggle _m_toggle
138 void main() { if (_main) _main(); }
142 void SV_Shutdown() { if (_SV_Shutdown) _SV_Shutdown(); }
143 #define SV_Shutdown _SV_Shutdown
146 void StartFrame() { if (_StartFrame) _StartFrame(); }
147 #define StartFrame _StartFrame
150 void SetNewParms() { if (_SetNewParms) _SetNewParms(); }
151 #define SetNewParms _SetNewParms
153 void _SetChangeParms(entity this);
154 void SetChangeParms() { ENGINE_EVENT(); if (_SetChangeParms) _SetChangeParms(this); }
155 #define SetChangeParms _SetChangeParms
157 void _ClientConnect(entity this);
158 void ClientConnect() { ENGINE_EVENT(); if (_ClientConnect) _ClientConnect(this); }
159 #define ClientConnect _ClientConnect
161 void _ClientDisconnect(entity this);
162 void ClientDisconnect() { ENGINE_EVENT(); if (_ClientDisconnect) _ClientDisconnect(this); }
163 #define ClientDisconnect _ClientDisconnect
165 void _PutClientInServer(entity this);
166 void PutClientInServer() { ENGINE_EVENT(); if (_PutClientInServer) _PutClientInServer(this); }
167 #define PutClientInServer _PutClientInServer
169 void _ClientKill(entity this);
170 void ClientKill() { ENGINE_EVENT(); if (_ClientKill) _ClientKill(this); }
171 #define ClientKill _ClientKill
173 void _PlayerPreThink(entity this);
174 void PlayerPreThink() { ENGINE_EVENT(); if (_PlayerPreThink) _PlayerPreThink(this); }
175 #define PlayerPreThink _PlayerPreThink
177 void _PlayerPostThink(entity this);
178 void PlayerPostThink() { ENGINE_EVENT(); if (_PlayerPostThink) _PlayerPostThink(this); }
179 #define PlayerPostThink _PlayerPostThink
181 void _SV_PlayerPhysics(entity this);
182 void SV_PlayerPhysics() { ENGINE_EVENT(); if (_SV_PlayerPhysics) _SV_PlayerPhysics(this); }
183 #define SV_PlayerPhysics _SV_PlayerPhysics
185 void _SV_OnEntityPreSpawnFunction(entity this);
186 void SV_OnEntityPreSpawnFunction()
189 if (_SV_OnEntityPreSpawnFunction) _SV_OnEntityPreSpawnFunction(this);
191 #define SV_OnEntityPreSpawnFunction _SV_OnEntityPreSpawnFunction
193 void _SV_ChangeTeam(entity this, int _color);
194 void SV_ChangeTeam(int _color) { ENGINE_EVENT(); if (_SV_ChangeTeam) _SV_ChangeTeam(this, _color); }
195 #define SV_ChangeTeam _SV_ChangeTeam
197 void _SV_ParseClientCommand(entity this, string command);
198 void SV_ParseClientCommand(string command)
201 if (_SV_ParseClientCommand) _SV_ParseClientCommand(this, command);
203 #define SV_ParseClientCommand _SV_ParseClientCommand
208 void CSQC_Init() { if (_CSQC_Init) _CSQC_Init(); }
209 #define CSQC_Init _CSQC_Init
211 void _CSQC_Shutdown();
212 void CSQC_Shutdown() { if (_CSQC_Shutdown) _CSQC_Shutdown(); }
213 #define CSQC_Shutdown _CSQC_Shutdown
215 void _CSQC_UpdateView(entity this, float w, float h);
216 void CSQC_UpdateView(float w, float h) { ENGINE_EVENT(); if (_CSQC_UpdateView) _CSQC_UpdateView(this, w, h); }
217 #define CSQC_UpdateView _CSQC_UpdateView
219 bool _CSQC_InputEvent(int inputType, float nPrimary, float nSecondary);
220 bool CSQC_InputEvent(int inputType, float nPrimary, float nSecondary)
222 return _CSQC_InputEvent ? _CSQC_InputEvent(inputType, nPrimary, nSecondary) : false;
224 #define CSQC_InputEvent _CSQC_InputEvent
226 bool _CSQC_ConsoleCommand(string s);
227 bool CSQC_ConsoleCommand(string s) { return _CSQC_ConsoleCommand ? _CSQC_ConsoleCommand(s) : false; }
228 #define CSQC_ConsoleCommand _CSQC_ConsoleCommand
230 void _CSQC_Ent_Update(entity this, bool isNew);
231 void CSQC_Ent_Update(bool isNew) { ENGINE_EVENT(); if (_CSQC_Ent_Update) _CSQC_Ent_Update(this, isNew); }
232 #define CSQC_Ent_Update _CSQC_Ent_Update
234 void _CSQC_Ent_Remove(entity this);
235 void CSQC_Ent_Remove() { ENGINE_EVENT(); if (_CSQC_Ent_Remove) _CSQC_Ent_Remove(this); }
236 #define CSQC_Ent_Remove _CSQC_Ent_Remove