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); \
64 #define is_float(this) (true || ftoe(this))
65 #define isnt_float(this)
66 #define is_vector(this) (true || vtos(this))
67 #define isnt_vector(this)
68 #define is_string(this) (true || stof(this))
69 #define isnt_string(this)
70 #define is_entity(this) (true || etof(this))
71 #define isnt_entity(this)
72 bool is_int(float this) { return this == floor(this); }
73 void isnt_int(float this) { print(ftos(this)); }
74 bool is_bool(float this) { return this == true || this == false; }
75 void isnt_bool(float this) { print(ftos(this)); }
77 #include "warpzone/mathlib.qc"
79 #include "accumulate.qh"
81 #include "arraylist.qh"
84 #include "counting.qh"
88 #include "enumclass.qh"
90 #include "functional.qh"
92 #include "intrusivelist.qh"
96 #include "linkedlist.qh"
99 #include "markdown.qh"
106 #include "p2mathlib.qc"
107 #include "progname.qh"
109 #include "registry.qh"
110 #include "registry_net.qh"
111 #include "replicate.qh"
112 #include "sortlist.qc"
114 #include "spawnfunc.qh"
125 #include "matrix/_mod.inc"
128 #define objerror_safe(e)
130 void make_safe_for_remove(entity this);
131 #define objerror_safe(e) make_safe_for_remove(e)
134 #define objerror(this, msg) MACRO_BEGIN { \
135 LOG_WARN("======OBJECT ERROR======"); \
136 entity _e = (this); \
140 LOG_WARNF("%s OBJECT ERROR in %s:\n%s\nTip: read above for entity information", PROGNAME, __FUNC__, msg); \
145 void m_init() { if (_m_init) _m_init(); }
146 #define m_init _m_init
149 void m_shutdown() { if (_m_shutdown) _m_shutdown(); }
150 #define m_shutdown _m_shutdown
152 void _m_draw(float width, float height);
153 void m_draw(float width, float height) { if (_m_draw) _m_draw(width, height); }
154 #define m_draw _m_draw
156 void _m_keydown(int keynr, int ascii);
157 void m_keydown(int keynr, int ascii) { if (_m_keydown) _m_keydown(keynr, ascii); }
158 #define m_keydown _m_keydown
160 void _m_toggle(int mode);
161 void m_toggle(int mode) { if (_m_toggle) _m_toggle(mode); }
162 #define m_toggle _m_toggle
167 void main() { if (_main) _main(); }
171 void SV_Shutdown() { if (_SV_Shutdown) _SV_Shutdown(); }
172 #define SV_Shutdown _SV_Shutdown
175 void StartFrame() { if (_StartFrame) _StartFrame(); }
176 #define StartFrame _StartFrame
179 void SetNewParms() { if (_SetNewParms) _SetNewParms(); }
180 #define SetNewParms _SetNewParms
182 void _SetChangeParms(entity this);
183 void SetChangeParms() { ENGINE_EVENT(); if (_SetChangeParms) _SetChangeParms(this); }
184 #define SetChangeParms _SetChangeParms
186 void _ClientConnect(entity this);
187 void ClientConnect() { ENGINE_EVENT(); if (_ClientConnect) _ClientConnect(this); }
188 #define ClientConnect _ClientConnect
190 void _ClientDisconnect(entity this);
191 void ClientDisconnect() { ENGINE_EVENT(); if (_ClientDisconnect) _ClientDisconnect(this); }
192 #define ClientDisconnect _ClientDisconnect
194 void _PutClientInServer(entity this);
195 void PutClientInServer() { ENGINE_EVENT(); if (_PutClientInServer) _PutClientInServer(this); }
196 #define PutClientInServer _PutClientInServer
198 void _ClientKill(entity this);
199 void ClientKill() { ENGINE_EVENT(); if (_ClientKill) _ClientKill(this); }
200 #define ClientKill _ClientKill
202 void _PlayerPreThink(entity this);
203 void PlayerPreThink() { ENGINE_EVENT(); if (_PlayerPreThink) _PlayerPreThink(this); }
204 #define PlayerPreThink _PlayerPreThink
206 void _PlayerPostThink(entity this);
207 void PlayerPostThink() { ENGINE_EVENT(); if (_PlayerPostThink) _PlayerPostThink(this); }
208 #define PlayerPostThink _PlayerPostThink
210 void _SV_PlayerPhysics(entity this);
211 void SV_PlayerPhysics() { ENGINE_EVENT(); if (_SV_PlayerPhysics) _SV_PlayerPhysics(this); }
212 #define SV_PlayerPhysics _SV_PlayerPhysics
214 void _SV_OnEntityPreSpawnFunction(entity this);
215 void SV_OnEntityPreSpawnFunction()
218 if (_SV_OnEntityPreSpawnFunction) _SV_OnEntityPreSpawnFunction(this);
220 #define SV_OnEntityPreSpawnFunction _SV_OnEntityPreSpawnFunction
222 void _SV_ChangeTeam(entity this, int _color);
223 void SV_ChangeTeam(int _color) { ENGINE_EVENT(); if (_SV_ChangeTeam) _SV_ChangeTeam(this, _color); }
224 #define SV_ChangeTeam _SV_ChangeTeam
226 void _SV_ParseClientCommand(entity this, string command);
227 void SV_ParseClientCommand(string command)
230 if (_SV_ParseClientCommand) _SV_ParseClientCommand(this, command);
232 #define SV_ParseClientCommand _SV_ParseClientCommand
237 void CSQC_Init() { if (_CSQC_Init) _CSQC_Init(); }
238 #define CSQC_Init _CSQC_Init
240 void _CSQC_Shutdown();
241 void CSQC_Shutdown() { if (_CSQC_Shutdown) _CSQC_Shutdown(); }
242 #define CSQC_Shutdown _CSQC_Shutdown
244 void _CSQC_UpdateView(entity this, float w, float h);
245 void CSQC_UpdateView(float w, float h) { ENGINE_EVENT(); if (_CSQC_UpdateView) _CSQC_UpdateView(this, w, h); }
246 #define CSQC_UpdateView _CSQC_UpdateView
248 bool _CSQC_InputEvent(int inputType, float nPrimary, float nSecondary);
249 bool CSQC_InputEvent(int inputType, float nPrimary, float nSecondary)
251 return _CSQC_InputEvent ? _CSQC_InputEvent(inputType, nPrimary, nSecondary) : false;
253 #define CSQC_InputEvent _CSQC_InputEvent
255 bool _CSQC_ConsoleCommand(string s);
256 bool CSQC_ConsoleCommand(string s) { return _CSQC_ConsoleCommand ? _CSQC_ConsoleCommand(s) : false; }
257 #define CSQC_ConsoleCommand _CSQC_ConsoleCommand
259 void _CSQC_Ent_Update(entity this, bool isNew);
260 void CSQC_Ent_Update(bool isNew) { ENGINE_EVENT(); if (_CSQC_Ent_Update) _CSQC_Ent_Update(this, isNew); }
261 #define CSQC_Ent_Update _CSQC_Ent_Update
263 void _CSQC_Ent_Remove(entity this);
264 void CSQC_Ent_Remove() { ENGINE_EVENT(); if (_CSQC_Ent_Remove) _CSQC_Ent_Remove(this); }
265 #define CSQC_Ent_Remove _CSQC_Ent_Remove
271 #include <ecs/_mod.qh>