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 void StartFrame() { if (_StartFrame) _StartFrame(); }
186 #define StartFrame _StartFrame
189 void SetNewParms() { if (_SetNewParms) _SetNewParms(); }
190 #define SetNewParms _SetNewParms
192 void _SetChangeParms(entity this);
193 void SetChangeParms() { ENGINE_EVENT(); if (_SetChangeParms) _SetChangeParms(this); }
194 #define SetChangeParms _SetChangeParms
196 #ifdef DP_EXT_PRECONNECT
197 void _ClientPreConnect(entity this);
198 void ClientPreConnect() { ENGINE_EVENT(); if (_ClientPreConnect) _ClientPreConnect(this); }
199 #define ClientPreConnect _ClientPreConnect
202 void _ClientConnect(entity this);
203 void ClientConnect() { ENGINE_EVENT(); if (_ClientConnect) _ClientConnect(this); }
204 #define ClientConnect _ClientConnect
206 void _ClientDisconnect(entity this);
207 void ClientDisconnect() { ENGINE_EVENT(); if (_ClientDisconnect) _ClientDisconnect(this); }
208 #define ClientDisconnect _ClientDisconnect
210 void _PutClientInServer(entity this);
211 void PutClientInServer() { ENGINE_EVENT(); if (_PutClientInServer) _PutClientInServer(this); }
212 #define PutClientInServer _PutClientInServer
214 void _ClientKill(entity this);
215 void ClientKill() { ENGINE_EVENT(); if (_ClientKill) _ClientKill(this); }
216 #define ClientKill _ClientKill
218 void _PlayerPreThink(entity this);
219 void PlayerPreThink() { ENGINE_EVENT(); if (_PlayerPreThink) _PlayerPreThink(this); }
220 #define PlayerPreThink _PlayerPreThink
222 void _PlayerPostThink(entity this);
223 void PlayerPostThink() { ENGINE_EVENT(); if (_PlayerPostThink) _PlayerPostThink(this); }
224 #define PlayerPostThink _PlayerPostThink
226 void _SV_PlayerPhysics(entity this);
227 void SV_PlayerPhysics() { ENGINE_EVENT(); if (_SV_PlayerPhysics) _SV_PlayerPhysics(this); }
228 #define SV_PlayerPhysics _SV_PlayerPhysics
230 void _SV_OnEntityPreSpawnFunction(entity this);
231 void SV_OnEntityPreSpawnFunction()
234 if (_SV_OnEntityPreSpawnFunction) _SV_OnEntityPreSpawnFunction(this);
236 #define SV_OnEntityPreSpawnFunction _SV_OnEntityPreSpawnFunction
238 void _SV_ChangeTeam(entity this, int _color);
239 void SV_ChangeTeam(int _color) { ENGINE_EVENT(); if (_SV_ChangeTeam) _SV_ChangeTeam(this, _color); }
240 #define SV_ChangeTeam _SV_ChangeTeam
242 void _SV_ParseClientCommand(entity this, string command);
243 void SV_ParseClientCommand(string command)
246 if (_SV_ParseClientCommand) _SV_ParseClientCommand(this, command);
248 #define SV_ParseClientCommand _SV_ParseClientCommand
253 void CSQC_Init() { if (_CSQC_Init) _CSQC_Init(); }
254 #define CSQC_Init _CSQC_Init
256 void _CSQC_Shutdown();
257 void CSQC_Shutdown() { if (_CSQC_Shutdown) _CSQC_Shutdown(); }
258 #define CSQC_Shutdown _CSQC_Shutdown
260 void _CSQC_UpdateView(entity this, float w, float h);
261 void CSQC_UpdateView(float w, float h) { ENGINE_EVENT(); if (_CSQC_UpdateView) _CSQC_UpdateView(this, w, h); }
262 #define CSQC_UpdateView _CSQC_UpdateView
264 bool _CSQC_InputEvent(int inputType, float nPrimary, float nSecondary);
265 bool CSQC_InputEvent(int inputType, float nPrimary, float nSecondary)
267 return _CSQC_InputEvent ? _CSQC_InputEvent(inputType, nPrimary, nSecondary) : false;
269 #define CSQC_InputEvent _CSQC_InputEvent
271 bool _CSQC_ConsoleCommand(string s);
272 bool CSQC_ConsoleCommand(string s) { return _CSQC_ConsoleCommand ? _CSQC_ConsoleCommand(s) : false; }
273 #define CSQC_ConsoleCommand _CSQC_ConsoleCommand
275 void _CSQC_Ent_Update(entity this, bool isNew);
276 void CSQC_Ent_Update(bool isNew) { ENGINE_EVENT(); if (_CSQC_Ent_Update) _CSQC_Ent_Update(this, isNew); }
277 #define CSQC_Ent_Update _CSQC_Ent_Update
279 void _CSQC_Ent_Remove(entity this);
280 void CSQC_Ent_Remove() { ENGINE_EVENT(); if (_CSQC_Ent_Remove) _CSQC_Ent_Remove(this); }
281 #define CSQC_Ent_Remove _CSQC_Ent_Remove
287 #include <ecs/_mod.qh>