2 #define COMPAT_NO_MOD_IS_XONOTIC
17 #include "compiler.qh"
19 #ifndef QCC_SUPPORT_INT
23 #ifndef QCC_SUPPORT_BOOL
27 #include <dpdefs/pre.qh>
30 #include <dpdefs/csprogsdefs.qh>
31 #include <dpdefs/keycodes.qh>
33 #include <server/sys-pre.qh>
34 #include <dpdefs/progsdefs.qh>
35 #include <dpdefs/dpextensions.qh>
36 #include <server/sys-post.qh>
38 #include <dpdefs/menudefs.qh>
39 #include <dpdefs/keycodes.qh>
42 #include <dpdefs/post.qh>
46 #define USING(name, T) typedef T name
54 #define TC(T, sym) MACRO_BEGIN MACRO_END
56 #define TC(T, sym) MACRO_BEGIN \
58 LOG_WARNF("Type check failed: " #sym " :: " #T); \
65 #define is_float(this) (true || ftoe(this))
66 #define isnt_float(this)
67 #define is_vector(this) (true || vtos(this))
68 #define isnt_vector(this)
69 #define is_string(this) (true || stof(this))
70 #define isnt_string(this)
71 #define is_entity(this) (true || etof(this))
72 #define isnt_entity(this)
73 bool is_int(float this) { return this == floor(this); }
74 void isnt_int(float this) { print(ftos(this)); }
75 bool is_bool(float this) { return this == true || this == false; }
76 void isnt_bool(float this) { print(ftos(this)); }
79 #include "warpzone/mathlib.qc"
81 #include "accumulate.qh"
83 #include "arraylist.qh"
86 #include "counting.qh"
90 #include "enumclass.qh"
92 #include "functional.qh"
94 #include "intrusivelist.qh"
98 #include "linkedlist.qh"
101 #include "markdown.qh"
108 #include "p2mathlib.qc"
109 #include "progname.qh"
111 #include "registry.qh"
112 #include "registry_net.qh"
113 #include "replicate.qh"
114 #include "sortlist.qc"
116 #include "spawnfunc.qh"
128 #include "matrix/_mod.inc"
132 #define objerror_safe(e)
134 void make_safe_for_remove(entity this);
135 #define objerror_safe(e) make_safe_for_remove(e)
138 #define objerror(this, msg) MACRO_BEGIN { \
139 LOG_WARN("======OBJECT ERROR======"); \
140 entity _e = (this); \
144 LOG_WARNF("%s OBJECT ERROR in %s:\n%s\nTip: read above for entity information", PROGNAME, __FUNC__, msg); \
149 void m_init() { if (_m_init) _m_init(); }
150 #define m_init _m_init
153 void m_shutdown() { if (_m_shutdown) _m_shutdown(); }
154 #define m_shutdown _m_shutdown
156 void _m_draw(float width, float height);
157 void m_draw(float width, float height) { if (_m_draw) _m_draw(width, height); }
158 #define m_draw _m_draw
160 void _m_keydown(int keynr, int ascii);
161 void m_keydown(int keynr, int ascii) { if (_m_keydown) _m_keydown(keynr, ascii); }
162 #define m_keydown _m_keydown
164 void _m_toggle(int mode);
165 void m_toggle(int mode) { if (_m_toggle) _m_toggle(mode); }
166 #define m_toggle _m_toggle
171 void main() { if (_main) _main(); }
175 void SV_Shutdown() { if (_SV_Shutdown) _SV_Shutdown(); }
176 #define SV_Shutdown _SV_Shutdown
179 void StartFrame() { if (_StartFrame) _StartFrame(); }
180 #define StartFrame _StartFrame
183 void SetNewParms() { if (_SetNewParms) _SetNewParms(); }
184 #define SetNewParms _SetNewParms
186 void _SetChangeParms(entity this);
187 void SetChangeParms() { ENGINE_EVENT(); if (_SetChangeParms) _SetChangeParms(this); }
188 #define SetChangeParms _SetChangeParms
190 #ifdef DP_EXT_PRECONNECT
191 void _ClientPreConnect(entity this);
192 void ClientPreConnect() { ENGINE_EVENT(); if (_ClientPreConnect) _ClientPreConnect(this); }
193 #define ClientPreConnect _ClientPreConnect
196 void _ClientConnect(entity this);
197 void ClientConnect() { ENGINE_EVENT(); if (_ClientConnect) _ClientConnect(this); }
198 #define ClientConnect _ClientConnect
200 void _ClientDisconnect(entity this);
201 void ClientDisconnect() { ENGINE_EVENT(); if (_ClientDisconnect) _ClientDisconnect(this); }
202 #define ClientDisconnect _ClientDisconnect
204 void _PutClientInServer(entity this);
205 void PutClientInServer() { ENGINE_EVENT(); if (_PutClientInServer) _PutClientInServer(this); }
206 #define PutClientInServer _PutClientInServer
208 void _ClientKill(entity this);
209 void ClientKill() { ENGINE_EVENT(); if (_ClientKill) _ClientKill(this); }
210 #define ClientKill _ClientKill
212 void _PlayerPreThink(entity this);
213 void PlayerPreThink() { ENGINE_EVENT(); if (_PlayerPreThink) _PlayerPreThink(this); }
214 #define PlayerPreThink _PlayerPreThink
216 void _PlayerPostThink(entity this);
217 void PlayerPostThink() { ENGINE_EVENT(); if (_PlayerPostThink) _PlayerPostThink(this); }
218 #define PlayerPostThink _PlayerPostThink
220 void _SV_PlayerPhysics(entity this);
221 void SV_PlayerPhysics() { ENGINE_EVENT(); if (_SV_PlayerPhysics) _SV_PlayerPhysics(this); }
222 #define SV_PlayerPhysics _SV_PlayerPhysics
224 void _SV_OnEntityPreSpawnFunction(entity this);
225 void SV_OnEntityPreSpawnFunction()
228 if (_SV_OnEntityPreSpawnFunction) _SV_OnEntityPreSpawnFunction(this);
230 #define SV_OnEntityPreSpawnFunction _SV_OnEntityPreSpawnFunction
232 void _SV_ChangeTeam(entity this, int _color);
233 void SV_ChangeTeam(int _color) { ENGINE_EVENT(); if (_SV_ChangeTeam) _SV_ChangeTeam(this, _color); }
234 #define SV_ChangeTeam _SV_ChangeTeam
236 void _SV_ParseClientCommand(entity this, string command);
237 void SV_ParseClientCommand(string command)
240 if (_SV_ParseClientCommand) _SV_ParseClientCommand(this, command);
242 #define SV_ParseClientCommand _SV_ParseClientCommand
247 void CSQC_Init() { if (_CSQC_Init) _CSQC_Init(); }
248 #define CSQC_Init _CSQC_Init
250 void _CSQC_Shutdown();
251 void CSQC_Shutdown() { if (_CSQC_Shutdown) _CSQC_Shutdown(); }
252 #define CSQC_Shutdown _CSQC_Shutdown
254 void _CSQC_UpdateView(entity this, float w, float h);
255 void CSQC_UpdateView(float w, float h) { ENGINE_EVENT(); if (_CSQC_UpdateView) _CSQC_UpdateView(this, w, h); }
256 #define CSQC_UpdateView _CSQC_UpdateView
258 bool _CSQC_InputEvent(int inputType, float nPrimary, float nSecondary);
259 bool CSQC_InputEvent(int inputType, float nPrimary, float nSecondary)
261 return _CSQC_InputEvent ? _CSQC_InputEvent(inputType, nPrimary, nSecondary) : false;
263 #define CSQC_InputEvent _CSQC_InputEvent
265 bool _CSQC_ConsoleCommand(string s);
266 bool CSQC_ConsoleCommand(string s) { return _CSQC_ConsoleCommand ? _CSQC_ConsoleCommand(s) : false; }
267 #define CSQC_ConsoleCommand _CSQC_ConsoleCommand
269 void _CSQC_Ent_Update(entity this, bool isNew);
270 void CSQC_Ent_Update(bool isNew) { ENGINE_EVENT(); if (_CSQC_Ent_Update) _CSQC_Ent_Update(this, isNew); }
271 #define CSQC_Ent_Update _CSQC_Ent_Update
273 void _CSQC_Ent_Remove(entity this);
274 void CSQC_Ent_Remove() { ENGINE_EVENT(); if (_CSQC_Ent_Remove) _CSQC_Ent_Remove(this); }
275 #define CSQC_Ent_Remove _CSQC_Ent_Remove
281 #include <ecs/_mod.qh>