]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into 'master'
authorMario <zacjardine@y7mail.com>
Mon, 21 Sep 2015 21:46:46 +0000 (21:46 +0000)
committerMario <zacjardine@y7mail.com>
Mon, 21 Sep 2015 21:46:46 +0000 (21:46 +0000)
New hook chain textures

Hook chain textures remade in HD

See merge request !224

74 files changed:
qcsrc/Makefile
qcsrc/client/hud.qh
qcsrc/client/progs.inc [new file with mode: 0644]
qcsrc/client/progs.src
qcsrc/client/weapons/projectile.qc
qcsrc/common/buffs.qh
qcsrc/common/deathtypes.qh
qcsrc/common/effects.qh
qcsrc/common/mutators/base.qh
qcsrc/common/nades.qh
qcsrc/common/notifications.qc
qcsrc/common/notifications.qh
qcsrc/common/physics.qc
qcsrc/common/playerstats.qc
qcsrc/common/triggers/func/breakable.qc
qcsrc/common/triggers/subs.qc
qcsrc/common/triggers/target/speaker.qc
qcsrc/common/turrets/config.qh
qcsrc/common/turrets/turrets.qh
qcsrc/common/util-pre.qh
qcsrc/common/vehicles/all.qc
qcsrc/common/vehicles/all.qh
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/weapon/porto.qc
qcsrc/lib/Accumulate.qh [deleted file]
qcsrc/lib/Bool.qh [deleted file]
qcsrc/lib/Counting.qh [deleted file]
qcsrc/lib/Cvar.qh [deleted file]
qcsrc/lib/Defer.qh [deleted file]
qcsrc/lib/Draw.qh [deleted file]
qcsrc/lib/I18N.qh [deleted file]
qcsrc/lib/Lazy.qh [deleted file]
qcsrc/lib/Log.qh [deleted file]
qcsrc/lib/Math.qh [deleted file]
qcsrc/lib/Nil.qh [deleted file]
qcsrc/lib/OO.qh [deleted file]
qcsrc/lib/Player.qh [deleted file]
qcsrc/lib/Progname.qh [deleted file]
qcsrc/lib/Registry.qh [deleted file]
qcsrc/lib/Static.qh [deleted file]
qcsrc/lib/String.qh [deleted file]
qcsrc/lib/Struct.qh [deleted file]
qcsrc/lib/Vector.qh [deleted file]
qcsrc/lib/_all.inc
qcsrc/lib/accumulate.qh [new file with mode: 0644]
qcsrc/lib/bool.qh [new file with mode: 0644]
qcsrc/lib/counting.qh [new file with mode: 0644]
qcsrc/lib/cvar.qh [new file with mode: 0644]
qcsrc/lib/defer.qh [new file with mode: 0644]
qcsrc/lib/draw.qh [new file with mode: 0644]
qcsrc/lib/i18n.qh [new file with mode: 0644]
qcsrc/lib/lazy.qh [new file with mode: 0644]
qcsrc/lib/log.qh [new file with mode: 0644]
qcsrc/lib/math.qh [new file with mode: 0644]
qcsrc/lib/nil.qh [new file with mode: 0644]
qcsrc/lib/oo.qh [new file with mode: 0644]
qcsrc/lib/player.qh [new file with mode: 0644]
qcsrc/lib/progname.qh [new file with mode: 0644]
qcsrc/lib/registry.qh [new file with mode: 0644]
qcsrc/lib/static.qh [new file with mode: 0644]
qcsrc/lib/string.qh [new file with mode: 0644]
qcsrc/lib/struct.qh [new file with mode: 0644]
qcsrc/lib/vector.qh [new file with mode: 0644]
qcsrc/menu/progs.inc [new file with mode: 0644]
qcsrc/menu/progs.src
qcsrc/menu/xonotic/dialog_settings_game.qc
qcsrc/menu/xonotic/util.qc
qcsrc/server/cl_player.qc
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/mutator_buffs.qc
qcsrc/server/progs.inc [new file with mode: 0644]
qcsrc/server/progs.src
qcsrc/whitespace.sh

index 143f53249b43f3b79f5e9a7cb323e6237ffac117..34bf30fdcdcfe9c052fbf6ab4d0aa136948f6b6c 100644 (file)
@@ -40,7 +40,7 @@ $(QCCVERSIONFILE):
        $(RM) qccversion.*
        echo This file intentionally left blank. > $@
 
-FILES_CSPROGS = $(shell find client common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm)
+FILES_CSPROGS = $(shell find client lib common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm)
 ../csprogs.dat: $(FILES_CSPROGS) $(QCCVERSIONFILE)
        @echo make[1]: Entering directory \`$(PWD)/client\'
        cd client && $(QCC) $(QCCFLAGS) -DCSQC
@@ -48,12 +48,12 @@ FILES_CSPROGS = $(shell find client common warpzonelib csqcmodellib -type f -not
 server/precache-for-csqc.inc: $(FILES_CSPROGS)
        sh collect-precache.sh
 
-FILES_PROGS = $(shell find server common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm)
+FILES_PROGS = $(shell find server lib common warpzonelib csqcmodellib -type f -not -name fteqcc.log -not -name qc.asm)
 ../progs.dat: $(FILES_PROGS) $(QCCVERSIONFILE) server/precache-for-csqc.inc
        @echo make[1]: Entering directory \`$(PWD)/server\'
        cd server && $(QCC) $(QCCFLAGS) -DSVQC
 
-FILES_MENU = $(shell find menu common warpzonelib -type f -not -name fteqcc.log -not -name qc.asm)
+FILES_MENU = $(shell find menu lib common warpzonelib -type f -not -name fteqcc.log -not -name qc.asm)
 ../menu.dat: $(FILES_MENU) $(QCCVERSIONFILE)
        @echo make[1]: Entering directory \`$(PWD)/menu\'
        cd menu && $(QCC) $(QCCFLAGS) -DMENUQC
index d30eea145de3c29e86281185819f3732f4344bb0..62b5ec6fd3675e5cf6f41ff0066e41a6c5c9fcb9 100644 (file)
@@ -198,7 +198,7 @@ void HUD_ItemsTime();
                hud_panelent.panel_showflags = showflags;                                                                                                                                       \
                HUD_PANEL_NUM++;                                                                                                                                                                                        \
        }                                                                                                                                                                                                                               \
-       ACCUMULATE_FUNCTION(RegisterHUD_Panels, RegisterHUD_Panel_##NAME);
+       ACCUMULATE_FUNCTION(RegisterHUD_Panels, RegisterHUD_Panel_##NAME)
 
 HUD_PANELS(HUD_PANEL)
 #undef HUD_PANEL
diff --git a/qcsrc/client/progs.inc b/qcsrc/client/progs.inc
new file mode 100644 (file)
index 0000000..b46a371
--- /dev/null
@@ -0,0 +1,77 @@
+#include "../common/util-pre.qh"
+#include "../dpdefs/csprogsdefs.qh"
+#include "../common/util-post.qh"
+
+#include "../lib/_all.inc"
+
+#include "announcer.qc"
+#include "bgmscript.qc"
+#include "controlpoint.qc"
+#include "csqcmodel_hooks.qc"
+#include "damage.qc"
+#include "effects.qc"
+#include "generator.qc"
+#include "gibs.qc"
+#include "hook.qc"
+#include "hud.qc"
+#include "hud_config.qc"
+#include "main.qc"
+#include "mapvoting.qc"
+#include "miscfunctions.qc"
+#include "modeleffects.qc"
+#include "movelib.qc"
+#include "particles.qc"
+#include "player_skeleton.qc"
+#include "rubble.qc"
+#include "scoreboard.qc"
+#include "shownames.qc"
+#include "teamradar.qc"
+#include "tuba.qc"
+#include "t_items.qc"
+#include "view.qc"
+#include "wall.qc"
+
+#include "command/all.qc"
+
+#include "weapons/projectile.qc" // TODO
+
+#include "../common/animdecide.qc"
+#include "../common/buffs.qc"
+#include "../common/effects.qc"
+#include "../common/mapinfo.qc"
+#include "../common/movetypes/include.qc"
+#include "../common/nades.qc"
+#include "../common/net_notice.qc"
+#include "../common/notifications.qc"
+#include "../common/physics.qc"
+#include "../common/playerstats.qc"
+#include "../common/util.qc"
+
+#include "../common/viewloc.qc"
+
+#include "../common/minigames/minigames.qc"
+#include "../common/minigames/cl_minigames.qc"
+
+#include "../common/items/all.qc"
+#include "../common/monsters/all.qc"
+#include "../common/mutators/all.qc"
+#include "../common/vehicles/all.qc"
+#include "../common/weapons/all.qc"
+
+#include "../common/turrets/cl_turrets.qc"
+#include "../common/turrets/turrets.qc"
+
+#include "../common/triggers/include.qc"
+
+#include "../csqcmodellib/cl_model.qc"
+#include "../csqcmodellib/cl_player.qc"
+#include "../csqcmodellib/interpolate.qc"
+
+#include "../server/mutators/mutator_multijump.qc"
+
+#include "../warpzonelib/anglestransform.qc"
+#include "../warpzonelib/client.qc"
+#include "../warpzonelib/common.qc"
+#include "../warpzonelib/util_server.qc"
+
+#include "../mod/client/progs.inc"
index 02e52fe0d1858aed9dad4a12a695e4064944ba58..8a3c0360f784e7eb6fc0b46afba635321b890b3a 100644 (file)
@@ -1,79 +1,2 @@
 ../../csprogs.dat
-
-../common/util-pre.qh
-../dpdefs/csprogsdefs.qh
-../common/util-post.qh
-
-../lib/_all.inc
-
-announcer.qc
-bgmscript.qc
-controlpoint.qc
-csqcmodel_hooks.qc
-damage.qc
-effects.qc
-generator.qc
-gibs.qc
-hook.qc
-hud.qc
-hud_config.qc
-main.qc
-mapvoting.qc
-miscfunctions.qc
-modeleffects.qc
-movelib.qc
-particles.qc
-player_skeleton.qc
-rubble.qc
-scoreboard.qc
-shownames.qc
-teamradar.qc
-tuba.qc
-t_items.qc
-view.qc
-wall.qc
-
-command/all.qc
-
-weapons/projectile.qc // TODO
-
-../common/animdecide.qc
-../common/buffs.qc
-../common/effects.qc
-../common/mapinfo.qc
-../common/movetypes/include.qc
-../common/nades.qc
-../common/net_notice.qc
-../common/notifications.qc
-../common/physics.qc
-../common/playerstats.qc
-../common/util.qc
-
-../common/viewloc.qc
-
-../common/minigames/minigames.qc
-../common/minigames/cl_minigames.qc
-
-../common/items/all.qc
-../common/monsters/all.qc
-../common/mutators/all.qc
-../common/vehicles/all.qc
-../common/weapons/all.qc
-
-../common/turrets/cl_turrets.qc
-../common/turrets/turrets.qc
-
-../common/triggers/include.qc
-
-../csqcmodellib/cl_model.qc
-../csqcmodellib/cl_player.qc
-../csqcmodellib/interpolate.qc
-
-../server/mutators/mutator_multijump.qc
-
-../warpzonelib/anglestransform.qc
-../warpzonelib/client.qc
-../warpzonelib/common.qc
-../warpzonelib/util_server.qc
-
-../mod/client/progs.inc
+progs.inc
index 7f13ab5dfe5455c31baa259cfe9a5feb8bd88510..0d143cb1e33d8c31ff6e38feedf3eee6f15962d3 100644 (file)
@@ -114,7 +114,7 @@ void Projectile_Draw()
                                break;
                }
 
-               if(Nade_FromProjectile(self.cnt) != NADE_TYPE_NULL)
+               if(Nade_FromProjectile(self.cnt) != NADE_TYPE_Null)
                        rot = self.avelocity;
 
                self.angles = AnglesTransform_ToAngles(AnglesTransform_Multiply(AnglesTransform_FromAngles(self.angles), rot * (t - self.spawntime)));
@@ -142,7 +142,7 @@ void Projectile_Draw()
                        break;
        }
 
-       if(Nade_FromProjectile(self.cnt) != NADE_TYPE_NULL)
+       if(Nade_FromProjectile(self.cnt) != NADE_TYPE_Null)
                trailorigin += v_up * 4;
 
        if(drawn)
@@ -290,8 +290,8 @@ void Ent_Projectile()
                        case PROJECTILE_GRENADE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break;
                        case PROJECTILE_GRENADE_BOUNCING: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break;
                        case PROJECTILE_MINE: setmodel(self, "models/mine.md3");self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break;
-                       case PROJECTILE_BLASTER: setmodel(self, "models/laser.mdl");self.traileffect = particleeffectnum(EFFECT_NULL); break;
-                       case PROJECTILE_HLAC: setmodel(self, "models/hlac_bullet.md3");self.traileffect = particleeffectnum(EFFECT_NULL); break;
+                       case PROJECTILE_BLASTER: setmodel(self, "models/laser.mdl");self.traileffect = particleeffectnum(EFFECT_Null); break;
+                       case PROJECTILE_HLAC: setmodel(self, "models/hlac_bullet.md3");self.traileffect = particleeffectnum(EFFECT_Null); break;
                        case PROJECTILE_PORTO_RED: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_WIZSPIKE); self.scale = 4; break;
                        case PROJECTILE_PORTO_BLUE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_WIZSPIKE); self.scale = 4; break;
                        case PROJECTILE_HOOKBOMB: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_KNIGHTSPIKE); break;
@@ -307,13 +307,13 @@ void Ent_Projectile()
                        case PROJECTILE_MAGE_SPIKE: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_VORESPIKE); break;
                        case PROJECTILE_SHAMBLER_LIGHTNING: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
 
-                       case PROJECTILE_RAPTORBOMB:    setmodel(self, "models/vehicles/clusterbomb.md3"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_NULL); break;
-                       case PROJECTILE_RAPTORBOMBLET: setmodel(self, "models/vehicles/bomblet.md3");     self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_NULL); break;
+                       case PROJECTILE_RAPTORBOMB:    setmodel(self, "models/vehicles/clusterbomb.md3"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_Null); break;
+                       case PROJECTILE_RAPTORBOMBLET: setmodel(self, "models/vehicles/bomblet.md3");     self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_Null); break;
                        case PROJECTILE_RAPTORCANNON:  setmodel(self, "models/plasmatrail.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_CRYLINKPLASMA); break;
 
                        case PROJECTILE_SPIDERROCKET: setmodel(self, "models/vehicles/rocket02.md3"); self.traileffect = particleeffectnum(EFFECT_SPIDERBOT_ROCKET_TRAIL); break;
                        case PROJECTILE_WAKIROCKET:   setmodel(self, "models/vehicles/rocket01.md3");  self.traileffect = particleeffectnum(EFFECT_RACER_ROCKET_TRAIL); break;
-                       case PROJECTILE_WAKICANNON:   setmodel(self, "models/laser.mdl");  self.traileffect = particleeffectnum(EFFECT_NULL); break;
+                       case PROJECTILE_WAKICANNON:   setmodel(self, "models/laser.mdl");  self.traileffect = particleeffectnum(EFFECT_Null); break;
 
                        case PROJECTILE_BUMBLE_GUN: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
                        case PROJECTILE_BUMBLE_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
@@ -326,7 +326,7 @@ void Ent_Projectile()
                                if(MUTATOR_CALLHOOK(Ent_Projectile, self))
                                        break;
 
-                               if (Nade_FromProjectile(self.cnt) != NADE_TYPE_NULL)
+                               if (Nade_FromProjectile(self.cnt) != NADE_TYPE_Null)
                                {
                                        setmodel(self, W_Model("v_ok_grenade.md3"));
                                        self.traileffect = _particleeffectnum(Nade_TrailEffect(self.cnt, self.team));
@@ -461,7 +461,7 @@ void Ent_Projectile()
                                break;
                }
 
-               if(Nade_FromProjectile(self.cnt) != NADE_TYPE_NULL)
+               if(Nade_FromProjectile(self.cnt) != NADE_TYPE_Null)
                {
                        entity nade_type = Nade_FromProjectile(self.cnt);
                        self.mins = '-16 -16 -16';
index eeaba7371d94ed86394f3a34ea49eaa981f932fc..3eff9e26b8e39d3298000b3c77106a4525a3b2f4 100644 (file)
@@ -40,7 +40,7 @@ CLASS(Buff, Pickup)
 #endif
 ENDCLASS(Buff)
 
-REGISTER_BUFF(NULL);
+REGISTER_BUFF(Null);
 
 REGISTER_BUFF(AMMO) {
        this.m_prettyName = _("Ammo");
@@ -173,7 +173,7 @@ BUFF_SPAWNFUNCS(invisible,          BUFF_INVISIBLE)
 BUFF_SPAWNFUNCS(inferno,               BUFF_INFERNO)
 BUFF_SPAWNFUNCS(swapper,               BUFF_SWAPPER)
 BUFF_SPAWNFUNCS(magnet,                        BUFF_MAGNET)
-BUFF_SPAWNFUNCS(random,                        BUFF_NULL)
+BUFF_SPAWNFUNCS(random,                        BUFF_Null)
 
 BUFF_SPAWNFUNC_Q3TA_COMPAT(doubler,    BUFF_MEDIC)
 BUFF_SPAWNFUNC_Q3TA_COMPAT(resistance, BUFF_RESISTANCE)
index b9c215f907b5fe28e53c121337829cc9bd2fc450..c1e8bd2218f0c7787f4e327106649ad0632c868a 100644 (file)
@@ -104,7 +104,7 @@ entity deathtypes[DT_MAX];
                if (msg_death_by != NO_MSG) \
                        deathent.death_msgmurder = msg_multi_notifs[msg_death_by - 1]; \
        } \
-       ACCUMULATE_FUNCTION(RegisterDeathtypes, RegisterDeathtype_##name);
+       ACCUMULATE_FUNCTION(RegisterDeathtypes, RegisterDeathtype_##name)
 
 DEATHTYPES
 #undef DEATHTYPE
index b72eab243dad90a1a4f88e0e7a0b40a59c6a19ae..a1102e96a26fb6cf92eee01d0a69e78f08ca8f8b 100644 (file)
@@ -53,9 +53,9 @@ void RegisterEffects_Done()
 }
 
 // NOW we actually activate the declarations
-ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_First);
-EFFECT(0, NULL, string_null)
+ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_First)
+EFFECT(0, Null, string_null)
 #include "effects.inc"
-ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_Done);
+ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_Done)
 
 #endif
index 1183914cf157ed5b1573bb4546d27c6a52579c5b..6fa77a858a21a2bceb2169d603c5b1a577111797 100644 (file)
@@ -247,14 +247,14 @@ STATIC_INIT_LATE(Mutators) {
     [[accumulate]] void RegisterCallbacks() { CALLBACK_##name = NEW(Callback, func); }
 
 #define MUTATOR_HOOKFUNCTION(...) \
-    OVERLOAD(MUTATOR_HOOKFUNCTION, __VA_ARGS__)
+    EVAL(OVERLOAD(MUTATOR_HOOKFUNCTION, __VA_ARGS__))
 
 #define MUTATOR_HOOKFUNCTION_1(name) \
     _MUTATOR_CALLBACK(name, HOOKFUNCTION_##name) \
     bool HOOKFUNCTION_##name()
 
 #define MUTATOR_HOOKFUNCTION_2(mut, cb) \
-    MUTATOR_HOOKFUNCTION(mut, cb, CBC_ORDER_ANY)
+    MUTATOR_HOOKFUNCTION_3(mut, cb, CBC_ORDER_ANY)
 
 #define MUTATOR_HOOKFUNCTION_3(mut, cb, order) \
     _MUTATOR_CALLBACK(mut##_##cb, mut##_##cb) \
index 5a9877c4ee961565ec906a8daac69de315c5ff1b..9ec6c291451c20a80d683138178121afbbac88c0 100644 (file)
@@ -40,7 +40,7 @@ CLASS(Nade, Object)
     }
 ENDCLASS(Nade)
 
-REGISTER_NADE(NULL);
+REGISTER_NADE(Null);
 
 #define NADE_PROJECTILE(i, projectile, trail) do { \
     this.m_projectile[i] = projectile; \
@@ -109,7 +109,7 @@ entity Nade_FromProjectile(float proj)
             if (it.m_projectile[j] == proj) return it;
         }
     ));
-    return NADE_TYPE_NULL;
+    return NADE_TYPE_Null;
 }
 
 string Nade_TrailEffect(float proj, float nade_team)
index 16521a849d32f5f7c20c3be16311ab3d0ea3e444..626c42c7d61d590c5d4e00f71b34041220e64edc 100644 (file)
@@ -69,7 +69,7 @@ string Notification_CheckArgs_TypeName(float net_type, float net_name)
 {
        // check supplied type and name for errors
        string checkargs = "";
-       #define CHECKARG_TYPENAME(type) case MSG_##type##: \
+       #define CHECKARG_TYPENAME(type) case MSG_##type: \
                { if(!net_name || (net_name > NOTIF_##type##_COUNT)) \
                { checkargs = sprintf("Improper name: %d!", net_name); } break; }
        switch(net_type)
index 2fbc9cdf0e67154affb28ff7f62bdb3be2600fe0..d44a651567f767b95ed80da560fea7bf22794587 100644 (file)
@@ -623,7 +623,7 @@ float notif_global_error;
             NO_MSG,   /* optiona     */ \
             NO_MSG);  /* optionb     */ \
     } \
-    ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name);
+    ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
 
 #define MSG_INFO_NOTIF(default,name,strnum,flnum,args,hudargs,icon,normal,gentle) \
     NOTIF_ADD_AUTOCVAR(name, default) \
@@ -665,7 +665,7 @@ float notif_global_error;
             NO_MSG,   /* optiona     */ \
             NO_MSG);  /* optionb     */ \
     } \
-    ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name);
+    ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
 
 .string nent_iconargs;
 #define MULTIICON_INFO(default,name,strnum,flnum,args,hudargs,iconargs,icon,normal,gentle) \
@@ -709,7 +709,7 @@ float notif_global_error;
             NO_MSG);  /* optionb     */ \
         msg_info_notifs[name - 1].nent_iconargs = iconargs; \
     } \
-    ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name);
+    ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
 
 #define MSG_CENTER_NOTIF(default,name,strnum,flnum,args,cpid,durcnt,normal,gentle) \
     NOTIF_ADD_AUTOCVAR(name, default) \
@@ -751,7 +751,7 @@ float notif_global_error;
             NO_MSG,   /* optiona     */ \
             NO_MSG);  /* optionb     */ \
     } \
-    ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name);
+    ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
 
 #define MSG_MULTI_NOTIF(default,name,anncename,infoname,centername) \
     NOTIF_ADD_AUTOCVAR(name, default) \
@@ -793,7 +793,7 @@ float notif_global_error;
             NO_MSG,   /* optiona     */ \
             NO_MSG);  /* optionb     */ \
     } \
-    ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name);
+    ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
 
 #define ACVNN(name) autocvar_notification_##name
 
@@ -838,7 +838,7 @@ float notif_global_error;
             optiona,                                 /* optiona     */ \
             optionb);                                /* optionb     */ \
     } \
-    ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name);
+    ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
 
 void RegisterNotifications_First()
 {
@@ -882,8 +882,8 @@ void RegisterNotifications_Done()
 }
 
 // NOW we actually activate the declarations
-ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotifications_First);
+ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotifications_First)
 #include "notifications.inc"
-ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotifications_Done);
+ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotifications_Done)
 
 #endif
index b3db77143b375f4bdb315e22a1a3c0d057aecd38..1a799c8de79c903edef70a5db80115bc103d657b 100644 (file)
@@ -25,15 +25,15 @@ float Physics_ClientOption(entity pl, string option)
 {
        if(Physics_Valid(pl.cvar_cl_physics))
        {
-               string var = sprintf("g_physics_%s_%s", pl.cvar_cl_physics, option);
-               if(cvar_type(var) & CVAR_TYPEFLAG_EXISTS)
-                       return cvar(var);
+               string s = sprintf("g_physics_%s_%s", pl.cvar_cl_physics, option);
+               if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS)
+                       return cvar(s);
        }
        if(autocvar_g_physics_clientselect && autocvar_g_physics_clientselect_default)
        {
-               string var = sprintf("g_physics_%s_%s", autocvar_g_physics_clientselect_default, option);
-               if(cvar_type(var) & CVAR_TYPEFLAG_EXISTS)
-                       return cvar(var);
+               string s = sprintf("g_physics_%s_%s", autocvar_g_physics_clientselect_default, option);
+               if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS)
+                       return cvar(s);
        }
        return cvar(strcat("sv_", option));
 }
index 74004d062bcd0cb14b88b1b91568f8e76b4cad87..3a44d71905ec36f071f671f789364f4cfd270c74 100644 (file)
@@ -1036,8 +1036,7 @@ void PlayerInfo_Details()
 #endif
 
 #ifdef CSQC
-/*
- * FIXME - crypto_* builtin functions missing in CSQC (csprogsdefs.qh:885)
+// FIXME - crypto_* builtin functions missing in CSQC (csprogsdefs.qh:885)
 void PlayerInfo_Details()
 {
         print("-- Getting detailed PlayerInfo for local player (CSQC)\n");
index d705f842fba17a692b59995763c67e517de685fe..160399d0d2d1a15920b8ee28bf9118535f8402ed 100644 (file)
@@ -5,7 +5,7 @@
 #include "../../../server/g_subs.qh"
 #include "../../../server/g_damage.qh"
 #include "../../../server/bot/bot.qh"
-#include "../../common/csqcmodel_settings.qh"
+#include "../../../common/csqcmodel_settings.qh"
 #include "../../../csqcmodellib/sv_model.qh"
 #include "../../../server/weapons/common.qh"
 
index b313c49996046e1dec57d08169a891a44fdff6c9..d9de97301b9d068d8569bf1f8503723201918083 100644 (file)
@@ -123,9 +123,11 @@ void SUB_CalcMove_controller_think (void)
                        destangle_x = -destangle_x; // flip up / down orientation
 
                        // take the shortest distance for the angles
-                       SUB_ANGLES(self.owner)_x -= 360 * floor((SUB_ANGLES(self.owner)_x - destangle_x) / 360 + 0.5);
-                       SUB_ANGLES(self.owner)_y -= 360 * floor((SUB_ANGLES(self.owner)_y - destangle_y) / 360 + 0.5);
-                       SUB_ANGLES(self.owner)_z -= 360 * floor((SUB_ANGLES(self.owner)_z - destangle_z) / 360 + 0.5);
+                       vector v = SUB_ANGLES(self.owner);
+                       v.x -= 360 * floor((v.x - destangle_x) / 360 + 0.5);
+                       v.y -= 360 * floor((v.y - destangle_y) / 360 + 0.5);
+                       v.z -= 360 * floor((v.z - destangle_z) / 360 + 0.5);
+                       SUB_ANGLES(self.owner) = v;
                        angloc = destangle - SUB_ANGLES(self.owner);
                        angloc = angloc * (1 / PHYS_INPUT_FRAMETIME); // so it arrives for the next frame
                        self.owner.SUB_AVELOCITY = angloc;
index 058ffd52639950f15cdff70fa12586880c6a3661..e0701dc14f3273487baec91a8d19543f0b1d1e08 100644 (file)
@@ -8,15 +8,14 @@ void target_speaker_use_activator()
        string snd;
        if(substring(self.noise, 0, 1) == "*")
        {
-               var .string sample;
-               sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
+               var .string sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
                if(GetPlayerSoundSampleField_notFound)
                        snd = "misc/null.wav";
-               else if(activator.sample == "")
+               else if(activator.(sample) == "")
                        snd = "misc/null.wav";
                else
                {
-                       tokenize_console(activator.sample);
+                       tokenize_console(activator.(sample));
                        float n;
                        n = stof(argv(1));
                        if(n > 0)
@@ -35,15 +34,14 @@ void target_speaker_use_on()
        string snd;
        if(substring(self.noise, 0, 1) == "*")
        {
-               var .string sample;
-               sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
+               var .string sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
                if(GetPlayerSoundSampleField_notFound)
                        snd = "misc/null.wav";
-               else if(activator.sample == "")
+               else if(activator.(sample) == "")
                        snd = "misc/null.wav";
                else
                {
-                       tokenize_console(activator.sample);
+                       tokenize_console(activator.(sample));
                        float n;
                        n = stof(argv(1));
                        if(n > 0)
index 9eb69f29dd54fa804b86e94e2456e453e4dce94c..4d35ee3b38528d0ca7bfed081df868f7d602f72e 100644 (file)
@@ -7,27 +7,14 @@ void Dump_Turret_Settings(void);
 float tur_config_file;
 float tur_config_alsoprint;
 
-#define MAX_TUR_CONFIG 256
+const int MAX_TUR_CONFIG = 256;
 float TUR_CONFIG_COUNT;
 string tur_config_queue[MAX_TUR_CONFIG];
 
-#define TUR_CONFIG_QUEUE(a) { \
-       tur_config_queue[TUR_CONFIG_COUNT] = a; \
-       ++TUR_CONFIG_COUNT; }
-
 #define TUR_CONFIG_WRITETOFILE(a) { \
        fputs(tur_config_file, a); \
        if(tur_config_alsoprint) { LOG_INFO(a); } }
 
-#define TUR_CONFIG_WRITE_CVARS(turret,name) \
-               { TUR_CONFIG_QUEUE( \
-                       sprintf("set g_turrets_unit_%s_%s %g\n", #turret, #name, \
-                       cvar(sprintf("g_turrets_unit_%s_%s", #turret, #name)))) } \
-
-#define TUR_CONFIG_SETTINGS(tursettings) \
-       #define TUR_ADD_CVAR(turret,name) TUR_CONFIG_WRITE_CVARS(turret,name) \
-       tursettings \
-       #undef TUR_ADD_CVAR
 
 #endif
 
index b3736aff9cbe4d17bc34820cd3be5f494ea4591b..e1bf48c1b2af08d2d70a6a062b33ea93c0b32823 100644 (file)
@@ -158,7 +158,7 @@ void register_turret(float id, float(float) func, float turretflags, vector min_
 void register_turrets_done();
 
 const float TUR_MAXCOUNT = 24;
-#define TUR_FIRST 1
+const int TUR_FIRST = 1;
 float TUR_COUNT;
 float TUR_LAST;
 
@@ -180,23 +180,9 @@ float TUR_LAST;
        REGISTER_TURRET_2(TUR_##id,func,turretflags,min_s,max_s,modelname,headmodelname,shortname,mname)
 #endif
 
-#define TUR_DUPECHECK(dupecheck,cvar) \
-       #ifndef dupecheck \
-               #define dupecheck \
-               float cvar; \
-       #else \
-               #error DUPLICATE TURRET CVAR: cvar \
-       #endif
-
-#define TUR_ADD_CVAR(turret,name) \
-               TUR_DUPECHECK(TUR_CVAR_##turret##_##name, autocvar_g_turrets_unit_##turret##_##name)
-
-#define TUR_CVAR(turret,name) autocvar_g_turrets_unit_##turret##_##name
-
 #include "all.qh"
 
-#undef TUR_ADD_CVAR
 #undef REGISTER_TURRET
-ACCUMULATE_FUNCTION(RegisterTurrets, register_turrets_done);
+ACCUMULATE_FUNCTION(RegisterTurrets, register_turrets_done)
 
 #endif
index b81fd2a6df81d409626458a4ba338a15273796f2..ad9be12cbab8b5bf7773429f72d30ba6733a3d88 100644 (file)
@@ -13,7 +13,7 @@
 
 #ifndef QCC_SUPPORT_NIL
     #ifdef GMQCC
-        #define QCC_SUPPORT_NIL
+        #define QCC_SUPPORT_NIL 1
     #endif
 #endif
 
 #define FOREACH(list, cond, body) FOREACH_LIST(list, enemy, cond, body)
 
 #ifdef GMQCC
-    #define OVERLOAD(F, ...) F##_##__VA_COUNT__(__VA_ARGS__)
+    #define EVAL(...)           __VA_ARGS__
+
+    #define OVERLOAD_(F, ...)   F##_##__VA_COUNT__(__VA_ARGS__)
+    #define OVERLOAD(F, ...)    F##_##__VA_COUNT__(__VA_ARGS__)
 #else
-    #define OVERLOAD_(F,_9,_8,_7,_6,_5,_4,_3,_2,_1,n,...) F##_##n
-    #define OVERLOAD(F, ...) OVERLOAD_(F,__VA_ARGS__,9,8,7,6,5,4,3,2,1)(__VA_ARGS__)
+    #define EMPTY()
+    #define DEFER(id) id EMPTY()
+
+    #define EVAL(...)  EVAL1(EVAL1(EVAL1(__VA_ARGS__)))
+    #define EVAL1(...) EVAL2(EVAL2(EVAL2(__VA_ARGS__)))
+    #define EVAL2(...) EVAL3(EVAL3(EVAL3(__VA_ARGS__)))
+    #define EVAL3(...) EVAL4(EVAL4(EVAL4(__VA_ARGS__)))
+    #define EVAL4(...) EVAL5(EVAL5(EVAL5(__VA_ARGS__)))
+    #define EVAL5(...) __VA_ARGS__
+
+    #define OVERLOAD___(F,_16,_15,_14,_13,_12,_11,_10,_9,_8,_7,_6,_5,_4,_3,_2,_1,n,...) F##_##n
+    #define OVERLOAD__(F, ...)  OVERLOAD___(F,##__VA_ARGS__,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)
+    #define OVERLOAD_(...)      DEFER(OVERLOAD__(__VA_ARGS__))
+    #define OVERLOAD(F, ...)    OVERLOAD_(F,##__VA_ARGS__)(__VA_ARGS__)
 #endif
 
 #define LAMBDA(...) { __VA_ARGS__ ; }
 
-#define MAP(f, ...) OVERLOAD(MAP, f, __VA_ARGS__)
+#define MAP(f, ...) EVAL(OVERLOAD(MAP, f, __VA_ARGS__))
 #define MAP_2(f, it) f(it)
 #define MAP_3(f, it, ...) f(it)MAP_2(f, __VA_ARGS__)
 #define MAP_4(f, it, ...) f(it)MAP_3(f, __VA_ARGS__)
index f0316ab1fac7f2da65c7269dcd43b56b345ff060..923ed4e5bd4f2e977a92e0ef258db313fafdd4b9 100644 (file)
@@ -48,9 +48,9 @@ STATIC_INIT(vehicles_common_initialize)
 
 entity get_vehicleinfo(int id)
 {
-       if (id < VEH_FIRST || id > VEH_LAST) return VEH_NULL;
+       if (id < VEH_FIRST || id > VEH_LAST) return VEH_Null;
        entity m = vehicle_info[id];
-       return m ? m : VEH_NULL;
+       return m ? m : VEH_Null;
 }
 
 #endif
index fa9e83f48531fa66231691391eade3a57781808f..a18bfe13e14a5d0dc0432db9191967c5818ef6f2 100644 (file)
@@ -76,7 +76,7 @@ const int VEH_FIRST = 1;
     REGISTER_INIT(VEH, id)
 REGISTER_REGISTRY(RegisterVehicles)
 
-REGISTER_VEHICLE(NULL, Vehicle);
+REGISTER_VEHICLE(Null, Vehicle);
 
 #include "all.inc"
 
index bc8399b09fcda3c2f1322ebf7bfbf58c831e678f..ea9f18fd26bc29e0e52fd82917ce18ce6bbea452 100644 (file)
@@ -599,16 +599,16 @@ void vehicle_use()
 
 void vehicles_regen(float timer, .float regen_field, float field_max, float rpause, float regen, float delta_time, float _healthscale)
 {SELFPARAM();
-       if(self.regen_field < field_max)
+       if(self.(regen_field) < field_max)
        if(timer + rpause < time)
        {
                if(_healthscale)
                        regen = regen * (self.vehicle_health / self.max_health);
 
-               self.regen_field = min(self.regen_field + regen * delta_time, field_max);
+               self.(regen_field) = min(self.(regen_field) + regen * delta_time, field_max);
 
                if(self.owner)
-                       self.owner.regen_field = (self.regen_field / field_max) * 100;
+                       self.owner.(regen_field) = (self.(regen_field) / field_max) * 100;
        }
 }
 
index 081e13a7e58e64f4c5205d047b58fa8f3f7ea0d0..f965c39988783e32b704a9959e6068ccaa583c31 100644 (file)
@@ -267,5 +267,5 @@ entity dummy_weapon_info;
 #undef WEP_ADD_CVAR
 #undef WEP_ADD_PROP
 void register_weapons_done();
-ACCUMULATE_FUNCTION(RegisterWeapons, register_weapons_done);
+ACCUMULATE_FUNCTION(RegisterWeapons, register_weapons_done)
 #endif
index 03a77f0cb9c06302731352a9e4d0a3cc069297b0..9bc8f3b1c7c2e0a6052c53ece21d219e3b24ff44 100644 (file)
@@ -39,7 +39,7 @@ PORTO_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-#include "../triggers/trigger/jumppads.qh"
+#include "../../triggers/trigger/jumppads.qh"
 
 void spawnfunc_weapon_porto(void) { weapon_defaultspawnfunc(WEP_PORTO.m_id); }
 
diff --git a/qcsrc/lib/Accumulate.qh b/qcsrc/lib/Accumulate.qh
deleted file mode 100644 (file)
index 423f364..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef ACCUMULATE_H
-#define ACCUMULATE_H
-
-#ifdef QCC_SUPPORT_ACCUMULATE
-# define ACCUMULATE_FUNCTION(func, otherfunc) \
-    [[accumulate]] void func() { otherfunc(); }
-# define CALL_ACCUMULATED_FUNCTION(func) \
-    func()
-#else
-#ifdef HAVE_YO_DAWG_CPP
-// TODO make ascii art pic of xzibit
-// YO DAWG!
-// I HERD YO LIEK MACROS
-// SO I PUT A MACRO DEFINITION IN YO MACRO DEFINITION
-// SO YO CAN EXPAND MACROS WHILE YO EXPAND MACROS
-# define ACCUMULATE_FUNCTION(func,otherfunc) \
-    #ifdef func \
-    void __merge__##otherfunc() { func(); otherfunc(); } \
-    #undef func \
-    #define func __merge__##otherfunc \
-    #else \
-    #define func otherfunc \
-    #endif
-# define CALL_ACCUMULATED_FUNCTION(func) \
-    func()
-#else
-# define ACCUMULATE_FUNCTION(func,otherfunc) \
-    .float _ACCUMULATE_##func##__##otherfunc
-void ACCUMULATE_call(string func)
-{
-    float i;
-    float n = numentityfields();
-    string funcprefix = strcat("_ACCUMULATE_", func, "__");
-    float funcprefixlen = strlen(funcprefix);
-    for(i = 0; i < n; ++i)
-    {
-        string name = entityfieldname(i);
-        if(substring(name, 0, funcprefixlen) == funcprefix)
-            callfunction(substring(name, funcprefixlen, -1));
-    }
-}
-# define CALL_ACCUMULATED_FUNCTION(func) \
-    ACCUMULATE_call(#func)
-#endif
-#endif
-
-// used for simplifying ACCUMULATE_FUNCTIONs
-#define SET_FIRST_OR_LAST(input,first,count) if(!input) { input = (first + count); }
-#define SET_FIELD_COUNT(field,first,count) if(!field) { field = (first + count); ++count; }
-#define CHECK_MAX_COUNT(name,max,count,type) if(count > max) { error(strcat("Maximum ", type, " hit: ", #name, ": ", ftos(count), ".\n")); }
-
-#endif
diff --git a/qcsrc/lib/Bool.qh b/qcsrc/lib/Bool.qh
deleted file mode 100644 (file)
index 26169cd..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef BOOL_H
-#define BOOL_H
-
-#ifndef QCC_SUPPORT_BOOL
-    #define bool float
-
-    // Boolean Constants
-    const int true     = 1;
-    const int false = 0;
-#endif
-
-// Transitional aliases
-[[deprecated("use true")]] [[alias("true")]] const bool TRUE;
-[[deprecated("use false")]] [[alias("false")]] const bool FALSE;
-
-// get true/false value of a string with multiple different inputs
-float InterpretBoolean(string input)
-{
-    switch (strtolower(input))
-    {
-        case "yes":
-        case "true":
-        case "on":
-            return true;
-
-        case "no":
-        case "false":
-        case "off":
-            return false;
-
-        default: return stof(input);
-    }
-}
-
-float boolean(float value) { // if value is 0 return false (0), otherwise return true (1)
-    return (value == 0) ? false : true;
-}
-
-#endif
diff --git a/qcsrc/lib/Counting.qh b/qcsrc/lib/Counting.qh
deleted file mode 100644 (file)
index cd0604b..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-#ifndef COUNTING_H
-#define COUNTING_H
-
-#include "I18N.qh"
-
-// ===============================================
-//  Time processing and counting functions/macros
-// ===============================================
-
-#define count_years_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s years")), ftos_decimals(time, decs))
-#define count_years(time) count_fill(time, \
-               ZCTX(_("CI_ZER^%d years")), /* zeroth */ \
-               ZCTX(_("CI_FIR^%d year")),  /* first */ \
-               ZCTX(_("CI_SEC^%d years")), /* year */ \
-               ZCTX(_("CI_THI^%d years")), /* third */ \
-               ZCTX(_("CI_MUL^%d years"))) /* multi */
-
-#define count_weeks_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s weeks")), ftos_decimals(time, decs))
-#define count_weeks(time) count_fill(time, \
-               ZCTX(_("CI_ZER^%d weeks")), /* zeroth */ \
-               ZCTX(_("CI_FIR^%d week")),  /* first */ \
-               ZCTX(_("CI_SEC^%d weeks")), /* week */ \
-               ZCTX(_("CI_THI^%d weeks")), /* third */ \
-               ZCTX(_("CI_MUL^%d weeks"))) /* multi */
-
-#define count_days_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s days")), ftos_decimals(time, decs))
-#define count_days(time) count_fill(time, \
-               ZCTX(_("CI_ZER^%d days")), /* zeroth */ \
-               ZCTX(_("CI_FIR^%d day")),  /* first */ \
-               ZCTX(_("CI_SEC^%d days")), /* day */ \
-               ZCTX(_("CI_THI^%d days")), /* third */ \
-               ZCTX(_("CI_MUL^%d days"))) /* multi */
-
-#define count_hours_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s hours")), ftos_decimals(time, decs))
-#define count_hours(time) count_fill(time, \
-               ZCTX(_("CI_ZER^%d hours")), /* zeroth */ \
-               ZCTX(_("CI_FIR^%d hour")),  /* first */ \
-               ZCTX(_("CI_SEC^%d hours")), /* hour */ \
-               ZCTX(_("CI_THI^%d hours")), /* third */ \
-               ZCTX(_("CI_MUL^%d hours"))) /* multi */
-
-
-#define count_minutes_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s minutes")), ftos_decimals(time, decs))
-#define count_minutes(time) count_fill(time, \
-               ZCTX(_("CI_ZER^%d minutes")), /* zeroth */ \
-               ZCTX(_("CI_FIR^%d minute")),  /* first */ \
-               ZCTX(_("CI_SEC^%d minutes")), /* minute */ \
-               ZCTX(_("CI_THI^%d minutes")), /* third */ \
-               ZCTX(_("CI_MUL^%d minutes"))) /* multi */
-
-#define count_seconds_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s seconds")), ftos_decimals(time, decs))
-#define count_seconds(time) count_fill(time, \
-               ZCTX(_("CI_ZER^%d seconds")), /* zeroth */ \
-               ZCTX(_("CI_FIR^%d second")),  /* first */ \
-               ZCTX(_("CI_SEC^%d seconds")), /* second */ \
-               ZCTX(_("CI_THI^%d seconds")), /* third */ \
-               ZCTX(_("CI_MUL^%d seconds"))) /* multi */
-
-string count_ordinal(int interval)
-{
-       // This function is designed primarily for the English language, it's impossible
-       // to accomodate all languages unless we do a specific function for each one...
-       // and since that's not technically feasible/practical, this is all we've got folks.
-
-       // Basically, it just allows you to represent a number or count in different ways
-       // depending on the number... like, with count_ordinal you can provide integers
-       // and retrieve 1st, 2nd, 3rd, nth ordinal numbers in a clean and simple way.
-       if(floor((interval % 100)/10) * 10 != 10) // examples: 12th, 111th, 213th will not execute this block
-       {
-               // otherwise, check normally for 1st,2nd,3rd insertions
-               switch(interval % 10)
-               {
-                       case 1: return sprintf(_("%dst"), interval);
-                       case 2: return sprintf(_("%dnd"), interval);
-                       case 3: return sprintf(_("%drd"), interval);
-                       default: return sprintf(_("%dth"), interval);
-               }
-       }
-       else { return sprintf(_("%dth"), interval); }
-
-       return "";
-}
-
-string count_fill(float interval, string zeroth, string first, string second, string third, string multi)
-{
-       // This function is designed primarily for the English language, it's impossible
-       // to accomodate all languages unless we do a specific function for each one...
-       // and since that's not technically feasible/practical, this is all we've got folks.
-
-       // Here you can insert specific strings based on the interval number, so you could do
-       // i.e. count_seconds which outputs like this:
-       //   0 seconds
-       //   1 second
-       //   2 seconds
-       //   3 seconds
-       //   etc... minutes, hours, days, etc.
-
-       switch(floor(interval))
-       {
-               case 0: return sprintf(zeroth, interval);
-               case 1:
-               {
-                       if(interval == 1) // EXACTLY value of 1
-                               return sprintf(first, interval);
-                       else
-                               return sprintf(multi, interval);
-               }
-               case 2: return sprintf(second, interval);
-               case 3: return sprintf(third, interval);
-               default: return sprintf(multi, interval);
-       }
-       return "";
-}
-
-string process_time(float outputtype, float seconds)
-{
-       float tmp_hours = 0, tmp_minutes = 0, tmp_seconds = 0;
-       float tmp_years = 0, tmp_weeks = 0, tmp_days = 0;
-
-       tmp_seconds = floor(seconds);
-
-       if(tmp_seconds)
-       {
-               tmp_minutes = floor(tmp_seconds / 60);
-
-               if(tmp_minutes)
-               {
-                       tmp_seconds -= (tmp_minutes * 60);
-                       tmp_hours = floor(tmp_minutes / 60);
-
-                       if(tmp_hours)
-                       {
-                               tmp_minutes -= (tmp_hours * 60);
-                               tmp_days = floor(tmp_hours / 24);
-
-                               if(tmp_days)
-                               {
-                                       tmp_hours -= (tmp_days * 24);
-                                       tmp_weeks = floor(tmp_days / 7);
-
-                                       if(tmp_weeks)
-                                       {
-                                               tmp_days -= (tmp_weeks * 7);
-                                               tmp_years = floor(tmp_weeks / 52);
-                                       }
-                               }
-                       }
-               }
-       }
-
-       switch(outputtype)
-       {
-               case 1: return sprintf("%02d:%02d:%02d", tmp_hours, tmp_minutes, tmp_seconds);
-               case 2:
-               {
-                       string output = "";
-
-                       output = count_seconds(tmp_seconds);
-
-                       if(tmp_minutes)
-                       {
-                               output = sprintf(
-                                       "%s%s",
-                                       count_minutes(tmp_minutes),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
-                       }
-
-                       if(tmp_hours)
-                       {
-                               output = sprintf(
-                                       "%s%s",
-                                       count_hours(tmp_hours),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
-                       }
-
-                       if(tmp_days)
-                       {
-                               output = sprintf(
-                                       "%s%s",
-                                       count_days(tmp_days),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
-                       }
-
-                       if(tmp_weeks)
-                       {
-                               output = sprintf(
-                                       "%s%s",
-                                       count_weeks(tmp_weeks),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
-                       }
-
-                       if(tmp_years)
-                       {
-                               output = sprintf(
-                                       "%s%s",
-                                       count_years(tmp_years),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
-                       }
-
-                       return output;
-               }
-               case 3:
-               {
-                       string output = "";
-
-                       output = count_hours(tmp_hours);
-
-                       if(tmp_weeks) { tmp_days += (tmp_weeks * 7); }
-                       if(tmp_years) { tmp_days += (tmp_years * 365); }
-                       if(tmp_days)
-                       {
-                               output = sprintf(
-                                       "%s%s",
-                                       count_days(tmp_days),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
-                       }
-
-                       return output;
-               }
-       }
-       return "";
-}
-#endif
diff --git a/qcsrc/lib/Cvar.qh b/qcsrc/lib/Cvar.qh
deleted file mode 100644 (file)
index 02016a2..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef CVAR_H
-#define CVAR_H
-
-#include "Static.qh"
-
-void RegisterCvars(void(string name, string desc, bool archive, string file) f) { }
-
-void RegisterCvars_Set(string name, string desc, bool archive, string file)
-{
-    localcmd(sprintf("\n%1$s %2$s \"$%2$s\" \"%3$s\"\n", (archive ? "seta" : "set"), name, desc));
-}
-
-STATIC_INIT_LATE(Cvars) { RegisterCvars(RegisterCvars_Set); }
-
-#define AUTOCVAR_5(file, archive, var, type, desc) \
-    [[accumulate]] void RegisterCvars(void(string, string, bool, string) f) { f(#var, desc, archive, file); } \
-    type autocvar_##var
-#define AUTOCVAR_6(file, archive, var, type, default, desc) \
-    AUTOCVAR_5(file, archive, var, type, desc) = default
-#define _AUTOCVAR(...) OVERLOAD(AUTOCVAR, __FILE__, __VA_ARGS__)
-#define AUTOCVAR_SAVE(...) _AUTOCVAR(true, __VA_ARGS__)
-#define AUTOCVAR(...) _AUTOCVAR(false, __VA_ARGS__)
-
-#endif
diff --git a/qcsrc/lib/Defer.qh b/qcsrc/lib/Defer.qh
deleted file mode 100644 (file)
index ca626dd..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef MENUQC
-#ifndef DEFER_H
-#define DEFER_H
-#include "OO.qh"
-
-entityclass(Defer);
-class(Defer) .entity owner;
-class(Defer) .void() think;
-class(Defer) .float nextthink;
-
-/*
-==================
-SUB_Remove
-
-Remove self
-==================
-*/
-void SUB_Remove()
-{SELFPARAM();
-       remove (self);
-}
-
-void defer_think()
-{SELFPARAM();
-    self.think     = SUB_Remove;
-    self.nextthink = time;
-    WITH(entity, self, self.owner, self.use());
-}
-
-/*
-    Execute func() after time + fdelay.
-    self when func is executed = self when defer is called
-*/
-void defer(float fdelay, void() func)
-{SELFPARAM();
-    entity e;
-
-    e           = spawn();
-    e.owner     = self;
-    e.use       = func;
-    e.think     = defer_think;
-    e.nextthink = time + fdelay;
-}
-
-#endif
-#endif
diff --git a/qcsrc/lib/Draw.qh b/qcsrc/lib/Draw.qh
deleted file mode 100644 (file)
index 4ca5369..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-#ifdef CSQC
-#ifndef DRAW_H
-#define DRAW_H
-
-#include "I18N.qh"
-#include "Vector.qh"
-
-#include "../client/defs.qh"
-
-void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg)
-{
-       // I want to draw a quad...
-       // from and to are MIDPOINTS.
-
-       vector axis, thickdir, A, B, C, D;
-       float length_tex;
-
-       axis = normalize(to - from);
-       length_tex = aspect * vlen(to - from) / thickness;
-
-       // direction is perpendicular to the view normal, and perpendicular to the axis
-       thickdir = normalize(cross(axis, vieworg - from));
-
-       A = from - thickdir * (thickness / 2);
-       B = from + thickdir * (thickness / 2);
-       C = to + thickdir * (thickness / 2);
-       D = to - thickdir * (thickness / 2);
-
-       R_BeginPolygon(texture, drawflag);
-       R_PolygonVertex(A, '0 0 0' + shift * '1 0 0', rgb, theAlpha);
-       R_PolygonVertex(B, '0 1 0' + shift * '1 0 0', rgb, theAlpha);
-       R_PolygonVertex(C, '0 1 0' + (shift + length_tex) * '1 0 0', rgb, theAlpha);
-       R_PolygonVertex(D, '0 0 0' + (shift + length_tex) * '1 0 0', rgb, theAlpha);
-       R_EndPolygon();
-}
-
-// a border picture is a texture containing nine parts:
-//   1/4 width: left part
-//   1/2 width: middle part (stretched)
-//   1/4 width: right part
-// divided into
-//   1/4 height: top part
-//   1/2 height: middle part (stretched)
-//   1/4 height: bottom part
-void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha, vector theBorderSize)
-{
-    if (theBorderSize.x < 0 && theBorderSize.y < 0) // draw whole image as it is
-    {
-               drawpic(theOrigin, pic, theSize, theColor, theAlpha, 0);
-               return;
-    }
-       if (theBorderSize.x == 0 && theBorderSize.y == 0) // no border
-       {
-               // draw only the central part
-               drawsubpic(theOrigin, theSize, pic, '0.25 0.25 0', '0.5 0.5 0', theColor, theAlpha, 0);
-               return;
-       }
-
-       vector dX, dY;
-       vector width, height;
-       vector bW, bH;
-       //pic = draw_UseSkinFor(pic);
-       width = eX * theSize.x;
-       height = eY * theSize.y;
-       if(theSize.x <= theBorderSize.x * 2)
-       {
-               // not wide enough... draw just left and right then
-               bW = eX * (0.25 * theSize.x / (theBorderSize.x * 2));
-               if(theSize.y <= theBorderSize.y * 2)
-               {
-                       // not high enough... draw just corners
-                       bH = eY * (0.25 * theSize.y / (theBorderSize.y * 2));
-                       drawsubpic(theOrigin,                 width * 0.5 + height * 0.5, pic, '0 0 0',           bW + bH, theColor, theAlpha, 0);
-                       drawsubpic(theOrigin + width   * 0.5, width * 0.5 + height * 0.5, pic, eX - bW,           bW + bH, theColor, theAlpha, 0);
-                       drawsubpic(theOrigin + height  * 0.5, width * 0.5 + height * 0.5, pic, eY - bH,           bW + bH, theColor, theAlpha, 0);
-                       drawsubpic(theOrigin + theSize * 0.5, width * 0.5 + height * 0.5, pic, eX + eY - bW - bH, bW + bH, theColor, theAlpha, 0);
-               }
-               else
-               {
-                       dY = theBorderSize.x * eY;
-                       drawsubpic(theOrigin,                             width * 0.5          +     dY, pic, '0 0    0',           '0 0.25 0' + bW, theColor, theAlpha, 0);
-                       drawsubpic(theOrigin + width * 0.5,               width * 0.5          +     dY, pic, '0 0    0' + eX - bW, '0 0.25 0' + bW, theColor, theAlpha, 0);
-                       drawsubpic(theOrigin                        + dY, width * 0.5 + height - 2 * dY, pic, '0 0.25 0',           '0 0.5  0' + bW, theColor, theAlpha, 0);
-                       drawsubpic(theOrigin + width * 0.5          + dY, width * 0.5 + height - 2 * dY, pic, '0 0.25 0' + eX - bW, '0 0.5  0' + bW, theColor, theAlpha, 0);
-                       drawsubpic(theOrigin               + height - dY, width * 0.5          +     dY, pic, '0 0.75 0',           '0 0.25 0' + bW, theColor, theAlpha, 0);
-                       drawsubpic(theOrigin + width * 0.5 + height - dY, width * 0.5          +     dY, pic, '0 0.75 0' + eX - bW, '0 0.25 0' + bW, theColor, theAlpha, 0);
-               }
-       }
-       else
-       {
-               if(theSize.y <= theBorderSize.y * 2)
-               {
-                       // not high enough... draw just top and bottom then
-                       bH = eY * (0.25 * theSize.y / (theBorderSize.y * 2));
-                       dX = theBorderSize.x * eX;
-                       drawsubpic(theOrigin,                                         dX + height * 0.5, pic, '0    0 0',           '0.25 0 0' + bH, theColor, theAlpha, 0);
-                       drawsubpic(theOrigin + dX,                        width - 2 * dX + height * 0.5, pic, '0.25 0 0',           '0.5  0 0' + bH, theColor, theAlpha, 0);
-                       drawsubpic(theOrigin + width - dX,                            dX + height * 0.5, pic, '0.75 0 0',           '0.25 0 0' + bH, theColor, theAlpha, 0);
-                       drawsubpic(theOrigin              + height * 0.5,             dX + height * 0.5, pic, '0    0 0' + eY - bH, '0.25 0 0' + bH, theColor, theAlpha, 0);
-                       drawsubpic(theOrigin + dX         + height * 0.5, width - 2 * dX + height * 0.5, pic, '0.25 0 0' + eY - bH, '0.5  0 0' + bH, theColor, theAlpha, 0);
-                       drawsubpic(theOrigin + width - dX + height * 0.5,             dX + height * 0.5, pic, '0.75 0 0' + eY - bH, '0.25 0 0' + bH, theColor, theAlpha, 0);
-               }
-               else
-               {
-                       dX = theBorderSize.x * eX;
-                       dY = theBorderSize.x * eY;
-                       drawsubpic(theOrigin,                                        dX          +     dY, pic, '0    0    0', '0.25 0.25 0', theColor, theAlpha, 0);
-                       drawsubpic(theOrigin                  + dX,      width - 2 * dX          +     dY, pic, '0.25 0    0', '0.5  0.25 0', theColor, theAlpha, 0);
-                       drawsubpic(theOrigin          + width - dX,                  dX          +     dY, pic, '0.75 0    0', '0.25 0.25 0', theColor, theAlpha, 0);
-                       drawsubpic(theOrigin          + dY,                          dX + height - 2 * dY, pic, '0    0.25 0', '0.25 0.5  0', theColor, theAlpha, 0);
-                       drawsubpic(theOrigin          + dY         + dX, width - 2 * dX + height - 2 * dY, pic, '0.25 0.25 0', '0.5  0.5  0', theColor, theAlpha, 0);
-                       drawsubpic(theOrigin          + dY + width - dX,             dX + height - 2 * dY, pic, '0.75 0.25 0', '0.25 0.5  0', theColor, theAlpha, 0);
-                       drawsubpic(theOrigin + height - dY,                          dX          +     dY, pic, '0    0.75 0', '0.25 0.25 0', theColor, theAlpha, 0);
-                       drawsubpic(theOrigin + height - dY         + dX, width - 2 * dX          +     dY, pic, '0.25 0.75 0', '0.5  0.25 0', theColor, theAlpha, 0);
-                       drawsubpic(theOrigin + height - dY + width - dX,             dX          +     dY, pic, '0.75 0.75 0', '0.25 0.25 0', theColor, theAlpha, 0);
-               }
-       }
-}
-
-void drawstringright(vector position, string text, vector theScale, vector rgb, float theAlpha, int flag)
-{
-       position.x -= 2 / 3 * strlen(text) * theScale.x;
-       drawstring(position, text, theScale, rgb, theAlpha, flag);
-}
-
-void drawstringcenter(vector position, string text, vector theScale, vector rgb, float theAlpha, int flag)
-{
-       position.x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * theScale.x);
-       drawstring(position, text, theScale, rgb, theAlpha, flag);
-}
-
-#endif
-#endif
diff --git a/qcsrc/lib/I18N.qh b/qcsrc/lib/I18N.qh
deleted file mode 100644 (file)
index ab9aa7d..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef I18N_H
-#define I18N_H
-
-// translation helpers
-string prvm_language;
-
-string language_filename(string s)
-{
-    string fn = prvm_language;
-    if (fn == "" || fn == "dump")
-        return s;
-    fn = strcat(s, ".", fn);
-    int fh = fopen(fn, FILE_READ);
-    if (fh >= 0)
-    {
-        fclose(fh);
-        return fn;
-    }
-    return s;
-}
-
-string CTX(string s)
-{
-    int p = strstrofs(s, "^", 0);
-    if (p < 0)
-        return s;
-    return substring(s, p + 1, -1);
-}
-
-#define ZCTX(s) strzone(CTX(s))
-
-#endif
diff --git a/qcsrc/lib/Lazy.qh b/qcsrc/lib/Lazy.qh
deleted file mode 100644 (file)
index fcf0651..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef LAZY_H
-#define LAZY_H
-
-#include "OO.qh"
-
-CLASS(Lazy, Object)
-    ATTRIB(Lazy, m_get, entity(), func_null);
-    CONSTRUCTOR(Lazy, entity() _compute) { this.m_get = _compute; }
-ENDCLASS(Lazy)
-
-#define LAZY(id) __lazy_##id
-#define LAZY_NEW(id, compute) entity LAZY(id)() { \
-    static bool done; \
-    static entity it; \
-    if (!done) { it = compute; done = true; } \
-    return it; \
-}
-#endif
diff --git a/qcsrc/lib/Log.qh b/qcsrc/lib/Log.qh
deleted file mode 100644 (file)
index f74dd4a..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef LOG_H
-#define LOG_H
-
-#define _printferr(...)     error(sprintf(__VA_ARGS__))
-#define _printfbt(...)      backtrace(sprintf(__VA_ARGS__))
-#define printf(...)         print(sprintf(__VA_ARGS__))
-#define dprintf(...)        dprint(sprintf(__VA_ARGS__))
-#define _dprintf2(...)      do { if (autocvar_developer > 1) dprintf(__VA_ARGS__); } while (0)
-
-#define assert(expr, ...)   do { if (!(expr)) LOG_WARNINGF(__VA_ARGS__); } while (0)
-
-#define _LOG(f, level, s)   f("[::"level"] ["__FILE__":%s:%.0f] %s", __FUNC__, __LINE__, s)
-
-#define  LOG_FATAL(...)     _LOG_FATAL(strcat("", __VA_ARGS__))
-#define  LOG_FATALF(...)    _LOG_FATAL(sprintf(__VA_ARGS__))
-#define _LOG_FATAL(s)       _LOG(_printferr, "FATAL", s)
-
-#define  LOG_SEVERE(...)    _LOG_SEVERE(strcat("", __VA_ARGS__))
-#define  LOG_SEVEREF(...)   _LOG_SEVERE(sprintf(__VA_ARGS__))
-#define _LOG_SEVERE(s)      _LOG(_printfbt, "SEVERE", s)
-
-#define  LOG_WARNING(...)   _LOG_WARNING(strcat("", __VA_ARGS__))
-#define  LOG_WARNINGF(...)  _LOG_WARNING(sprintf(__VA_ARGS__))
-#define _LOG_WARNING(s)     _LOG(printf, "WARNING", s)
-
-#define  LOG_INFO(...)      do { if (autocvar_developer) _LOG_INFO(strcat("", __VA_ARGS__)); else print (__VA_ARGS__); } while (0)
-#define  LOG_INFOF(...)     do { if (autocvar_developer) _LOG_INFO(sprintf(__VA_ARGS__));    else printf(__VA_ARGS__); } while (0)
-#define _LOG_INFO(s)        _LOG(printf, "INFO", s)
-
-#define  LOG_TRACE(...)     _LOG_TRACE(strcat("", __VA_ARGS__))
-#define  LOG_TRACEF(...)    _LOG_TRACE(sprintf(__VA_ARGS__))
-#define _LOG_TRACE(s)       _LOG(dprintf, "TRACE", s)
-
-#define  LOG_DEBUG(...)     _LOG_DEBUG(strcat("", __VA_ARGS__))
-#define  LOG_DEBUGF(...)    _LOG_DEBUG(sprintf(__VA_ARGS__))
-#define _LOG_DEBUG(s)       _LOG(_dprintf2, "DEBUG", s)
-
-// TODO: this sucks, lets find a better way to do backtraces?
-#ifdef SVQC
-void builtin_remove(entity);
-#define _backtrace() builtin_remove(NULL)
-#else
-void remove(entity);
-#define _backtrace() remove(NULL)
-#endif
-
-noref int autocvar_developer;
-noref bool autocvar_prvm_backtraceforwarnings;
-
-#define backtrace(msg) do { \
-    int dev = autocvar_developer; \
-    bool war = autocvar_prvm_backtraceforwarnings; \
-    cvar_set("developer", "1"); \
-    cvar_set("prvm_backtraceforwarnings", "1"); \
-    print("\n--- CUT HERE ---\n", msg, "\n"); \
-    _backtrace(); \
-    print("\n--- CUT UNTIL HERE ---\n"); \
-    cvar_set("developer", ftos(dev)); \
-    cvar_set("prvm_backtraceforwarnings", ftos(war)); \
-} while (0)
-
-#endif
diff --git a/qcsrc/lib/Math.qh b/qcsrc/lib/Math.qh
deleted file mode 100644 (file)
index a8a5290..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-#ifndef MATH_H
-#define MATH_H
-
-void mean_accumulate(entity e, .float a, .float c, float mean, float value, float weight)
-{
-       if (weight == 0)
-               return;
-       if (mean == 0)
-               e.(a) *= pow(value, weight);
-       else
-               e.(a) += pow(value, mean) * weight;
-       e.(c) += weight;
-}
-
-float mean_evaluate(entity e, .float a, .float c, float mean)
-{
-       if (e.(c) == 0)
-               return 0;
-       if (mean == 0)
-               return pow(e.(a), 1.0 / e.(c));
-       else
-               return pow(e.(a) / e.(c), 1.0 / mean);
-}
-
-#define MEAN_ACCUMULATE(prefix,v,w) mean_accumulate(self,prefix##_accumulator,prefix##_count,prefix##_mean,v,w)
-#define MEAN_EVALUATE(prefix) mean_evaluate(self,prefix##_accumulator,prefix##_count,prefix##_mean)
-#define MEAN_DECLARE(prefix,m) float prefix##_mean = m; .float prefix##_count, prefix##_accumulator
-
-/*
-==================
-crandom
-
-Returns a random number between -1.0 and 1.0
-==================
-*/
-float crandom (void)
-{
-       return 2 * (random () - 0.5);
-}
-
-
-/*
-==================
-Angc used for animations
-==================
-*/
-
-
-float angc (float a1, float a2)
-{
-       float   a;
-
-       while (a1 > 180)
-               a1 = a1 - 360;
-       while (a1 < -179)
-               a1 = a1 + 360;
-
-       while (a2 > 180)
-               a2 = a2 - 360;
-       while (a2 < -179)
-               a2 = a2 + 360;
-
-       a = a1 - a2;
-       while (a > 180)
-               a = a - 360;
-       while (a < -179)
-               a = a + 360;
-
-       return a;
-}
-
-float fsnap(float val,float fsize)
-{
-    return rint(val / fsize) * fsize;
-}
-
-vector vsnap(vector point,float fsize)
-{
-    vector vret;
-
-    vret.x = rint(point.x / fsize) * fsize;
-    vret.y = rint(point.y / fsize) * fsize;
-    vret.z = ceil(point.z / fsize) * fsize;
-
-    return vret;
-}
-
-vector lerpv(float t0, vector v0, float t1, vector v1, float t)
-{
-       return v0 + (v1 - v0) * ((t - t0) / (t1 - t0));
-}
-
-#endif
diff --git a/qcsrc/lib/Nil.qh b/qcsrc/lib/Nil.qh
deleted file mode 100644 (file)
index 87e3aea..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef NIL_H
-#define NIL_H
-
-#ifdef QCC_SUPPORT_NIL
-#define func_null nil
-#define string_null nil
-#else
-// the NULL function
-var void func_null(void);
-string string_null;
-#endif
-
-#endif
diff --git a/qcsrc/lib/OO.qh b/qcsrc/lib/OO.qh
deleted file mode 100644 (file)
index 63a70f7..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-#ifndef OO_H
-#define OO_H
-
-#include "Nil.qh"
-#include "Registry.qh"
-
-#ifdef MENUQC
-    #define NULL (null_entity)
-#else
-    #define NULL (world)
-#endif
-
-.string classname;
-/** Location entity was spawned from in source */
-.string sourceLocFile;
-.int sourceLocLine;
-entity _spawn();
-entity __spawn(string _classname, string _sourceFile, int _sourceLine) {
-    entity this = _spawn();
-    this.classname = _classname;
-    this.sourceLocFile = _sourceFile;
-    this.sourceLocLine = _sourceLine;
-    return this;
-}
-
-
-
-#define entityclass(...) OVERLOAD(entityclass, __VA_ARGS__)
-#define entityclass_1(name) entityclass_2(name, Object)
-#ifndef QCC_SUPPORT_ENTITYCLASS
-    #define entityclass_2(name, base) typedef entity name
-    #define class(name)
-    #define new(class) __spawn(#class, __FILE__, __LINE__)
-#else
-    #define entityclass_2(name, base) entityclass name : base {}
-    #define class(name) [[class(name)]]
-    #define new(class) ((class) __spawn(#class, __FILE__, __LINE__))
-#endif
-
-// Classes have a `spawn##cname(entity)` constructor
-// The parameter is used across [[accumulate]] functions
-
-// Macro to hide this implementation detail
-#define NEW(cname, ...) \
-    OVERLOAD(spawn##cname, new(cname), ##__VA_ARGS__)
-
-#define CONSTRUCT(cname, ...) \
-    OVERLOAD(spawn##cname, this, ##__VA_ARGS__)
-
-#define CONSTRUCTOR(cname, ...) \
-    cname OVERLOAD(spawn##cname, cname this, __VA_ARGS__) { return = this; } \
-    [[accumulate]] cname OVERLOAD(spawn##cname, cname this, __VA_ARGS__)
-
-.string vtblname;
-.entity vtblbase;
-
-void RegisterClasses() { }
-STATIC_INIT(RegisterClasses) { RegisterClasses(); }
-
-#define VTBL(cname, base) \
-    INIT_STATIC(cname); \
-    entity cname##_vtbl; \
-    void cname##_vtbl_init() { \
-        cname e = new(vtbl); \
-        spawn##cname##_static(e); \
-        e.vtblname = #cname; \
-        /* Top level objects refer to themselves */ \
-        e.vtblbase = base##_vtbl ? base##_vtbl : e; \
-        cname##_vtbl = e; \
-    } \
-    ACCUMULATE_FUNCTION(RegisterClasses, cname##_vtbl_init)
-
-#define INIT_STATIC(cname) [[accumulate]] void spawn##cname##_static(cname this)
-#define INIT(cname) [[accumulate]] cname spawn##cname##_1(cname this)
-
-#define CLASS(cname, base)                  \
-    entityclass(cname, base);               \
-    class(cname) .bool instanceOf##cname;   \
-    VTBL(cname, base)                       \
-    INIT_STATIC(cname) {                    \
-        if (cname##_vtbl) {                 \
-            copyentity(cname##_vtbl, this); \
-            return;                         \
-        }                                   \
-        spawn##base##_static(this);         \
-        this.instanceOf##cname = true;      \
-    }                                       \
-    INIT(cname) {                           \
-        /* Only statically initialize the current class, it contains everything it inherits */ \
-        if (cname##_vtbl.vtblname == this.classname) { \
-            spawn##cname##_static(this);    \
-            this.classname = #cname;        \
-            this.vtblname = string_null;    \
-            this.vtblbase = cname##_vtbl;   \
-        }                                   \
-        spawn##base##_1(this);              \
-    }
-
-#define METHOD(cname, name, prototype)      \
-    class(cname) .prototype name;           \
-    prototype cname##_##name;               \
-    INIT_STATIC(cname) { this.name = cname##_##name; } \
-    prototype cname##_##name
-
-#define ATTRIB(cname, name, type, val)      \
-    class(cname) .type name;                \
-    INIT(cname) { this.name = val; }
-
-#define ATTRIBARRAY(cname, name, type, cnt) \
-    class(cname) .type name[cnt];
-
-#define ENDCLASS(cname) \
-    [[last]] INIT(cname) { return this; }
-
-#define SUPER(cname) (cname##_vtbl.vtblbase)
-#define super (this.vtblbase.vtblbase)
-
-#define spawn_static(this)
-#define spawn_1(this)
-#define _vtbl NULL
-CLASS(Object, );
-    METHOD(Object, describe, string(entity this)) {
-        string s = _("No description");
-        if (cvar("developer")) {
-            for (int i = 0, n = numentityfields(); i < n; ++i) {
-                string value = getentityfieldstring(i, this);
-                if (value != "") s = sprintf("%s\n%s = %s", s, entityfieldname(i), value);
-            }
-        }
-        return s;
-    }
-    METHOD(Object, display, void(entity this, void(string name, string icon) returns)) {
-        returns(sprintf("entity %i", this), "nopreview_map");
-    }
-ENDCLASS(Object)
-#undef spawn_static
-#undef spawn_1
-#undef _vtbl
-
-#endif
diff --git a/qcsrc/lib/Player.qh b/qcsrc/lib/Player.qh
deleted file mode 100644 (file)
index 07034a0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifdef CSQC
-#ifndef PLAYER_H
-#define PLAYER_H
-
-#include "String.qh"
-
-#include "../client/main.qh"
-#include "../common/teams.qh"
-
-int GetPlayerColorForce(int i)
-{
-       if(!teamplay)
-               return 0;
-       else
-               return stof(getplayerkeyvalue(i, "colors")) & 15;
-}
-
-int GetPlayerColor(int i)
-{
-       if(!playerslots[i].gotscores) // unconnected
-               return NUM_SPECTATOR;
-       else if(stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR)
-               return NUM_SPECTATOR;
-       else
-               return GetPlayerColorForce(i);
-}
-
-string GetPlayerName(int i)
-{
-       return ColorTranslateRGB(getplayerkeyvalue(i, "name"));
-}
-
-#endif
-#endif
diff --git a/qcsrc/lib/Progname.qh b/qcsrc/lib/Progname.qh
deleted file mode 100644 (file)
index ed112a5..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef PROGNAME_H
-#define PROGNAME_H
-
-#if defined(MENUQC)
-    #define PROGNAME "MENUQC"
-#elif defined(SVQC)
-    #define PROGNAME "SVQC"
-#elif defined(CSQC)
-    #define PROGNAME "CSQC"
-#else
-    #error "Unable to detect PROGNAME"
-#endif
-
-#endif
diff --git a/qcsrc/lib/Registry.qh b/qcsrc/lib/Registry.qh
deleted file mode 100644 (file)
index ca0beae..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef REGISTRY_H
-#define REGISTRY_H
-
-#include "OO.qh"
-
-#define REGISTER_INIT(ns, id) [[accumulate]] void Register_##ns##_##id##_init(entity this)
-#define REGISTER_INIT_POST(ns, id) [[accumulate]] void Register_##ns##_##id##_init_post(entity this)
-
-#define REGISTER(initfunc, ns, array, counter, id, fld, inst)   \
-    entity ns##_##id;                                           \
-    REGISTER_INIT(ns, id) { }                                   \
-    REGISTER_INIT_POST(ns, id) { }                              \
-    .entity enemy; /* internal next pointer */                  \
-    void Register_##ns##_##id() {                               \
-        entity this = inst;                                     \
-        ns##_##id = this;                                       \
-        this.fld = counter;                                     \
-        array[counter++] = this;                                \
-        if (!array##_first)    array##_first = this;            \
-        if ( array##_last)     array##_last.enemy = this;       \
-        array##_last = this;                                    \
-        Register_##ns##_##id##_init(this);                      \
-        Register_##ns##_##id##_init_post(this);                 \
-    }                                                           \
-    ACCUMULATE_FUNCTION(initfunc, Register_##ns##_##id)         \
-    REGISTER_INIT(ns, id)
-
-#endif
diff --git a/qcsrc/lib/Static.qh b/qcsrc/lib/Static.qh
deleted file mode 100644 (file)
index d51a871..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef STATIC_H
-#define STATIC_H
-
-void __static_init_early() { }
-void __static_init() { CALL_ACCUMULATED_FUNCTION(__static_init_early); }
-#define static_init() CALL_ACCUMULATED_FUNCTION(__static_init)
-#define REGISTER_REGISTRY(func) ACCUMULATE_FUNCTION(__static_init_early, func)
-
-#define _STATIC_INIT(where, func) \
-    void _static_##func(); \
-    ACCUMULATE_FUNCTION(where, _static_##func) \
-    void _static_##func()
-
-#define STATIC_INIT(func)       _STATIC_INIT(__static_init_early,   func##_early)
-#define STATIC_INIT_LATE(func)  _STATIC_INIT(__static_init,         func)
-
-#endif
diff --git a/qcsrc/lib/String.qh b/qcsrc/lib/String.qh
deleted file mode 100644 (file)
index faf81b2..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef STRING_H
-#define STRING_H
-
-#ifndef SVQC
-float stringwidth_colors(string s, vector theSize)
-{
-       return stringwidth(s, true, theSize);
-}
-
-float stringwidth_nocolors(string s, vector theSize)
-{
-       return stringwidth(s, false, theSize);
-}
-#endif
-
-// Timer (#5)
-//
-// TODO: macro
-string seconds_tostring(float sec)
-{
-       float minutes;
-       minutes = floor(sec / 60);
-
-       sec -= minutes * 60;
-       return sprintf("%d:%02d", minutes, sec);
-}
-
-int ColorTranslateMode;
-
-string ColorTranslateRGB(string s)
-{
-       if(ColorTranslateMode & 1)
-               return strdecolorize(s);
-       else
-               return s;
-}
-
-#endif
diff --git a/qcsrc/lib/Struct.qh b/qcsrc/lib/Struct.qh
deleted file mode 100644 (file)
index 507c417..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef STRUCT_H
-#define STRUCT_H
-
-#ifndef QCC_SUPPORT_STRUCT
-    #define _STRUCT_DECLARE(x, id, type, END) noref type x ##_## id ;
-    #define STRUCT_DECLARE(id, s) s(_STRUCT_DECLARE, id)
-
-    #define _STRUCT_PARAM_(x, id, type) type x ##_## id ,
-    #define _STRUCT_PARAM_END(x, id, type) type x ##_## id
-    #define _STRUCT_PARAM(x, id, type, isend) _STRUCT_PARAM_##isend(x, id, type)
-    #define STRUCT_PARAM(id, s) s(_STRUCT_PARAM, id)
-
-    #define _STRUCT_PASS_(x, id, type) x ##_## id ,
-    #define _STRUCT_PASS_END(x, id, type) x ##_## id
-    #define _STRUCT_PASS(x, id, type, END) _STRUCT_PASS_##END(x, id, type)
-    #define STRUCT_PASS(id, s) s(_STRUCT_PASS, id)
-
-    #define _STRUCT_STORE_DST(_, it) it
-    #define _STRUCT_STORE_SRC(it, _) it
-    #define _CONCAT3_(a, b, c) a ## b ## c
-    #define _CONCAT3(a, b, c) _CONCAT3_(a, b, c)
-    #define _STRUCT_STORE(x, id, type, END) _CONCAT3(_STRUCT_STORE_DST x, _, id) = _CONCAT3(_STRUCT_STORE_SRC x, _, id);
-    #define STRUCT_STORE(from, to, s) s(_STRUCT_STORE, (from, to))
-
-    #define STRUCT(id, ...)
-#else
-    #define STRUCT_DECLARE(id, type) type id;
-    #define STRUCT_PARAM(id, type) type id
-    #define STRUCT_PASS(id, type) id
-    #define STRUCT_STORE(from, to, s) to = from
-    #define _STRUCT_MEMBER(my, id, type, END) type id;
-    #define STRUCT(id, s) struct STRUCT_##id { s(_STRUCT_MEMBER, ) };
-#endif
-
-#endif
diff --git a/qcsrc/lib/Vector.qh b/qcsrc/lib/Vector.qh
deleted file mode 100644 (file)
index d81a795..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef VECTOR_H
-#define VECTOR_H
-
-const vector eX = '1 0 0';
-const vector eY = '0 1 0';
-const vector eZ = '0 0 1';
-
-vector randompos(vector m1, vector m2)
-{
-       vector v;
-       m2 = m2 - m1;
-       v_x = m2_x * random() + m1_x;
-       v_y = m2_y * random() + m1_y;
-       v_z = m2_z * random() + m1_z;
-       return  v;
-}
-
-float vlen2d(vector v)
-{
-       return sqrt(v.x * v.x + v.y * v.y);
-}
-
-float vlen_maxnorm2d(vector v)
-{
-       return max(v.x, v.y, -v.x, -v.y);
-}
-
-float vlen_minnorm2d(vector v)
-{
-       return min(max(v.x, -v.x), max(v.y, -v.y));
-}
-
-
-#endif
index 1b7e61e9aa4cb125fd5e20f3b02e4420ee4cb78f..aa541bd69e28204a0c0c074a3c298ace20fcd38c 100644 (file)
@@ -1,28 +1,28 @@
-#include "Bool.qh"
+#include "bool.qh"
 
 #include "../warpzonelib/mathlib.qc"
 
-#include "Accumulate.qh"
-#include "Counting.qh"
-#include "Cvar.qh"
-#include "Defer.qh"
-#include "Draw.qh"
-#include "I18N.qh"
-#include "Lazy.qh"
-#include "Log.qh"
-#include "Math.qh"
-#include "Nil.qh"
+#include "accumulate.qh"
+#include "counting.qh"
+#include "cvar.qh"
+#include "defer.qh"
+#include "draw.qh"
+#include "i18n.qh"
+#include "lazy.qh"
+#include "log.qh"
+#include "math.qh"
+#include "nil.qh"
 #include "noise.qc"
-#include "OO.qh"
+#include "oo.qh"
 #include "p2mathlib.qc"
-#include "Player.qh"
+#include "player.qh"
 #include "prandom.qc"
-#include "Progname.qh"
-#include "Registry.qh"
+#include "progname.qh"
+#include "registry.qh"
 #include "sortlist.qc"
-#include "Static.qh"
-#include "String.qh"
-#include "Struct.qh"
+#include "static.qh"
+#include "string.qh"
+#include "struct.qh"
 #include "test.qc"
 #include "urllib.qc"
-#include "Vector.qh"
+#include "vector.qh"
diff --git a/qcsrc/lib/accumulate.qh b/qcsrc/lib/accumulate.qh
new file mode 100644 (file)
index 0000000..7e1a1ed
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef ACCUMULATE_H
+#define ACCUMULATE_H
+
+#ifdef QCC_SUPPORT_ACCUMULATE
+# define ACCUMULATE_FUNCTION(func, otherfunc) \
+    [[accumulate]] void func() { otherfunc(); }
+# define CALL_ACCUMULATED_FUNCTION(func) \
+    func()
+#else
+#ifdef HAVE_YO_DAWG_CPP
+// TODO make ascii art pic of xzibit
+// YO DAWG!
+// I HERD YO LIEK MACROS
+// SO I PUT A MACRO DEFINITION IN YO MACRO DEFINITION
+// SO YO CAN EXPAND MACROS WHILE YO EXPAND MACROS
+# define ACCUMULATE_FUNCTION(func,otherfunc) \
+    #ifdef func \
+    void __merge__##otherfunc() { func(); otherfunc(); } \
+    #undef func \
+    #define func __merge__##otherfunc \
+    #else \
+    #define func otherfunc \
+    #endif
+# define CALL_ACCUMULATED_FUNCTION(func) \
+    func()
+#else
+# define ACCUMULATE_FUNCTION(func,otherfunc) \
+    .float _ACCUMULATE_##func##__##otherfunc;
+void ACCUMULATE_call(string func)
+{
+    float i;
+    float n = numentityfields();
+    string funcprefix = strcat("_ACCUMULATE_", func, "__");
+    float funcprefixlen = strlen(funcprefix);
+    for(i = 0; i < n; ++i)
+    {
+        string name = entityfieldname(i);
+        if(substring(name, 0, funcprefixlen) == funcprefix)
+            callfunction(substring(name, funcprefixlen, -1));
+    }
+}
+# define CALL_ACCUMULATED_FUNCTION(func) \
+    ACCUMULATE_call(#func)
+#endif
+#endif
+
+// used for simplifying ACCUMULATE_FUNCTIONs
+#define SET_FIRST_OR_LAST(input,first,count) if(!input) { input = (first + count); }
+#define SET_FIELD_COUNT(field,first,count) if(!field) { field = (first + count); ++count; }
+#define CHECK_MAX_COUNT(name,max,count,type) if(count > max) { error(strcat("Maximum ", type, " hit: ", #name, ": ", ftos(count), ".\n")); }
+
+#endif
diff --git a/qcsrc/lib/bool.qh b/qcsrc/lib/bool.qh
new file mode 100644 (file)
index 0000000..26169cd
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef BOOL_H
+#define BOOL_H
+
+#ifndef QCC_SUPPORT_BOOL
+    #define bool float
+
+    // Boolean Constants
+    const int true     = 1;
+    const int false = 0;
+#endif
+
+// Transitional aliases
+[[deprecated("use true")]] [[alias("true")]] const bool TRUE;
+[[deprecated("use false")]] [[alias("false")]] const bool FALSE;
+
+// get true/false value of a string with multiple different inputs
+float InterpretBoolean(string input)
+{
+    switch (strtolower(input))
+    {
+        case "yes":
+        case "true":
+        case "on":
+            return true;
+
+        case "no":
+        case "false":
+        case "off":
+            return false;
+
+        default: return stof(input);
+    }
+}
+
+float boolean(float value) { // if value is 0 return false (0), otherwise return true (1)
+    return (value == 0) ? false : true;
+}
+
+#endif
diff --git a/qcsrc/lib/counting.qh b/qcsrc/lib/counting.qh
new file mode 100644 (file)
index 0000000..81103a5
--- /dev/null
@@ -0,0 +1,223 @@
+#ifndef COUNTING_H
+#define COUNTING_H
+
+#include "i18n.qh"
+
+// ===============================================
+//  Time processing and counting functions/macros
+// ===============================================
+
+#define count_years_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s years")), ftos_decimals(time, decs))
+#define count_years(time) count_fill(time, \
+               ZCTX(_("CI_ZER^%d years")), /* zeroth */ \
+               ZCTX(_("CI_FIR^%d year")),  /* first */ \
+               ZCTX(_("CI_SEC^%d years")), /* year */ \
+               ZCTX(_("CI_THI^%d years")), /* third */ \
+               ZCTX(_("CI_MUL^%d years"))) /* multi */
+
+#define count_weeks_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s weeks")), ftos_decimals(time, decs))
+#define count_weeks(time) count_fill(time, \
+               ZCTX(_("CI_ZER^%d weeks")), /* zeroth */ \
+               ZCTX(_("CI_FIR^%d week")),  /* first */ \
+               ZCTX(_("CI_SEC^%d weeks")), /* week */ \
+               ZCTX(_("CI_THI^%d weeks")), /* third */ \
+               ZCTX(_("CI_MUL^%d weeks"))) /* multi */
+
+#define count_days_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s days")), ftos_decimals(time, decs))
+#define count_days(time) count_fill(time, \
+               ZCTX(_("CI_ZER^%d days")), /* zeroth */ \
+               ZCTX(_("CI_FIR^%d day")),  /* first */ \
+               ZCTX(_("CI_SEC^%d days")), /* day */ \
+               ZCTX(_("CI_THI^%d days")), /* third */ \
+               ZCTX(_("CI_MUL^%d days"))) /* multi */
+
+#define count_hours_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s hours")), ftos_decimals(time, decs))
+#define count_hours(time) count_fill(time, \
+               ZCTX(_("CI_ZER^%d hours")), /* zeroth */ \
+               ZCTX(_("CI_FIR^%d hour")),  /* first */ \
+               ZCTX(_("CI_SEC^%d hours")), /* hour */ \
+               ZCTX(_("CI_THI^%d hours")), /* third */ \
+               ZCTX(_("CI_MUL^%d hours"))) /* multi */
+
+
+#define count_minutes_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s minutes")), ftos_decimals(time, decs))
+#define count_minutes(time) count_fill(time, \
+               ZCTX(_("CI_ZER^%d minutes")), /* zeroth */ \
+               ZCTX(_("CI_FIR^%d minute")),  /* first */ \
+               ZCTX(_("CI_SEC^%d minutes")), /* minute */ \
+               ZCTX(_("CI_THI^%d minutes")), /* third */ \
+               ZCTX(_("CI_MUL^%d minutes"))) /* multi */
+
+#define count_seconds_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s seconds")), ftos_decimals(time, decs))
+#define count_seconds(time) count_fill(time, \
+               ZCTX(_("CI_ZER^%d seconds")), /* zeroth */ \
+               ZCTX(_("CI_FIR^%d second")),  /* first */ \
+               ZCTX(_("CI_SEC^%d seconds")), /* second */ \
+               ZCTX(_("CI_THI^%d seconds")), /* third */ \
+               ZCTX(_("CI_MUL^%d seconds"))) /* multi */
+
+string count_ordinal(int interval)
+{
+       // This function is designed primarily for the English language, it's impossible
+       // to accomodate all languages unless we do a specific function for each one...
+       // and since that's not technically feasible/practical, this is all we've got folks.
+
+       // Basically, it just allows you to represent a number or count in different ways
+       // depending on the number... like, with count_ordinal you can provide integers
+       // and retrieve 1st, 2nd, 3rd, nth ordinal numbers in a clean and simple way.
+       if(floor((interval % 100)/10) * 10 != 10) // examples: 12th, 111th, 213th will not execute this block
+       {
+               // otherwise, check normally for 1st,2nd,3rd insertions
+               switch(interval % 10)
+               {
+                       case 1: return sprintf(_("%dst"), interval);
+                       case 2: return sprintf(_("%dnd"), interval);
+                       case 3: return sprintf(_("%drd"), interval);
+                       default: return sprintf(_("%dth"), interval);
+               }
+       }
+       else { return sprintf(_("%dth"), interval); }
+
+       return "";
+}
+
+string count_fill(float interval, string zeroth, string first, string second, string third, string multi)
+{
+       // This function is designed primarily for the English language, it's impossible
+       // to accomodate all languages unless we do a specific function for each one...
+       // and since that's not technically feasible/practical, this is all we've got folks.
+
+       // Here you can insert specific strings based on the interval number, so you could do
+       // i.e. count_seconds which outputs like this:
+       //   0 seconds
+       //   1 second
+       //   2 seconds
+       //   3 seconds
+       //   etc... minutes, hours, days, etc.
+
+       switch(floor(interval))
+       {
+               case 0: return sprintf(zeroth, interval);
+               case 1:
+               {
+                       if(interval == 1) // EXACTLY value of 1
+                               return sprintf(first, interval);
+                       else
+                               return sprintf(multi, interval);
+               }
+               case 2: return sprintf(second, interval);
+               case 3: return sprintf(third, interval);
+               default: return sprintf(multi, interval);
+       }
+       return "";
+}
+
+string process_time(float outputtype, float seconds)
+{
+       float tmp_hours = 0, tmp_minutes = 0, tmp_seconds = 0;
+       float tmp_years = 0, tmp_weeks = 0, tmp_days = 0;
+
+       tmp_seconds = floor(seconds);
+
+       if(tmp_seconds)
+       {
+               tmp_minutes = floor(tmp_seconds / 60);
+
+               if(tmp_minutes)
+               {
+                       tmp_seconds -= (tmp_minutes * 60);
+                       tmp_hours = floor(tmp_minutes / 60);
+
+                       if(tmp_hours)
+                       {
+                               tmp_minutes -= (tmp_hours * 60);
+                               tmp_days = floor(tmp_hours / 24);
+
+                               if(tmp_days)
+                               {
+                                       tmp_hours -= (tmp_days * 24);
+                                       tmp_weeks = floor(tmp_days / 7);
+
+                                       if(tmp_weeks)
+                                       {
+                                               tmp_days -= (tmp_weeks * 7);
+                                               tmp_years = floor(tmp_weeks / 52);
+                                       }
+                               }
+                       }
+               }
+       }
+
+       switch(outputtype)
+       {
+               case 1: return sprintf("%02d:%02d:%02d", tmp_hours, tmp_minutes, tmp_seconds);
+               case 2:
+               {
+                       string output = "";
+
+                       output = count_seconds(tmp_seconds);
+
+                       if(tmp_minutes)
+                       {
+                               output = sprintf(
+                                       "%s%s",
+                                       count_minutes(tmp_minutes),
+                                       ((output != "") ? sprintf(", %s", output) : ""));
+                       }
+
+                       if(tmp_hours)
+                       {
+                               output = sprintf(
+                                       "%s%s",
+                                       count_hours(tmp_hours),
+                                       ((output != "") ? sprintf(", %s", output) : ""));
+                       }
+
+                       if(tmp_days)
+                       {
+                               output = sprintf(
+                                       "%s%s",
+                                       count_days(tmp_days),
+                                       ((output != "") ? sprintf(", %s", output) : ""));
+                       }
+
+                       if(tmp_weeks)
+                       {
+                               output = sprintf(
+                                       "%s%s",
+                                       count_weeks(tmp_weeks),
+                                       ((output != "") ? sprintf(", %s", output) : ""));
+                       }
+
+                       if(tmp_years)
+                       {
+                               output = sprintf(
+                                       "%s%s",
+                                       count_years(tmp_years),
+                                       ((output != "") ? sprintf(", %s", output) : ""));
+                       }
+
+                       return output;
+               }
+               case 3:
+               {
+                       string output = "";
+
+                       output = count_hours(tmp_hours);
+
+                       if(tmp_weeks) { tmp_days += (tmp_weeks * 7); }
+                       if(tmp_years) { tmp_days += (tmp_years * 365); }
+                       if(tmp_days)
+                       {
+                               output = sprintf(
+                                       "%s%s",
+                                       count_days(tmp_days),
+                                       ((output != "") ? sprintf(", %s", output) : ""));
+                       }
+
+                       return output;
+               }
+       }
+       return "";
+}
+#endif
diff --git a/qcsrc/lib/cvar.qh b/qcsrc/lib/cvar.qh
new file mode 100644 (file)
index 0000000..1da1f27
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef CVAR_H
+#define CVAR_H
+
+#include "static.qh"
+
+void RegisterCvars(void(string name, string desc, bool archive, string file) f) { }
+
+void RegisterCvars_Set(string name, string desc, bool archive, string file)
+{
+    localcmd(sprintf("\n%1$s %2$s \"$%2$s\" \"%3$s\"\n", (archive ? "seta" : "set"), name, desc));
+}
+
+STATIC_INIT_LATE(Cvars) { RegisterCvars(RegisterCvars_Set); }
+
+#define AUTOCVAR_5(file, archive, var, type, desc) \
+    [[accumulate]] void RegisterCvars(void(string, string, bool, string) f) { f(#var, desc, archive, file); } \
+    type autocvar_##var
+#define AUTOCVAR_6(file, archive, var, type, default, desc) \
+    AUTOCVAR_5(file, archive, var, type, desc) = default
+#define _AUTOCVAR(...) EVAL(OVERLOAD(AUTOCVAR, __FILE__, __VA_ARGS__))
+#define AUTOCVAR_SAVE(...) _AUTOCVAR(true, __VA_ARGS__)
+#define AUTOCVAR(...) _AUTOCVAR(false, __VA_ARGS__)
+
+#endif
diff --git a/qcsrc/lib/defer.qh b/qcsrc/lib/defer.qh
new file mode 100644 (file)
index 0000000..2a13611
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef MENUQC
+#ifndef DEFER_H
+#define DEFER_H
+#include "oo.qh"
+
+entityclass(Defer);
+class(Defer) .entity owner;
+class(Defer) .void() think;
+class(Defer) .float nextthink;
+
+/*
+==================
+SUB_Remove
+
+Remove self
+==================
+*/
+void SUB_Remove()
+{SELFPARAM();
+       remove (self);
+}
+
+void defer_think()
+{SELFPARAM();
+    self.think     = SUB_Remove;
+    self.nextthink = time;
+    WITH(entity, self, self.owner, self.use());
+}
+
+/*
+    Execute func() after time + fdelay.
+    self when func is executed = self when defer is called
+*/
+void defer(float fdelay, void() func)
+{SELFPARAM();
+    entity e;
+
+    e           = spawn();
+    e.owner     = self;
+    e.use       = func;
+    e.think     = defer_think;
+    e.nextthink = time + fdelay;
+}
+
+#endif
+#endif
diff --git a/qcsrc/lib/draw.qh b/qcsrc/lib/draw.qh
new file mode 100644 (file)
index 0000000..90abcb2
--- /dev/null
@@ -0,0 +1,133 @@
+#ifdef CSQC
+#ifndef DRAW_H
+#define DRAW_H
+
+#include "i18n.qh"
+#include "vector.qh"
+
+#include "../client/defs.qh"
+
+void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg)
+{
+       // I want to draw a quad...
+       // from and to are MIDPOINTS.
+
+       vector axis, thickdir, A, B, C, D;
+       float length_tex;
+
+       axis = normalize(to - from);
+       length_tex = aspect * vlen(to - from) / thickness;
+
+       // direction is perpendicular to the view normal, and perpendicular to the axis
+       thickdir = normalize(cross(axis, vieworg - from));
+
+       A = from - thickdir * (thickness / 2);
+       B = from + thickdir * (thickness / 2);
+       C = to + thickdir * (thickness / 2);
+       D = to - thickdir * (thickness / 2);
+
+       R_BeginPolygon(texture, drawflag);
+       R_PolygonVertex(A, '0 0 0' + shift * '1 0 0', rgb, theAlpha);
+       R_PolygonVertex(B, '0 1 0' + shift * '1 0 0', rgb, theAlpha);
+       R_PolygonVertex(C, '0 1 0' + (shift + length_tex) * '1 0 0', rgb, theAlpha);
+       R_PolygonVertex(D, '0 0 0' + (shift + length_tex) * '1 0 0', rgb, theAlpha);
+       R_EndPolygon();
+}
+
+// a border picture is a texture containing nine parts:
+//   1/4 width: left part
+//   1/2 width: middle part (stretched)
+//   1/4 width: right part
+// divided into
+//   1/4 height: top part
+//   1/2 height: middle part (stretched)
+//   1/4 height: bottom part
+void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha, vector theBorderSize)
+{
+    if (theBorderSize.x < 0 && theBorderSize.y < 0) // draw whole image as it is
+    {
+               drawpic(theOrigin, pic, theSize, theColor, theAlpha, 0);
+               return;
+    }
+       if (theBorderSize.x == 0 && theBorderSize.y == 0) // no border
+       {
+               // draw only the central part
+               drawsubpic(theOrigin, theSize, pic, '0.25 0.25 0', '0.5 0.5 0', theColor, theAlpha, 0);
+               return;
+       }
+
+       vector dX, dY;
+       vector width, height;
+       vector bW, bH;
+       //pic = draw_UseSkinFor(pic);
+       width = eX * theSize.x;
+       height = eY * theSize.y;
+       if(theSize.x <= theBorderSize.x * 2)
+       {
+               // not wide enough... draw just left and right then
+               bW = eX * (0.25 * theSize.x / (theBorderSize.x * 2));
+               if(theSize.y <= theBorderSize.y * 2)
+               {
+                       // not high enough... draw just corners
+                       bH = eY * (0.25 * theSize.y / (theBorderSize.y * 2));
+                       drawsubpic(theOrigin,                 width * 0.5 + height * 0.5, pic, '0 0 0',           bW + bH, theColor, theAlpha, 0);
+                       drawsubpic(theOrigin + width   * 0.5, width * 0.5 + height * 0.5, pic, eX - bW,           bW + bH, theColor, theAlpha, 0);
+                       drawsubpic(theOrigin + height  * 0.5, width * 0.5 + height * 0.5, pic, eY - bH,           bW + bH, theColor, theAlpha, 0);
+                       drawsubpic(theOrigin + theSize * 0.5, width * 0.5 + height * 0.5, pic, eX + eY - bW - bH, bW + bH, theColor, theAlpha, 0);
+               }
+               else
+               {
+                       dY = theBorderSize.x * eY;
+                       drawsubpic(theOrigin,                             width * 0.5          +     dY, pic, '0 0    0',           '0 0.25 0' + bW, theColor, theAlpha, 0);
+                       drawsubpic(theOrigin + width * 0.5,               width * 0.5          +     dY, pic, '0 0    0' + eX - bW, '0 0.25 0' + bW, theColor, theAlpha, 0);
+                       drawsubpic(theOrigin                        + dY, width * 0.5 + height - 2 * dY, pic, '0 0.25 0',           '0 0.5  0' + bW, theColor, theAlpha, 0);
+                       drawsubpic(theOrigin + width * 0.5          + dY, width * 0.5 + height - 2 * dY, pic, '0 0.25 0' + eX - bW, '0 0.5  0' + bW, theColor, theAlpha, 0);
+                       drawsubpic(theOrigin               + height - dY, width * 0.5          +     dY, pic, '0 0.75 0',           '0 0.25 0' + bW, theColor, theAlpha, 0);
+                       drawsubpic(theOrigin + width * 0.5 + height - dY, width * 0.5          +     dY, pic, '0 0.75 0' + eX - bW, '0 0.25 0' + bW, theColor, theAlpha, 0);
+               }
+       }
+       else
+       {
+               if(theSize.y <= theBorderSize.y * 2)
+               {
+                       // not high enough... draw just top and bottom then
+                       bH = eY * (0.25 * theSize.y / (theBorderSize.y * 2));
+                       dX = theBorderSize.x * eX;
+                       drawsubpic(theOrigin,                                         dX + height * 0.5, pic, '0    0 0',           '0.25 0 0' + bH, theColor, theAlpha, 0);
+                       drawsubpic(theOrigin + dX,                        width - 2 * dX + height * 0.5, pic, '0.25 0 0',           '0.5  0 0' + bH, theColor, theAlpha, 0);
+                       drawsubpic(theOrigin + width - dX,                            dX + height * 0.5, pic, '0.75 0 0',           '0.25 0 0' + bH, theColor, theAlpha, 0);
+                       drawsubpic(theOrigin              + height * 0.5,             dX + height * 0.5, pic, '0    0 0' + eY - bH, '0.25 0 0' + bH, theColor, theAlpha, 0);
+                       drawsubpic(theOrigin + dX         + height * 0.5, width - 2 * dX + height * 0.5, pic, '0.25 0 0' + eY - bH, '0.5  0 0' + bH, theColor, theAlpha, 0);
+                       drawsubpic(theOrigin + width - dX + height * 0.5,             dX + height * 0.5, pic, '0.75 0 0' + eY - bH, '0.25 0 0' + bH, theColor, theAlpha, 0);
+               }
+               else
+               {
+                       dX = theBorderSize.x * eX;
+                       dY = theBorderSize.x * eY;
+                       drawsubpic(theOrigin,                                        dX          +     dY, pic, '0    0    0', '0.25 0.25 0', theColor, theAlpha, 0);
+                       drawsubpic(theOrigin                  + dX,      width - 2 * dX          +     dY, pic, '0.25 0    0', '0.5  0.25 0', theColor, theAlpha, 0);
+                       drawsubpic(theOrigin          + width - dX,                  dX          +     dY, pic, '0.75 0    0', '0.25 0.25 0', theColor, theAlpha, 0);
+                       drawsubpic(theOrigin          + dY,                          dX + height - 2 * dY, pic, '0    0.25 0', '0.25 0.5  0', theColor, theAlpha, 0);
+                       drawsubpic(theOrigin          + dY         + dX, width - 2 * dX + height - 2 * dY, pic, '0.25 0.25 0', '0.5  0.5  0', theColor, theAlpha, 0);
+                       drawsubpic(theOrigin          + dY + width - dX,             dX + height - 2 * dY, pic, '0.75 0.25 0', '0.25 0.5  0', theColor, theAlpha, 0);
+                       drawsubpic(theOrigin + height - dY,                          dX          +     dY, pic, '0    0.75 0', '0.25 0.25 0', theColor, theAlpha, 0);
+                       drawsubpic(theOrigin + height - dY         + dX, width - 2 * dX          +     dY, pic, '0.25 0.75 0', '0.5  0.25 0', theColor, theAlpha, 0);
+                       drawsubpic(theOrigin + height - dY + width - dX,             dX          +     dY, pic, '0.75 0.75 0', '0.25 0.25 0', theColor, theAlpha, 0);
+               }
+       }
+}
+
+void drawstringright(vector position, string text, vector theScale, vector rgb, float theAlpha, int flag)
+{
+       position.x -= 2 / 3 * strlen(text) * theScale.x;
+       drawstring(position, text, theScale, rgb, theAlpha, flag);
+}
+
+void drawstringcenter(vector position, string text, vector theScale, vector rgb, float theAlpha, int flag)
+{
+       position.x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * theScale.x);
+       drawstring(position, text, theScale, rgb, theAlpha, flag);
+}
+
+#endif
+#endif
diff --git a/qcsrc/lib/i18n.qh b/qcsrc/lib/i18n.qh
new file mode 100644 (file)
index 0000000..87c41cd
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef I18N_H
+#define I18N_H
+
+#include "log.qh"
+
+// translation helpers
+string prvm_language;
+
+string language_filename(string s)
+{
+    string fn = prvm_language;
+    if (fn == "" || fn == "dump")
+        return s;
+    fn = strcat(s, ".", fn);
+    int fh = fopen(fn, FILE_READ);
+    if (fh >= 0)
+    {
+        fclose(fh);
+        return fn;
+    }
+    return s;
+}
+
+string CTX(string s)
+{
+    int p = strstrofs(s, "^", 0);
+    if (p < 0)
+        return s;
+    return substring(s, p + 1, -1);
+}
+
+#define ZCTX(s) strzone(CTX(s))
+
+#endif
diff --git a/qcsrc/lib/lazy.qh b/qcsrc/lib/lazy.qh
new file mode 100644 (file)
index 0000000..f632b38
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef LAZY_H
+#define LAZY_H
+
+#include "oo.qh"
+
+CLASS(Lazy, Object)
+    ATTRIB(Lazy, m_get, entity(), func_null);
+    CONSTRUCTOR(Lazy, entity() _compute) { this.m_get = _compute; }
+ENDCLASS(Lazy)
+
+#define LAZY(id) __lazy_##id
+#define LAZY_NEW(id, compute) entity LAZY(id)() { \
+    static bool done; \
+    static entity it; \
+    if (!done) { it = compute; done = true; } \
+    return it; \
+}
+#endif
diff --git a/qcsrc/lib/log.qh b/qcsrc/lib/log.qh
new file mode 100644 (file)
index 0000000..f74dd4a
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef LOG_H
+#define LOG_H
+
+#define _printferr(...)     error(sprintf(__VA_ARGS__))
+#define _printfbt(...)      backtrace(sprintf(__VA_ARGS__))
+#define printf(...)         print(sprintf(__VA_ARGS__))
+#define dprintf(...)        dprint(sprintf(__VA_ARGS__))
+#define _dprintf2(...)      do { if (autocvar_developer > 1) dprintf(__VA_ARGS__); } while (0)
+
+#define assert(expr, ...)   do { if (!(expr)) LOG_WARNINGF(__VA_ARGS__); } while (0)
+
+#define _LOG(f, level, s)   f("[::"level"] ["__FILE__":%s:%.0f] %s", __FUNC__, __LINE__, s)
+
+#define  LOG_FATAL(...)     _LOG_FATAL(strcat("", __VA_ARGS__))
+#define  LOG_FATALF(...)    _LOG_FATAL(sprintf(__VA_ARGS__))
+#define _LOG_FATAL(s)       _LOG(_printferr, "FATAL", s)
+
+#define  LOG_SEVERE(...)    _LOG_SEVERE(strcat("", __VA_ARGS__))
+#define  LOG_SEVEREF(...)   _LOG_SEVERE(sprintf(__VA_ARGS__))
+#define _LOG_SEVERE(s)      _LOG(_printfbt, "SEVERE", s)
+
+#define  LOG_WARNING(...)   _LOG_WARNING(strcat("", __VA_ARGS__))
+#define  LOG_WARNINGF(...)  _LOG_WARNING(sprintf(__VA_ARGS__))
+#define _LOG_WARNING(s)     _LOG(printf, "WARNING", s)
+
+#define  LOG_INFO(...)      do { if (autocvar_developer) _LOG_INFO(strcat("", __VA_ARGS__)); else print (__VA_ARGS__); } while (0)
+#define  LOG_INFOF(...)     do { if (autocvar_developer) _LOG_INFO(sprintf(__VA_ARGS__));    else printf(__VA_ARGS__); } while (0)
+#define _LOG_INFO(s)        _LOG(printf, "INFO", s)
+
+#define  LOG_TRACE(...)     _LOG_TRACE(strcat("", __VA_ARGS__))
+#define  LOG_TRACEF(...)    _LOG_TRACE(sprintf(__VA_ARGS__))
+#define _LOG_TRACE(s)       _LOG(dprintf, "TRACE", s)
+
+#define  LOG_DEBUG(...)     _LOG_DEBUG(strcat("", __VA_ARGS__))
+#define  LOG_DEBUGF(...)    _LOG_DEBUG(sprintf(__VA_ARGS__))
+#define _LOG_DEBUG(s)       _LOG(_dprintf2, "DEBUG", s)
+
+// TODO: this sucks, lets find a better way to do backtraces?
+#ifdef SVQC
+void builtin_remove(entity);
+#define _backtrace() builtin_remove(NULL)
+#else
+void remove(entity);
+#define _backtrace() remove(NULL)
+#endif
+
+noref int autocvar_developer;
+noref bool autocvar_prvm_backtraceforwarnings;
+
+#define backtrace(msg) do { \
+    int dev = autocvar_developer; \
+    bool war = autocvar_prvm_backtraceforwarnings; \
+    cvar_set("developer", "1"); \
+    cvar_set("prvm_backtraceforwarnings", "1"); \
+    print("\n--- CUT HERE ---\n", msg, "\n"); \
+    _backtrace(); \
+    print("\n--- CUT UNTIL HERE ---\n"); \
+    cvar_set("developer", ftos(dev)); \
+    cvar_set("prvm_backtraceforwarnings", ftos(war)); \
+} while (0)
+
+#endif
diff --git a/qcsrc/lib/math.qh b/qcsrc/lib/math.qh
new file mode 100644 (file)
index 0000000..a8a5290
--- /dev/null
@@ -0,0 +1,93 @@
+#ifndef MATH_H
+#define MATH_H
+
+void mean_accumulate(entity e, .float a, .float c, float mean, float value, float weight)
+{
+       if (weight == 0)
+               return;
+       if (mean == 0)
+               e.(a) *= pow(value, weight);
+       else
+               e.(a) += pow(value, mean) * weight;
+       e.(c) += weight;
+}
+
+float mean_evaluate(entity e, .float a, .float c, float mean)
+{
+       if (e.(c) == 0)
+               return 0;
+       if (mean == 0)
+               return pow(e.(a), 1.0 / e.(c));
+       else
+               return pow(e.(a) / e.(c), 1.0 / mean);
+}
+
+#define MEAN_ACCUMULATE(prefix,v,w) mean_accumulate(self,prefix##_accumulator,prefix##_count,prefix##_mean,v,w)
+#define MEAN_EVALUATE(prefix) mean_evaluate(self,prefix##_accumulator,prefix##_count,prefix##_mean)
+#define MEAN_DECLARE(prefix,m) float prefix##_mean = m; .float prefix##_count, prefix##_accumulator
+
+/*
+==================
+crandom
+
+Returns a random number between -1.0 and 1.0
+==================
+*/
+float crandom (void)
+{
+       return 2 * (random () - 0.5);
+}
+
+
+/*
+==================
+Angc used for animations
+==================
+*/
+
+
+float angc (float a1, float a2)
+{
+       float   a;
+
+       while (a1 > 180)
+               a1 = a1 - 360;
+       while (a1 < -179)
+               a1 = a1 + 360;
+
+       while (a2 > 180)
+               a2 = a2 - 360;
+       while (a2 < -179)
+               a2 = a2 + 360;
+
+       a = a1 - a2;
+       while (a > 180)
+               a = a - 360;
+       while (a < -179)
+               a = a + 360;
+
+       return a;
+}
+
+float fsnap(float val,float fsize)
+{
+    return rint(val / fsize) * fsize;
+}
+
+vector vsnap(vector point,float fsize)
+{
+    vector vret;
+
+    vret.x = rint(point.x / fsize) * fsize;
+    vret.y = rint(point.y / fsize) * fsize;
+    vret.z = ceil(point.z / fsize) * fsize;
+
+    return vret;
+}
+
+vector lerpv(float t0, vector v0, float t1, vector v1, float t)
+{
+       return v0 + (v1 - v0) * ((t - t0) / (t1 - t0));
+}
+
+#endif
diff --git a/qcsrc/lib/nil.qh b/qcsrc/lib/nil.qh
new file mode 100644 (file)
index 0000000..789b1f9
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef NIL_H
+#define NIL_H
+
+#if QCC_SUPPORT_NIL
+#define func_null nil
+#define string_null nil
+#else
+// the NULL function
+var void func_null(void);
+string string_null;
+#endif
+
+#endif
diff --git a/qcsrc/lib/oo.qh b/qcsrc/lib/oo.qh
new file mode 100644 (file)
index 0000000..88c0ef8
--- /dev/null
@@ -0,0 +1,152 @@
+#ifndef OO_H
+#define OO_H
+
+#include "nil.qh"
+#include "registry.qh"
+
+#ifdef MENUQC
+    #define NULL (null_entity)
+#else
+    #define NULL (world)
+#endif
+
+.string classname;
+/** Location entity was spawned from in source */
+.string sourceLocFile;
+.int sourceLocLine;
+entity _spawn();
+entity __spawn(string _classname, string _sourceFile, int _sourceLine) {
+    entity this = _spawn();
+    this.classname = _classname;
+    this.sourceLocFile = _sourceFile;
+    this.sourceLocLine = _sourceLine;
+    return this;
+}
+
+
+
+#define entityclass(...) EVAL(OVERLOAD(entityclass, __VA_ARGS__))
+#define entityclass_1(name) entityclass_2(name, Object)
+#ifndef QCC_SUPPORT_ENTITYCLASS
+    #define entityclass_2(name, base) typedef entity name
+    #define class(name)
+    #define new(class) __spawn(#class, __FILE__, __LINE__)
+#else
+    #define entityclass_2(name, base) entityclass name : base {}
+    #define class(name) [[class(name)]]
+    #define new(class) ((class) __spawn(#class, __FILE__, __LINE__))
+#endif
+
+// Classes have a `spawn##cname(entity)` constructor
+// The parameter is used across [[accumulate]] functions
+
+// Macros to hide this implementation detail:
+#ifdef GMQCC
+#define NEW(cname, ...) \
+    OVERLOAD(spawn##cname, new(cname), ##__VA_ARGS__)
+
+#define CONSTRUCT(cname, ...) \
+    OVERLOAD(spawn##cname, this, ##__VA_ARGS__)
+#else
+#define NEW_(cname, ...) \
+    OVERLOAD_(spawn##cname, __VA_ARGS__)
+#define NEW(cname, ...) \
+    NEW_(cname, new(cname), ##__VA_ARGS__)(new(cname), ##__VA_ARGS__)
+
+#define CONSTRUCT_(cname, ...) \
+    OVERLOAD_(spawn##cname, __VA_ARGS__)
+#define CONSTRUCT(cname, ...) \
+    CONSTRUCT_(cname, this, ##__VA_ARGS__)(this, ##__VA_ARGS__)
+#endif
+
+#define CONSTRUCTOR(cname, ...) \
+    cname OVERLOAD(spawn##cname, cname this, __VA_ARGS__) { return = this; } \
+    [[accumulate]] cname OVERLOAD(spawn##cname, cname this, __VA_ARGS__)
+
+.string vtblname;
+.entity vtblbase;
+
+void RegisterClasses() { }
+STATIC_INIT(RegisterClasses) { RegisterClasses(); }
+
+#define VTBL(cname, base) \
+    INIT_STATIC(cname); \
+    entity cname##_vtbl; \
+    void cname##_vtbl_init() { \
+        cname e = new(vtbl); \
+        spawn##cname##_static(e); \
+        e.vtblname = #cname; \
+        /* Top level objects refer to themselves */ \
+        e.vtblbase = base##_vtbl ? base##_vtbl : e; \
+        cname##_vtbl = e; \
+    } \
+    ACCUMULATE_FUNCTION(RegisterClasses, cname##_vtbl_init)
+
+#define INIT_STATIC(cname) [[accumulate]] void spawn##cname##_static(cname this)
+#define INIT(cname) [[accumulate]] cname spawn##cname##_1(cname this)
+
+#define CLASS(cname, base)                  \
+    entityclass(cname, base);               \
+    class(cname) .bool instanceOf##cname;   \
+    VTBL(cname, base)                       \
+    INIT_STATIC(cname) {                    \
+        if (cname##_vtbl) {                 \
+            copyentity(cname##_vtbl, this); \
+            return;                         \
+        }                                   \
+        spawn##base##_static(this);         \
+        this.instanceOf##cname = true;      \
+    }                                       \
+    INIT(cname) {                           \
+        /* Only statically initialize the current class, it contains everything it inherits */ \
+        if (cname##_vtbl.vtblname == this.classname) { \
+            spawn##cname##_static(this);    \
+            this.classname = #cname;        \
+            this.vtblname = string_null;    \
+            this.vtblbase = cname##_vtbl;   \
+        }                                   \
+        spawn##base##_1(this);              \
+    }
+
+#define METHOD(cname, name, prototype)      \
+    class(cname) .prototype name;           \
+    prototype cname##_##name;               \
+    INIT_STATIC(cname) { this.name = cname##_##name; } \
+    prototype cname##_##name
+
+#define ATTRIB(cname, name, type, val)      \
+    class(cname) .type name;                \
+    INIT(cname) { this.name = val; }
+
+#define ATTRIBARRAY(cname, name, type, cnt) \
+    class(cname) .type name[cnt];
+
+#define ENDCLASS(cname) \
+    [[last]] INIT(cname) { return this; }
+
+#define SUPER(cname) (cname##_vtbl.vtblbase)
+#define super (this.vtblbase.vtblbase)
+
+#define spawn_static(this)
+#define spawn_1(this)
+#define _vtbl NULL
+CLASS(Object, );
+    METHOD(Object, describe, string(entity this)) {
+        string s = _("No description");
+        if (cvar("developer")) {
+            for (int i = 0, n = numentityfields(); i < n; ++i) {
+                string value = getentityfieldstring(i, this);
+                if (value != "") s = sprintf("%s\n%s = %s", s, entityfieldname(i), value);
+            }
+        }
+        return s;
+    }
+    METHOD(Object, display, void(entity this, void(string name, string icon) returns)) {
+        returns(sprintf("entity %i", this), "nopreview_map");
+    }
+ENDCLASS(Object)
+#undef spawn_static
+#undef spawn_1
+#undef _vtbl
+
+#endif
diff --git a/qcsrc/lib/player.qh b/qcsrc/lib/player.qh
new file mode 100644 (file)
index 0000000..f89a3b0
--- /dev/null
@@ -0,0 +1,34 @@
+#ifdef CSQC
+#ifndef PLAYER_H
+#define PLAYER_H
+
+#include "string.qh"
+
+#include "../client/main.qh"
+#include "../common/teams.qh"
+
+int GetPlayerColorForce(int i)
+{
+       if(!teamplay)
+               return 0;
+       else
+               return stof(getplayerkeyvalue(i, "colors")) & 15;
+}
+
+int GetPlayerColor(int i)
+{
+       if(!playerslots[i].gotscores) // unconnected
+               return NUM_SPECTATOR;
+       else if(stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR)
+               return NUM_SPECTATOR;
+       else
+               return GetPlayerColorForce(i);
+}
+
+string GetPlayerName(int i)
+{
+       return ColorTranslateRGB(getplayerkeyvalue(i, "name"));
+}
+
+#endif
+#endif
diff --git a/qcsrc/lib/progname.qh b/qcsrc/lib/progname.qh
new file mode 100644 (file)
index 0000000..ed112a5
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef PROGNAME_H
+#define PROGNAME_H
+
+#if defined(MENUQC)
+    #define PROGNAME "MENUQC"
+#elif defined(SVQC)
+    #define PROGNAME "SVQC"
+#elif defined(CSQC)
+    #define PROGNAME "CSQC"
+#else
+    #error "Unable to detect PROGNAME"
+#endif
+
+#endif
diff --git a/qcsrc/lib/registry.qh b/qcsrc/lib/registry.qh
new file mode 100644 (file)
index 0000000..d9317e8
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef REGISTRY_H
+#define REGISTRY_H
+
+#include "oo.qh"
+
+#define REGISTER_INIT(ns, id) [[accumulate]] void Register_##ns##_##id##_init(entity this)
+#define REGISTER_INIT_POST(ns, id) [[accumulate]] void Register_##ns##_##id##_init_post(entity this)
+
+#define REGISTER(initfunc, ns, array, counter, id, fld, inst)   \
+    entity ns##_##id;                                           \
+    REGISTER_INIT(ns, id) { }                                   \
+    REGISTER_INIT_POST(ns, id) { }                              \
+    .entity enemy; /* internal next pointer */                  \
+    void Register_##ns##_##id() {                               \
+        entity this = inst;                                     \
+        ns##_##id = this;                                       \
+        this.fld = counter;                                     \
+        array[counter++] = this;                                \
+        if (!array##_first)    array##_first = this;            \
+        if ( array##_last)     array##_last.enemy = this;       \
+        array##_last = this;                                    \
+        Register_##ns##_##id##_init(this);                      \
+        Register_##ns##_##id##_init_post(this);                 \
+    }                                                           \
+    ACCUMULATE_FUNCTION(initfunc, Register_##ns##_##id)         \
+    REGISTER_INIT(ns, id)
+
+#endif
diff --git a/qcsrc/lib/static.qh b/qcsrc/lib/static.qh
new file mode 100644 (file)
index 0000000..d51a871
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef STATIC_H
+#define STATIC_H
+
+void __static_init_early() { }
+void __static_init() { CALL_ACCUMULATED_FUNCTION(__static_init_early); }
+#define static_init() CALL_ACCUMULATED_FUNCTION(__static_init)
+#define REGISTER_REGISTRY(func) ACCUMULATE_FUNCTION(__static_init_early, func)
+
+#define _STATIC_INIT(where, func) \
+    void _static_##func(); \
+    ACCUMULATE_FUNCTION(where, _static_##func) \
+    void _static_##func()
+
+#define STATIC_INIT(func)       _STATIC_INIT(__static_init_early,   func##_early)
+#define STATIC_INIT_LATE(func)  _STATIC_INIT(__static_init,         func)
+
+#endif
diff --git a/qcsrc/lib/string.qh b/qcsrc/lib/string.qh
new file mode 100644 (file)
index 0000000..faf81b2
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef STRING_H
+#define STRING_H
+
+#ifndef SVQC
+float stringwidth_colors(string s, vector theSize)
+{
+       return stringwidth(s, true, theSize);
+}
+
+float stringwidth_nocolors(string s, vector theSize)
+{
+       return stringwidth(s, false, theSize);
+}
+#endif
+
+// Timer (#5)
+//
+// TODO: macro
+string seconds_tostring(float sec)
+{
+       float minutes;
+       minutes = floor(sec / 60);
+
+       sec -= minutes * 60;
+       return sprintf("%d:%02d", minutes, sec);
+}
+
+int ColorTranslateMode;
+
+string ColorTranslateRGB(string s)
+{
+       if(ColorTranslateMode & 1)
+               return strdecolorize(s);
+       else
+               return s;
+}
+
+#endif
diff --git a/qcsrc/lib/struct.qh b/qcsrc/lib/struct.qh
new file mode 100644 (file)
index 0000000..507c417
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef STRUCT_H
+#define STRUCT_H
+
+#ifndef QCC_SUPPORT_STRUCT
+    #define _STRUCT_DECLARE(x, id, type, END) noref type x ##_## id ;
+    #define STRUCT_DECLARE(id, s) s(_STRUCT_DECLARE, id)
+
+    #define _STRUCT_PARAM_(x, id, type) type x ##_## id ,
+    #define _STRUCT_PARAM_END(x, id, type) type x ##_## id
+    #define _STRUCT_PARAM(x, id, type, isend) _STRUCT_PARAM_##isend(x, id, type)
+    #define STRUCT_PARAM(id, s) s(_STRUCT_PARAM, id)
+
+    #define _STRUCT_PASS_(x, id, type) x ##_## id ,
+    #define _STRUCT_PASS_END(x, id, type) x ##_## id
+    #define _STRUCT_PASS(x, id, type, END) _STRUCT_PASS_##END(x, id, type)
+    #define STRUCT_PASS(id, s) s(_STRUCT_PASS, id)
+
+    #define _STRUCT_STORE_DST(_, it) it
+    #define _STRUCT_STORE_SRC(it, _) it
+    #define _CONCAT3_(a, b, c) a ## b ## c
+    #define _CONCAT3(a, b, c) _CONCAT3_(a, b, c)
+    #define _STRUCT_STORE(x, id, type, END) _CONCAT3(_STRUCT_STORE_DST x, _, id) = _CONCAT3(_STRUCT_STORE_SRC x, _, id);
+    #define STRUCT_STORE(from, to, s) s(_STRUCT_STORE, (from, to))
+
+    #define STRUCT(id, ...)
+#else
+    #define STRUCT_DECLARE(id, type) type id;
+    #define STRUCT_PARAM(id, type) type id
+    #define STRUCT_PASS(id, type) id
+    #define STRUCT_STORE(from, to, s) to = from
+    #define _STRUCT_MEMBER(my, id, type, END) type id;
+    #define STRUCT(id, s) struct STRUCT_##id { s(_STRUCT_MEMBER, ) };
+#endif
+
+#endif
diff --git a/qcsrc/lib/vector.qh b/qcsrc/lib/vector.qh
new file mode 100644 (file)
index 0000000..d81a795
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef VECTOR_H
+#define VECTOR_H
+
+const vector eX = '1 0 0';
+const vector eY = '0 1 0';
+const vector eZ = '0 0 1';
+
+vector randompos(vector m1, vector m2)
+{
+       vector v;
+       m2 = m2 - m1;
+       v_x = m2_x * random() + m1_x;
+       v_y = m2_y * random() + m1_y;
+       v_z = m2_z * random() + m1_z;
+       return  v;
+}
+
+float vlen2d(vector v)
+{
+       return sqrt(v.x * v.x + v.y * v.y);
+}
+
+float vlen_maxnorm2d(vector v)
+{
+       return max(v.x, v.y, -v.x, -v.y);
+}
+
+float vlen_minnorm2d(vector v)
+{
+       return min(max(v.x, -v.x), max(v.y, -v.y));
+}
+
+
+#endif
diff --git a/qcsrc/menu/progs.inc b/qcsrc/menu/progs.inc
new file mode 100644 (file)
index 0000000..45c52c8
--- /dev/null
@@ -0,0 +1,29 @@
+#include "../common/util-pre.qh"
+#include "../dpdefs/menudefs.qh"
+#include "../dpdefs/keycodes.qh"
+#include "../common/util-post.qh"
+
+#include "../lib/_all.inc"
+
+#include "oo/classes.qc"
+
+#include "draw.qc"
+#include "menu.qc"
+
+#include "command/all.qc"
+
+#include "xonotic/util.qc"
+
+#include "../common/campaign_file.qc"
+#include "../common/campaign_setup.qc"
+#include "../common/mapinfo.qc"
+#include "../common/playerstats.qc"
+#include "../common/util.qc"
+
+#include "../common/items/all.qc"
+#include "../common/monsters/all.qc"
+#include "../common/mutators/all.qc"
+#include "../common/vehicles/all.qc"
+#include "../common/weapons/all.qc"
+
+#include "../mod/menu/progs.inc"
index 158d4f51b3dad4178ac10b55215412985b3183a9..1eb2b723d463454957f44af836200d27e2feeca7 100644 (file)
@@ -1,32 +1,2 @@
 ../../menu.dat
-
-../common/util-pre.qh
-../dpdefs/menudefs.qh
-../dpdefs/keycodes.qh
-../common/util-post.qh
-
-../lib/_all.inc
-
-oo/classes.qc
-
-draw.qc
-menu.qc
-
-command/all.qc
-
-xonotic/util.qc
-
-../common/campaign_file.qc
-../common/campaign_setup.qc
-../common/mapinfo.qc
-../common/playerstats.qc
-../common/util.qc
-
-../common/items/all.qc
-../common/monsters/all.qc
-../common/mutators/all.qc
-../common/vehicles/all.qc
-../common/weapons/all.qc
-
-
-../mod/menu/progs.inc
+progs.inc
index 497e1e5e77dff8cd7d163be44f945dd92258e24b..fc87261a538b736546e2481b29d992d6d3abc2eb 100644 (file)
@@ -84,7 +84,8 @@ CLASS(XonoticGameSettingsTab, XonoticTab)
        ATTRIB(XonoticGameSettingsTab, intendedWidth, float, 0.9)
     ATTRIB(XonoticGameSettingsTab, rows, float, 15.5)
     ATTRIB(XonoticGameSettingsTab, columns, float, 6.5)
-    ATTRIB(XonoticGameSettingsTab, topicList, entity, NEW(XonoticRegisteredSettingsList, NEW(SettingSource)))
+    ATTRIB(XonoticGameSettingsTab, source, DataSource, NEW(SettingSource))
+    ATTRIB(XonoticGameSettingsTab, topicList, entity, NEW(XonoticRegisteredSettingsList, this.source))
     ATTRIB(XonoticGameSettingsTab, currentPanel, entity, NEW(XonoticTab))
     ATTRIB(XonoticGameSettingsTab, currentItem, entity, NULL)
     METHOD(XonoticGameSettingsTab, topicChangeNotify, void(entity, entity this))
index d2bf9c92023e67891226a2eef6d8a2ee4f8f1a32..619e1d1a5a5e40da48989789c482bf9276286dad 100644 (file)
@@ -678,8 +678,8 @@ float updateCompression()
        GAMETYPE(MAPINFO_TYPE_ASSAULT) \
        if (cvar("developer")) GAMETYPE(MAPINFO_TYPE_RACE) \
        GAMETYPE(MAPINFO_TYPE_CTS) \
-       //GAMETYPE(MAPINFO_TYPE_INVASION) \
-       /* nothing */
+       /* GAMETYPE(MAPINFO_TYPE_INVASION) */ \
+       /**/
 
 int GameType_GetID(int cnt)
 {
index 963f113148433a2bfa9ac2650ec1baff18b8e7af..1b3554eec496a7443e84429400b5696360d7878c 100644 (file)
@@ -1241,10 +1241,9 @@ void PlayerSound(.string samplefield, float chan, float voicetype)
 
 void VoiceMessage(string type, string msg)
 {SELFPARAM();
-       var .string sample;
        float voicetype, ownteam;
        float flood;
-       sample = GetVoiceMessageSampleField(type);
+       var .string sample = GetVoiceMessageSampleField(type);
 
        if(GetPlayerSoundSampleField_notFound)
        {
index 6cf7c1a6546b4044f0a2a2bf8f69e763bfdcf6b1..4f4eab3561006c342baad43a3b4bc620e32169e6 100644 (file)
@@ -1084,8 +1084,8 @@ void ctf_DelayedFlagSetup(void) // called after a flag is placed on a map by ctf
 
 void set_flag_string(entity flag, .string field, string value, string teamname)
 {
-       if(flag.field == "")
-               flag.field = strzone(sprintf(value,teamname));
+       if(flag.(field) == "")
+               flag.(field) = strzone(sprintf(value,teamname));
 }
 
 void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag entity on the map as a spawnfunc
index 62e4d9f53d3a79303716a9e34064a5cb0d10e5ae..3464a6478e68e74bad58faa0f267e5df049e8fb7 100644 (file)
@@ -12,7 +12,7 @@ entity buff_FirstFromFlags(int _buffs)
        {
                FOREACH(BUFFS, it.m_itemid & _buffs, LAMBDA(return it));
        }
-       return BUFF_NULL;
+       return BUFF_Null;
 }
 
 bool buffs_BuffModel_Customize()
@@ -197,7 +197,7 @@ void buff_Touch()
 
 float buff_Available(entity buff)
 {
-       if (buff == BUFF_NULL)
+       if (buff == BUFF_Null)
                return false;
        if (buff == BUFF_AMMO && ((start_items & IT_UNLIMITED_WEAPON_AMMO) || (start_items & IT_UNLIMITED_AMMO) || (cvar("g_melee_only"))))
                return false;
@@ -806,7 +806,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerThink)
        if(self.buffs != self.oldbuffs)
        {
                entity buff = buff_FirstFromFlags(self.buffs);
-               float bufftime = buff != BUFF_NULL ? buff.m_time(buff) : 0;
+               float bufftime = buff != BUFF_Null ? buff.m_time(buff) : 0;
                self.buff_time = (bufftime) ? time + bufftime : 0;
 
                BUFF_ONADD(BUFF_AMMO)
diff --git a/qcsrc/server/progs.inc b/qcsrc/server/progs.inc
new file mode 100644 (file)
index 0000000..b387ed3
--- /dev/null
@@ -0,0 +1,123 @@
+#include "../common/util-pre.qh"
+#include "sys-pre.qh"
+#include "../dpdefs/progsdefs.qh"
+#include "../dpdefs/dpextensions.qh"
+#include "sys-post.qh"
+#include "../common/util-post.qh"
+
+#include "../lib/_all.inc"
+
+#include "anticheat.qc"
+#include "antilag.qc"
+#include "campaign.qc"
+#include "cheats.qc"
+#include "cl_client.qc"
+#include "cl_impulse.qc"
+#include "cl_player.qc"
+#include "controlpoint.qc"
+#include "csqceffects.qc"
+#include "ent_cs.qc"
+#include "g_damage.qc"
+#include "g_hook.qc"
+// #include "g_lights.qc" // TODO: was never used
+#include "g_models.qc"
+#include "g_subs.qc"
+#include "g_violence.qc"
+#include "g_world.qc"
+#include "generator.qc"
+#include "ipban.qc"
+#include "item_key.qc"
+#include "mapvoting.qc"
+#include "miscfunctions.qc"
+#include "movelib.qc"
+// #include "pathlib.qc" // TODO: was never used. Seems to duplicate `pathlib/`
+#include "playerdemo.qc"
+#include "portals.qc"
+#include "race.qc"
+#include "round_handler.qc"
+#include "scores.qc"
+#include "scores_rules.qc"
+#include "spawnpoints.qc"
+#include "steerlib.qc"
+#include "sv_main.qc"
+#include "teamplay.qc"
+#include "t_halflife.qc"
+#include "t_items.qc"
+#include "t_quake3.qc"
+#include "t_quake.qc"
+
+#include "bot/aim.qc"
+#include "bot/bot.qc"
+#include "bot/navigation.qc"
+#include "bot/scripting.qc"
+#include "bot/waypoints.qc"
+
+#include "bot/havocbot/havocbot.qc"
+#include "bot/havocbot/role_keyhunt.qc"
+#include "bot/havocbot/roles.qc"
+
+#include "command/all.qc"
+
+#include "mutators/mutators_include.qc"
+#include "mutators/mutators.qc"
+
+#include "pathlib/costs.qc"
+#include "pathlib/expandnode.qc"
+#include "pathlib/main.qc"
+#include "pathlib/movenode.qc"
+#include "pathlib/path_waypoint.qc"
+#include "pathlib/utility.qc"
+
+#include "weapons/accuracy.qc"
+#include "weapons/common.qc"
+#include "weapons/csqcprojectile.qc" // TODO
+#include "weapons/hitplot.qc"
+#include "weapons/selection.qc"
+#include "weapons/spawning.qc"
+#include "weapons/throwing.qc"
+#include "weapons/tracing.qc"
+#include "weapons/weaponstats.qc"
+#include "weapons/weaponsystem.qc"
+
+#include "../common/animdecide.qc"
+#include "../common/buffs.qc"
+#include "../common/campaign_file.qc"
+#include "../common/campaign_setup.qc"
+#include "../common/effects.qc"
+#include "../common/mapinfo.qc"
+#include "../common/monsters/spawn.qc"
+#include "../common/monsters/sv_monsters.qc"
+#include "../common/minigames/minigames.qc"
+#include "../common/minigames/sv_minigames.qc"
+#include "../common/movetypes/include.qc"
+#include "../common/nades.qc"
+#include "../common/net_notice.qc"
+#include "../common/notifications.qc"
+#include "../common/physics.qc"
+#include "../common/playerstats.qc"
+#include "../common/viewloc.qc"
+#include "../common/triggers/include.qc"
+#include "../common/util.qc"
+
+#include "../common/items/all.qc"
+#include "../common/monsters/all.qc"
+#include "../common/mutators/all.qc"
+#include "../common/vehicles/all.qc"
+#include "../common/weapons/all.qc" // TODO
+
+#include "../common/turrets/sv_turrets.qc"
+#include "../common/turrets/config.qc"
+#include "../common/turrets/util.qc"
+#include "../common/turrets/turrets.qc"
+#include "../common/turrets/checkpoint.qc"
+#include "../common/turrets/targettrigger.qc"
+#include "../common/weapons/config.qc"
+
+#include "../csqcmodellib/sv_model.qc"
+
+#include "../warpzonelib/anglestransform.qc"
+#include "../warpzonelib/common.qc"
+#include "../warpzonelib/server.qc"
+#include "../warpzonelib/util_server.qc"
+
+#include "../mod/server/progs.inc"
index f9193cbd005a6f405260b189f613e699eca40c01..9ba92b46ff271a9a2b86228b21f3dbe018b084aa 100644 (file)
@@ -1,125 +1,2 @@
 ../../progs.dat
-
-../common/util-pre.qh
-sys-pre.qh
-../dpdefs/progsdefs.qh
-../dpdefs/dpextensions.qh
-sys-post.qh
-../common/util-post.qh
-
-../lib/_all.inc
-
-anticheat.qc
-antilag.qc
-campaign.qc
-cheats.qc
-cl_client.qc
-cl_impulse.qc
-cl_player.qc
-controlpoint.qc
-csqceffects.qc
-ent_cs.qc
-g_damage.qc
-g_hook.qc
-// g_lights.qc // TODO: was never used
-g_models.qc
-g_subs.qc
-g_violence.qc
-g_world.qc
-generator.qc
-ipban.qc
-item_key.qc
-mapvoting.qc
-miscfunctions.qc
-movelib.qc
-// pathlib.qc // TODO: was never used. Seems to duplicate `pathlib/`
-playerdemo.qc
-portals.qc
-race.qc
-round_handler.qc
-scores.qc
-scores_rules.qc
-spawnpoints.qc
-steerlib.qc
-sv_main.qc
-teamplay.qc
-t_halflife.qc
-t_items.qc
-t_quake3.qc
-t_quake.qc
-
-bot/aim.qc
-bot/bot.qc
-bot/navigation.qc
-bot/scripting.qc
-bot/waypoints.qc
-
-bot/havocbot/havocbot.qc
-bot/havocbot/role_keyhunt.qc
-bot/havocbot/roles.qc
-
-command/all.qc
-
-mutators/mutators_include.qc
-mutators/mutators.qc
-
-pathlib/costs.qc
-pathlib/expandnode.qc
-pathlib/main.qc
-pathlib/movenode.qc
-pathlib/path_waypoint.qc
-pathlib/utility.qc
-
-weapons/accuracy.qc
-weapons/common.qc
-weapons/csqcprojectile.qc // TODO
-weapons/hitplot.qc
-weapons/selection.qc
-weapons/spawning.qc
-weapons/throwing.qc
-weapons/tracing.qc
-weapons/weaponstats.qc
-weapons/weaponsystem.qc
-
-../common/animdecide.qc
-../common/buffs.qc
-../common/campaign_file.qc
-../common/campaign_setup.qc
-../common/effects.qc
-../common/mapinfo.qc
-../common/monsters/spawn.qc
-../common/monsters/sv_monsters.qc
-../common/minigames/minigames.qc
-../common/minigames/sv_minigames.qc
-../common/movetypes/include.qc
-../common/nades.qc
-../common/net_notice.qc
-../common/notifications.qc
-../common/physics.qc
-../common/playerstats.qc
-../common/viewloc.qc
-../common/triggers/include.qc
-../common/util.qc
-
-../common/items/all.qc
-../common/monsters/all.qc
-../common/mutators/all.qc
-../common/vehicles/all.qc
-../common/weapons/all.qc // TODO
-
-../common/turrets/sv_turrets.qc
-../common/turrets/config.qc
-../common/turrets/util.qc
-../common/turrets/turrets.qc
-../common/turrets/checkpoint.qc
-../common/turrets/targettrigger.qc
-../common/weapons/config.qc
-
-../csqcmodellib/sv_model.qc
-
-../warpzonelib/anglestransform.qc
-../warpzonelib/common.qc
-../warpzonelib/server.qc
-../warpzonelib/util_server.qc
-
-../mod/server/progs.inc
+progs.inc
index 1e42413a1b7dcdf982b369e9809aacdc60a89453..ba16fd79ef8f4ddac88686a09435a27e8ee45a95 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 cd ${0%[\\/]*}
-find . -name .git -prune -o -type f -print0 |                                    \
+find . -name .git -prune -o -type f -print0 |               \
     xargs -0 sed -i                                         \
         `# strip trailing spaces`                           \
         -e 's/[[:space:]]*$//'                              \