2 #define COMPAT_NO_MOD_IS_XONOTIC
17 #include "compiler.qh"
19 #ifndef QCC_SUPPORT_INT
23 #ifndef QCC_SUPPORT_BOOL
27 #ifndef QCC_SUPPORT_ERASEABLE
30 #define ERASEABLE [[eraseable]]
33 #include <dpdefs/pre.qh>
36 #include <dpdefs/csprogsdefs.qh>
37 #include <dpdefs/keycodes.qh>
39 #include <server/sys-pre.qh>
40 #include <dpdefs/progsdefs.qh>
41 #include <dpdefs/dpextensions.qh>
42 #include <server/sys-post.qh>
44 #include <dpdefs/menudefs.qh>
45 #include <dpdefs/keycodes.qh>
48 #include <dpdefs/post.qh>
52 #define USING(name, T) typedef T name
60 #define TC(T, sym) MACRO_BEGIN MACRO_END
62 #define TC(T, sym) MACRO_BEGIN \
64 LOG_WARNF("Type check failed: " #sym " :: " #T); \
71 #define is_float(this) (true || ftoe(this))
72 #define isnt_float(this)
73 #define is_vector(this) (true || vtos(this))
74 #define isnt_vector(this)
75 #define is_string(this) (true || stof(this))
76 #define isnt_string(this)
77 #define is_entity(this) (true || etof(this))
78 #define isnt_entity(this)
79 bool is_int(float this) { return this == floor(this); }
80 void isnt_int(float this) { print(ftos(this)); }
81 bool is_bool(float this) { return this == true || this == false; }
82 void isnt_bool(float this) { print(ftos(this)); }
85 #include "warpzone/mathlib.qc"
87 #include "accumulate.qh"
89 #include "arraylist.qh"
92 #include "counting.qh"
96 #include "enumclass.qh"
98 #include "functional.qh"
100 #include "intrusivelist.qh"
104 #include "linkedlist.qh"
107 #include "markdown.qh"
114 #include "p2mathlib.qc"
115 #include "progname.qh"
117 #include "registry.qh"
118 #include "registry_net.qh"
119 #include "replicate.qh"
120 #include "sortlist.qc"
122 #include "spawnfunc.qh"
134 #include "matrix/_mod.inc"
138 #define objerror_safe(e)
140 void make_safe_for_remove(entity this);
141 #define objerror_safe(e) make_safe_for_remove(e)
144 #define objerror(this, msg) MACRO_BEGIN { \
145 LOG_WARN("======OBJECT ERROR======"); \
146 entity _e = (this); \
150 LOG_WARNF("%s OBJECT ERROR in %s:\n%s\nTip: read above for entity information", PROGNAME, __FUNC__, msg); \
155 void m_init() { if (_m_init) _m_init(); }
156 #define m_init _m_init
159 void m_shutdown() { if (_m_shutdown) _m_shutdown(); }
160 #define m_shutdown _m_shutdown
162 void _m_draw(float width, float height);
163 void m_draw(float width, float height) { if (_m_draw) _m_draw(width, height); }
164 #define m_draw _m_draw
166 void _m_keydown(int keynr, int ascii);
167 void m_keydown(int keynr, int ascii) { if (_m_keydown) _m_keydown(keynr, ascii); }
168 #define m_keydown _m_keydown
170 void _m_toggle(int mode);
171 void m_toggle(int mode) { if (_m_toggle) _m_toggle(mode); }
172 #define m_toggle _m_toggle
177 void main() { if (_main) _main(); }
181 void SV_Shutdown() { if (_SV_Shutdown) _SV_Shutdown(); }
182 #define SV_Shutdown _SV_Shutdown
185 bool _StartFrame_init;
186 void spawnfunc_worldspawn(entity);
188 if (!_StartFrame_init) {
189 _StartFrame_init = true;
190 float oldtime = time; time = 1;
191 __spawnfunc_expecting = 2; NULL.__spawnfunc_constructor(NULL);
194 if (_StartFrame) _StartFrame();
196 #define StartFrame _StartFrame
199 void SetNewParms() { if (_SetNewParms) _SetNewParms(); }
200 #define SetNewParms _SetNewParms
202 void _SetChangeParms(entity this);
203 void SetChangeParms() { ENGINE_EVENT(); if (_SetChangeParms) _SetChangeParms(this); }
204 #define SetChangeParms _SetChangeParms
206 #ifdef DP_EXT_PRECONNECT
207 void _ClientPreConnect(entity this);
208 void ClientPreConnect() { ENGINE_EVENT(); if (_ClientPreConnect) _ClientPreConnect(this); }
209 #define ClientPreConnect _ClientPreConnect
212 void _ClientConnect(entity this);
213 void ClientConnect() { ENGINE_EVENT(); if (_ClientConnect) _ClientConnect(this); }
214 #define ClientConnect _ClientConnect
216 void _ClientDisconnect(entity this);
217 void ClientDisconnect() { ENGINE_EVENT(); if (_ClientDisconnect) _ClientDisconnect(this); }
218 #define ClientDisconnect _ClientDisconnect
220 void _PutClientInServer(entity this);
221 void PutClientInServer() { ENGINE_EVENT(); if (_PutClientInServer) _PutClientInServer(this); }
222 #define PutClientInServer _PutClientInServer
224 void _ClientKill(entity this);
225 void ClientKill() { ENGINE_EVENT(); if (_ClientKill) _ClientKill(this); }
226 #define ClientKill _ClientKill
228 void _PlayerPreThink(entity this);
229 void PlayerPreThink() { ENGINE_EVENT(); if (_PlayerPreThink) _PlayerPreThink(this); }
230 #define PlayerPreThink _PlayerPreThink
232 void _PlayerPostThink(entity this);
233 void PlayerPostThink() { ENGINE_EVENT(); if (_PlayerPostThink) _PlayerPostThink(this); }
234 #define PlayerPostThink _PlayerPostThink
236 void _SV_PlayerPhysics(entity this);
237 void SV_PlayerPhysics() { ENGINE_EVENT(); if (_SV_PlayerPhysics) _SV_PlayerPhysics(this); }
238 #define SV_PlayerPhysics _SV_PlayerPhysics
240 void _SV_OnEntityPreSpawnFunction(entity this);
241 void SV_OnEntityPreSpawnFunction()
244 __spawnfunc_expecting = true;
245 __spawnfunc_expect = this;
247 #define SV_OnEntityPreSpawnFunction _SV_OnEntityPreSpawnFunction
249 void _SV_ChangeTeam(entity this, int _color);
250 void SV_ChangeTeam(int _color) { ENGINE_EVENT(); if (_SV_ChangeTeam) _SV_ChangeTeam(this, _color); }
251 #define SV_ChangeTeam _SV_ChangeTeam
253 void _SV_ParseClientCommand(entity this, string command);
254 void SV_ParseClientCommand(string command)
257 if (_SV_ParseClientCommand) _SV_ParseClientCommand(this, command);
259 #define SV_ParseClientCommand _SV_ParseClientCommand
264 void CSQC_Init() { if (_CSQC_Init) _CSQC_Init(); }
265 #define CSQC_Init _CSQC_Init
267 void _CSQC_Shutdown();
268 void CSQC_Shutdown() { if (_CSQC_Shutdown) _CSQC_Shutdown(); }
269 #define CSQC_Shutdown _CSQC_Shutdown
271 void _CSQC_UpdateView(entity this, float w, float h);
272 void CSQC_UpdateView(float w, float h) { ENGINE_EVENT(); if (_CSQC_UpdateView) _CSQC_UpdateView(this, w, h); }
273 #define CSQC_UpdateView _CSQC_UpdateView
275 bool _CSQC_InputEvent(int inputType, float nPrimary, float nSecondary);
276 bool CSQC_InputEvent(int inputType, float nPrimary, float nSecondary)
278 return _CSQC_InputEvent ? _CSQC_InputEvent(inputType, nPrimary, nSecondary) : false;
280 #define CSQC_InputEvent _CSQC_InputEvent
282 bool _CSQC_ConsoleCommand(string s);
283 bool CSQC_ConsoleCommand(string s) { return _CSQC_ConsoleCommand ? _CSQC_ConsoleCommand(s) : false; }
284 #define CSQC_ConsoleCommand _CSQC_ConsoleCommand
286 void _CSQC_Ent_Update(entity this, bool isNew);
287 void CSQC_Ent_Update(bool isNew) { ENGINE_EVENT(); if (_CSQC_Ent_Update) _CSQC_Ent_Update(this, isNew); }
288 #define CSQC_Ent_Update _CSQC_Ent_Update
290 void _CSQC_Ent_Remove(entity this);
291 void CSQC_Ent_Remove() { ENGINE_EVENT(); if (_CSQC_Ent_Remove) _CSQC_Ent_Remove(this); }
292 #define CSQC_Ent_Remove _CSQC_Ent_Remove
298 #include <ecs/_mod.qh>