X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2F_all.inc;h=0bed40bbf081fcd3c784719cc463c0db1be14dcb;hb=74bd72dcc526c505735c626597a0c14eac52e5d6;hp=6408d6e3f2502aceebbe720c3151ccd8576dd9c2;hpb=04338413d72286b6f5a6377bc43a1fac55976a59;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/_all.inc b/qcsrc/lib/_all.inc index 6408d6e3f..0bed40bbf 100644 --- a/qcsrc/lib/_all.inc +++ b/qcsrc/lib/_all.inc @@ -24,6 +24,26 @@ #define bool float #endif +#ifndef QCC_SUPPORT_ACCUMULATE + #warning "QCC does not support accumulate, may not compile correctly" + #define ACCUMULATE +#else + #define ACCUMULATE [[accumulate]] +#endif + +#ifndef QCC_SUPPORT_ERASEABLE + #define ERASEABLE +#else + #define ERASEABLE [[eraseable]] +#endif + +#ifndef QCC_SUPPORT_ALIAS + #warning "QCC does not support alias, may not compile correctly" + #define ALIAS(var) +#else + #define ALIAS(var) [[alias(var)]] +#endif + #include #if defined(CSQC) @@ -41,6 +61,12 @@ #include +#ifndef QCC_SUPPORT_POW + #define pow(a, b) pow(a, b) +#else + #define pow(a, b) ((a) ** (b)) +#endif + #include "self.qh" #define USING(name, T) typedef T name @@ -61,18 +87,20 @@ MACRO_END #endif -#define is_float(this) (true || ftoe(this)) -#define isnt_float(this) -#define is_vector(this) (true || vtos(this)) -#define isnt_vector(this) -#define is_string(this) (true || stof(this)) -#define isnt_string(this) -#define is_entity(this) (true || etof(this)) -#define isnt_entity(this) -bool is_int(float this) { return this == floor(this); } -void isnt_int(float this) { print(ftos(this)); } -bool is_bool(float this) { return this == true || this == false; } -void isnt_bool(float this) { print(ftos(this)); } +#if !(NDEBUG) + #define is_float(this) (true || ftoe(this)) + #define isnt_float(this) + #define is_vector(this) (true || vtos(this)) + #define isnt_vector(this) + #define is_string(this) (true || stof(this)) + #define isnt_string(this) + #define is_entity(this) (true || etof(this)) + #define isnt_entity(this) + bool is_int(float this) { return this == floor(this); } + void isnt_int(float this) { print(ftos(this)); } + bool is_bool(float this) { return this == true || this == false; } + void isnt_bool(float this) { print(ftos(this)); } +#endif #include "warpzone/mathlib.qc" @@ -105,6 +133,7 @@ void isnt_bool(float this) { print(ftos(this)); } #include "oo.qh" #include "p2mathlib.qc" #include "progname.qh" +#include "promise.qc" #include "random.qc" #include "registry.qh" #include "registry_net.qh" @@ -122,7 +151,9 @@ void isnt_bool(float this) { print(ftos(this)); } #include "vector.qh" #include "yenc.qh" -#include "matrix/_mod.inc" +#if XONOTIC + #include "matrix/_mod.inc" +#endif #ifndef SVQC #define objerror_safe(e) @@ -172,7 +203,17 @@ void make_safe_for_remove(entity this); #define SV_Shutdown _SV_Shutdown void _StartFrame(); - void StartFrame() { if (_StartFrame) _StartFrame(); } + bool _StartFrame_init; + void spawnfunc_worldspawn(entity); + void StartFrame() { + if (!_StartFrame_init) { + _StartFrame_init = true; + float oldtime = time; time = 1; + __spawnfunc_expecting = 2; NULL.__spawnfunc_constructor(NULL); + time = oldtime; + } + if (_StartFrame) _StartFrame(); + } #define StartFrame _StartFrame void _SetNewParms(); @@ -183,6 +224,12 @@ void make_safe_for_remove(entity this); void SetChangeParms() { ENGINE_EVENT(); if (_SetChangeParms) _SetChangeParms(this); } #define SetChangeParms _SetChangeParms +#ifdef DP_EXT_PRECONNECT + void _ClientPreConnect(entity this); + void ClientPreConnect() { ENGINE_EVENT(); if (_ClientPreConnect) _ClientPreConnect(this); } + #define ClientPreConnect _ClientPreConnect +#endif + void _ClientConnect(entity this); void ClientConnect() { ENGINE_EVENT(); if (_ClientConnect) _ClientConnect(this); } #define ClientConnect _ClientConnect @@ -215,7 +262,8 @@ void make_safe_for_remove(entity this); void SV_OnEntityPreSpawnFunction() { ENGINE_EVENT(); - if (_SV_OnEntityPreSpawnFunction) _SV_OnEntityPreSpawnFunction(this); + __spawnfunc_expecting = true; + __spawnfunc_expect = this; } #define SV_OnEntityPreSpawnFunction _SV_OnEntityPreSpawnFunction