From: terencehill Date: Sun, 12 May 2019 09:22:33 +0000 (+0200) Subject: Filter out unused menu code X-Git-Tag: xonotic-v0.8.5~1502 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=dc5a88d0a97329154e43ef9e7167c161e3b6e6b8;p=xonotic%2Fxonotic-data.pk3dir.git Filter out unused menu code --- diff --git a/qcsrc/common/turrets/all.qh b/qcsrc/common/turrets/all.qh index 58a34477a..3d0528a25 100644 --- a/qcsrc/common/turrets/all.qh +++ b/qcsrc/common/turrets/all.qh @@ -47,13 +47,15 @@ REGISTRY_CHECK(Turrets) /**/ #define TR_CONFIG(class, turname, fld, T) _TR_CONFIG(class, fld, T, turname) -#define TR_CONFIG_BEGIN(class) METHOD(class, tr_config, void(class this)) { - #ifdef SVQC +#ifdef SVQC + #define TR_CONFIG_BEGIN(class) METHOD(class, tr_config, void(class this)) { #define _TR_CONFIG(class, fld, T, turname) if (#turname == this.netname) TUR_CONFIG_WRITE_CVARS(turname, fld, T); - #else + #define TR_CONFIG_END() } +#else + #define TR_CONFIG_BEGIN(class) #define _TR_CONFIG(class, fld, T, turname) - #endif -#define TR_CONFIG_END() } + #define TR_CONFIG_END() +#endif GENERIC_COMMAND(dumpturrets, "Dump all turrets into turrets_dump.txt") { diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index b9cc4ada7..a65a788ec 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -134,6 +134,8 @@ Weapon Weapons_fromstr(string s) } +#ifdef GAMEQC + // legacy w_prop mappings #define X(fld, T) .T fld; .T wepvar_##fld = fld; X(switchdelay_drop, float) @@ -150,6 +152,8 @@ const .float reloading_time = reload_time; #endif #undef X +#endif + #define W_PROPS(L, class, prefix) \ @@ -167,12 +171,17 @@ const .float reloading_time = reload_time; #define W_PROP_BOTH(class, fld, T, wepname) \ W_PROP_PRI(class, fld, T, wepname) \ W_PROP_SEC(class, fld, T, wepname) - #define W_PROP_BEGIN(class) - #define _W_PROP(class, fld, T, wepname) \ - /* static */ T _W_PROP_CVAR(wepname, fld); \ - ATTRIB(class, wepvar_##fld, T, _W_PROP_CVAR(wepname, fld)); - #define _W_PROP_CVAR(wepname, fld) autocvar_g_balance_##wepname##_##fld - #define W_PROP_END() + #define W_PROP_BEGIN(class) + #ifdef GAMEQC + #define _W_PROP(class, fld, T, wepname) \ + /* static */ T _W_PROP_CVAR(wepname, fld); \ + ATTRIB(class, wepvar_##fld, T, _W_PROP_CVAR(wepname, fld)); + #define _W_PROP_CVAR(wepname, fld) autocvar_g_balance_##wepname##_##fld + #else + #define _W_PROP(class, fld, T, wepname) + #define _W_PROP_CVAR(wepname, fld) + #endif + #define W_PROP_END() @@ -183,13 +192,15 @@ const .float reloading_time = reload_time; #define W_CONFIG_BOTH(class, fld, T, wepname) \ W_CONFIG_PRI(class, fld, T, wepname) \ W_CONFIG_SEC(class, fld, T, wepname) - #define W_CONFIG_BEGIN(class) METHOD(class, wr_config, void(class this)) { - #ifdef SVQC - #define _W_CONFIG(class, fld, T, wepname) if (#wepname == this.netname) WEP_CONFIG_WRITE_CVARS(wepname, fld, T); - #else - #define _W_CONFIG(class, fld, T, wepname) - #endif - #define W_CONFIG_END() } + #ifdef SVQC + #define W_CONFIG_BEGIN(class) METHOD(class, wr_config, void(class this)) { + #define _W_CONFIG(class, fld, T, wepname) if (#wepname == this.netname) WEP_CONFIG_WRITE_CVARS(wepname, fld, T); + #define W_CONFIG_END() } + #else + #define W_CONFIG_BEGIN(class) + #define _W_CONFIG(class, fld, T, wepname) + #define W_CONFIG_END() + #endif #define W_UPDATE(class, wepname, fld, T, m) W_UPDATE_##m(class, fld, T, wepname) @@ -199,27 +210,33 @@ const .float reloading_time = reload_time; #define W_UPDATE_BOTH(class, fld, T, wepname) \ W_UPDATE_PRI(class, fld, T, wepname) \ W_UPDATE_SEC(class, fld, T, wepname) - .entity baseline, baseline_target; - #define W_UPDATE_BEGIN(class) \ - METHOD(class, wr_update, void(class this)) \ - { \ - noref entity b = this.baseline; \ - if (!b) \ - { \ - b = this.baseline = new_pure(baseline); \ - b.baseline_target = this; \ - } - #ifdef SVQC - #define _W_UPDATE(class, fld, T, wepname) \ - { \ - T it = _W_PROP_CVAR(wepname, fld); \ - b.wepvar_##fld = this.wepvar_##fld; \ - this.wepvar_##fld = it; \ - } - #else - #define _W_UPDATE(class, fld, T, wepname) - #endif - #define W_UPDATE_END() } + #ifdef GAMEQC + .entity baseline, baseline_target; + #define W_UPDATE_BEGIN(class) \ + METHOD(class, wr_update, void(class this)) \ + { \ + noref entity b = this.baseline; \ + if (!b) \ + { \ + b = this.baseline = new_pure(baseline); \ + b.baseline_target = this; \ + } + #ifdef SVQC + #define _W_UPDATE(class, fld, T, wepname) \ + { \ + T it = _W_PROP_CVAR(wepname, fld); \ + b.wepvar_##fld = this.wepvar_##fld; \ + this.wepvar_##fld = it; \ + } + #else + #define _W_UPDATE(class, fld, T, wepname) + #endif + #define W_UPDATE_END() } + #else + #define W_UPDATE_BEGIN(class) + #define _W_UPDATE(class, fld, T, wepname) + #define W_UPDATE_END() + #endif #define W_NET(class, wepname, fld, T, m) W_NET_##m(class, fld, T, wepname) @@ -229,8 +246,8 @@ const .float reloading_time = reload_time; #define W_NET_BOTH(class, fld, T, wepname) \ W_NET_PRI(class, fld, T, wepname) \ W_NET_SEC(class, fld, T, wepname) - REGISTER_NET_TEMP(WeaponUpdate) #if defined(CSQC) + REGISTER_NET_TEMP(WeaponUpdate) #define W_NET_BEGIN(class) METHOD(class, wr_net, void(class this, int i)) { int n = 0; #define _W_NET(class, fld, T, wepname) \ { \ @@ -248,6 +265,7 @@ const .float reloading_time = reload_time; } #define W_NET_END() } #elif defined(SVQC) + REGISTER_NET_TEMP(WeaponUpdate) #define W_NET_BEGIN(class) \ METHOD(class, wr_net, void(class this, int chan)) \ { \