]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Create a sound list
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 23 Sep 2015 02:31:49 +0000 (12:31 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 23 Sep 2015 02:31:49 +0000 (12:31 +1000)
66 files changed:
qcsrc/Makefile
qcsrc/client/_all.qh
qcsrc/client/controlpoint.qc
qcsrc/client/controlpoint.qh
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/csqcmodel_hooks.qh [deleted file]
qcsrc/client/generator.qc
qcsrc/client/generator.qh
qcsrc/client/gibs.qc
qcsrc/client/gibs.qh
qcsrc/client/hook.qc
qcsrc/client/hook.qh
qcsrc/client/main.qc
qcsrc/client/mapvoting.qc
qcsrc/client/weapons/projectile.qc
qcsrc/collect-precache.sh [deleted file]
qcsrc/common/models/models.qh
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/mutators/mutator/casings.qc
qcsrc/common/sounds/sounds.inc [new file with mode: 0644]
qcsrc/common/sounds/sounds.qh [new file with mode: 0644]
qcsrc/common/turrets/turrets.qc
qcsrc/common/turrets/unit/machinegun.qc
qcsrc/common/turrets/unit/phaser.qc
qcsrc/common/turrets/unit/walker.qc
qcsrc/common/util.qc
qcsrc/common/vehicles/all.qc
qcsrc/common/vehicles/unit/racer.qc
qcsrc/common/vehicles/unit/raptor.qc
qcsrc/common/vehicles/unit/spiderbot.qc
qcsrc/common/weapons/all.qc
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/fireball.qc
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/hmg.qc
qcsrc/common/weapons/weapon/hook.qc
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/common/weapons/weapon/mortar.qc
qcsrc/common/weapons/weapon/porto.qc
qcsrc/common/weapons/weapon/rifle.qc
qcsrc/common/weapons/weapon/rpc.qc
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/lib/_all.inc
qcsrc/lib/file.qh [new file with mode: 0644]
qcsrc/server/_all.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/gamemode_domination.qc
qcsrc/server/mutators/gamemode_keepaway.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/gamemode_onslaught.qc
qcsrc/server/mutators/mutator_buffs.qc
qcsrc/server/mutators/mutator_nades.qc
qcsrc/server/mutators/mutator_new_toys.qc
qcsrc/server/mutators/mutator_overkill.qc
qcsrc/server/t_items.qc

index 34bf30fdcdcfe9c052fbf6ab4d0aa136948f6b6c..5d64da0903262d5ef80234095d54a6fd0b0dc88b 100644 (file)
@@ -9,32 +9,34 @@ QCCVERSIONFILE := qccversion.$(shell (cd server && $(QCC) --version) > qccversio
 QCCFLAGS_WTFS ?= \
        -Wno-field-redeclared
 
-QCCFLAGS ?= \
-       -std=gmqcc \
-       -O3 -flno \
-       -Werror -fno-bail-on-werror -Wall \
-       -fftepp -fftepp-predefs -Wcpp -futf8 -frelaxed-switch -freturn-assignments \
-       $(QCCFLAGS_WTFS) \
-       $(QCCFLAGS_FEATURES) \
-       $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
-
 QCCFLAGS_FEATURES ?= \
        -DVEHICLES_ENABLED=1 \
        -DVEHICLES_USE_ODE=0 \
        -DBUILD_MOD=$(BUILD_MOD)
 
+QCCFLAGS ?= \
+       -std=gmqcc \
+       -O3 \
+       -Werror -Wall -Wcpp \
+       $(QCCFLAGS_WTFS) \
+       -fftepp -flno -futf8 -fno-bail-on-werror -fftepp-predefs \
+       -frelaxed-switch -freturn-assignments \
+       $(QCCFLAGS_WATERMARK) \
+       $(QCCFLAGS_FEATURES) \
+       $(QCCFLAGS_EXTRA)
+
 # xonotic build system overrides this by command line argument to turn off the update-cvarcount step
 XON_BUILDSYSTEM =
 
-all: qc
 .PHONY: all
+all: qc
 
 .PHONY: qc
 qc: ../menu.dat ../progs.dat ../csprogs.dat
 
 .PHONY: clean
 clean:
-       rm -f ../progs.dat ../menu.dat ../csprogs.dat server/precache-for-csqc.inc
+       rm -f ../progs.dat ../menu.dat ../csprogs.dat
 
 $(QCCVERSIONFILE):
        $(RM) qccversion.*
@@ -45,11 +47,8 @@ FILES_CSPROGS = $(shell find client lib common warpzonelib csqcmodellib -type f
        @echo make[1]: Entering directory \`$(PWD)/client\'
        cd client && $(QCC) $(QCCFLAGS) -DCSQC
 
-server/precache-for-csqc.inc: $(FILES_CSPROGS)
-       sh collect-precache.sh
-
 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
+../progs.dat: $(FILES_PROGS) $(QCCVERSIONFILE)
        @echo make[1]: Entering directory \`$(PWD)/server\'
        cd server && $(QCC) $(QCCFLAGS) -DSVQC
 
index 66fd813143ded40e3c222e4a70c49aefdc558fa9..12dc1b4a3ae6b23dc09ca2af94a5065d2f32fec4 100644 (file)
@@ -9,5 +9,6 @@
 #include "../dpdefs/csprogsdefs.qh"
 
 #include "../common/models/models.qh"
+#include "../common/sounds/sounds.qh"
 
 #endif
index aec000d64c7c069b8c1d342484b977b3232c680a..a83260b1049c7dfcabcb04926e9b6c817fe1dd23 100644 (file)
@@ -4,7 +4,6 @@
 #include "../common/movetypes/movetypes.qh"
 
 .float alpha;
-bool cpicon_precached;
 .int count;
 .float pain_finished;
 
@@ -21,14 +20,6 @@ bool cpicon_precached;
 
 .entity icon_realmodel;
 
-void cpicon_precache()
-{
-       if(cpicon_precached)
-               return; // already precached
-
-       cpicon_precached = true;
-}
-
 void cpicon_draw()
 {SELFPARAM();
        if(time < self.move_time) { return; }
@@ -186,7 +177,6 @@ void ent_cpicon()
                        self.count = (self.health - self.max_health) * frametime;
 
                cpicon_changeteam();
-               cpicon_precache();
                cpicon_construct();
        }
 
index 8469b5226fc36ef3f0efc15310c9732b0f654552..a2ce395917ae7561f4482c36bac921250780b1f8 100644 (file)
@@ -8,6 +8,5 @@ const int CPSF_STATUS = 4;
 const int CPSF_SETUP = 8;
 
 void ent_cpicon();
-void cpicon_precache();
 
 #endif
index 022afd9d11c937ed493fd1df41ea96f6a0140edb..400ca7387eea31a491c799e17c4d45826e07e974 100644 (file)
@@ -1,4 +1,3 @@
-#include "csqcmodel_hooks.qh"
 #include "_all.qh"
 
 #include "gibs.qh"
@@ -605,11 +604,6 @@ void CSQCModel_Effects_Apply(void)
        }
 }
 
-void CSQCPlayer_Precache()
-{
-       precache_sound("misc/jetpack_fly.wav");
-}
-
 // general functions
 .int csqcmodel_predraw_run;
 .int anim_frame;
diff --git a/qcsrc/client/csqcmodel_hooks.qh b/qcsrc/client/csqcmodel_hooks.qh
deleted file mode 100644 (file)
index 8995880..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef CSQCMODEL_HOOKS
-#define CSQCMODEL_HOOKS
-
-void CSQCPlayer_Precache();
-
-#endif
index c9358b6795cea7091efad0056da321f6eb831ec0..f43b5ed0230f90571b4e8a8123ff6acc1bccb7ba 100644 (file)
@@ -1,22 +1,8 @@
 #include "generator.qh"
 
-bool generator_precached;
 .int count;
 .float max_health;
 
-void generator_precache()
-{
-       if(generator_precached)
-               return; // already precached
-
-       precache_sound("onslaught/shockwave.wav");
-       precache_sound(W_Sound("grenade_impact"));
-       precache_sound(W_Sound("rocket_impact"));
-       precache_sound("onslaught/electricity_explode.wav");
-
-       generator_precached = true;
-}
-
 void ons_generator_ray_draw()
 {SELFPARAM();
        if(time < self.move_time)
@@ -213,7 +199,6 @@ void ent_generator()
                        self.count = 40;
 
                generator_changeteam();
-               generator_precache();
                generator_construct();
        }
 
index e4e1611f31273ca1d7dda2173f72405d733ab3c4..744bc5589f47a39edba81e1bf1fe78dbc215d617 100644 (file)
@@ -7,5 +7,4 @@ const int GSF_STATUS = 4;
 const int GSF_SETUP = 8;
 
 void ent_generator();
-void generator_precache();
 #endif
index 0302f184150f81525487e63b5ca272c9052be29e..63d818054c07cef996db0f37a4ab92b8581ac9b4 100644 (file)
@@ -272,12 +272,3 @@ void Ent_GibSplash(bool isNew)
                        break;
        }
 }
-
-void GibSplash_Precache()
-{
-       precache_sound ("misc/gib.wav");
-    precache_sound ("misc/gib_splat01.wav");
-    precache_sound ("misc/gib_splat02.wav");
-    precache_sound ("misc/gib_splat03.wav");
-    precache_sound ("misc/gib_splat04.wav");
-}
index b33a1a5e061bf1416e11085bd812a899a0ca2e88..5b8b16bfd8c11cbac3caba4fd709716dfd8b07a6 100644 (file)
@@ -23,5 +23,4 @@ void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector
 
 void Ent_GibSplash(bool isNew);
 
-void GibSplash_Precache();
 #endif
index 528646979e987606f70fc3f9c939f9cd15aebbd8..22ec447d526e99865c48b26414a5fa2c4936fe9f 100644 (file)
@@ -236,9 +236,4 @@ void Ent_ReadHook(float bIsNew, float type)
        self.teleport_time = time + 10;
 }
 
-void Hook_Precache()
-{
-       precache_sound(W_Sound("lgbeam_fly"));
-}
-
 // TODO: hook: temporarily transform self.origin for drawing the model along warpzones!
index 8401dce049a43cd1c90accf3c6e3c30471da7946..e513ed6afa4451ee0271a1bc33d15716b869edfc 100644 (file)
@@ -2,7 +2,6 @@
 #define HOOK_H
 
 void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg);
-void Hook_Precache();
 
 void Ent_ReadHook(float bIsNew, float type);
 
index c534cc7a5db46dc3362a9b511b551e7bb4861f86..0f4cd950d00ca3c56d25e2cc674604c9f3bea36f 100644 (file)
@@ -2,7 +2,6 @@
 #include "_all.qh"
 
 #include "controlpoint.qh"
-#include "csqcmodel_hooks.qh"
 #include "damage.qh"
 #include "effects.qh"
 #include "generator.qh"
@@ -156,15 +155,9 @@ void CSQC_Init(void)
        initialize_minigames();
 
        // precaches
-       precache_sound("misc/hit.wav");
-       precache_sound("misc/typehit.wav");
 
-       generator_precache();
        Projectile_Precache();
-       Hook_Precache();
-       GibSplash_Precache();
        Tuba_Precache();
-       CSQCPlayer_Precache();
 
        if(autocvar_cl_reticle)
        {
index 3511c743f05b7478a6436c884775742962532b72..945f312ab29a29592806145c248229b94c1fcf92 100644 (file)
@@ -630,8 +630,6 @@ void GameTypeVote_ReadOption(int i)
 
 void MapVote_Init()
 {
-       precache_sound ("misc/invshot.wav");
-
        mv_active = 1;
        if(autocvar_hud_cursormode) { setcursormode(1); }
        else { mv_mousepos = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight; }
index 1be6f8974b77bb5034279b82afb0e9ecae104b55..5398870cbd6b3b598f06ed0648dd7a4061da1c71 100644 (file)
@@ -508,11 +508,5 @@ void Ent_Projectile()
 
 void Projectile_Precache()
 {
-       precache_sound(W_Sound("electro_fly"));
-       precache_sound(W_Sound("rocket_fly"));
-       precache_sound(W_Sound("fireball_fly"));
-       precache_sound(W_Sound("fireball_fly2"));
-       precache_sound(W_Sound("tag_rocket_fly"));
-
        MUTATOR_CALLHOOK(PrecacheProjectiles);
 }
diff --git a/qcsrc/collect-precache.sh b/qcsrc/collect-precache.sh
deleted file mode 100755 (executable)
index 302220c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-{
-       grep -h '\<precache_model *( *"' client/* | grep -v "//NO_SV_PRECACHE"
-       grep -h '\<precache_sound *( *"' client/* | grep -v "//NO_SV_PRECACHE"
-} > server/precache-for-csqc.inc
-
index c668959655db0c25c19b8214afafffb91cd62e19..0d17f43ab4ef1b9b1dbe5e28bc73db8c9f677c3b 100644 (file)
@@ -18,10 +18,7 @@ CLASS(Model, Object)
     }
     METHOD(Model, model_precache, void(entity this)) {
         string s = this.model_str();
-        int fh = fopen(s, FILE_READ);
-        if (fh >= 0) {
-            fclose(fh);
-        } else if (s && s != "" && s != "null") {
+        if (s != "" && s != "null" && !fexists(s)) {
             LOG_WARNINGF("Missing model: \"%s\"\n", s);
             return;
         }
index d2881e9ba98d8d1ff5336af4a656d5e0143ba4c0..0c99a34f0d5b4368603591637d2e672469b0cf8e 100644 (file)
@@ -422,8 +422,6 @@ bool M_Mage(int req)
                }
                case MR_PRECACHE:
                {
-                       precache_sound (W_Sound("grenade_impact"));
-                       precache_sound (W_Sound("tagexp1"));
                        return true;
                }
                #endif
index fb71c2f22279b199fa8f0f1c518f6de506f88ca5..fc4a694fcc84a337f9a80d574d88bb5fe8b4bd3a 100644 (file)
@@ -176,7 +176,6 @@ bool M_Spider(int req)
                }
                case MR_PRECACHE:
                {
-                       precache_sound (W_Sound("electro_fire2"));
                        return true;
                }
                #endif
index fedcf9fe571d6445a60fbc9ad10cffcce8844a25..771575c69b32fafa0cbbb958cd9fb59b099c662a 100644 (file)
@@ -163,13 +163,11 @@ MUTATOR_HOOKFUNCTION(casings, CSQC_Parse_TempEntity)
     RubbleLimit("casing", autocvar_cl_casings_maxcount, Casing_Delete);
 }
 
-STATIC_INIT(Casings)
-{
-    precache_sound(W_Sound("brass1"));
-    precache_sound(W_Sound("brass2"));
-    precache_sound(W_Sound("brass3"));
-    precache_sound(W_Sound("casings1"));
-    precache_sound(W_Sound("casings2"));
-    precache_sound(W_Sound("casings3"));
-}
+SOUND(BRASS1, W_Sound("brass1"));
+SOUND(BRASS2, W_Sound("brass2"));
+SOUND(BRASS3, W_Sound("brass3"));
+SOUND(CASINGS1, W_Sound("casings1"));
+SOUND(CASINGS2, W_Sound("casings2"));
+SOUND(CASINGS3, W_Sound("casings3"));
+
 #endif
diff --git a/qcsrc/common/sounds/sounds.inc b/qcsrc/common/sounds/sounds.inc
new file mode 100644 (file)
index 0000000..707c661
--- /dev/null
@@ -0,0 +1,186 @@
+// Global list of sounds
+
+string W_Sound(string w_snd);
+
+SOUND(ARC_FIRE, W_Sound("arc_fire"));
+SOUND(ARC_LOOP, W_Sound("arc_loop"));
+SOUND(ARC_LOOP_OVERHEAT, W_Sound("arc_loop_overheat"));
+SOUND(ARC_STOP, W_Sound("arc_stop"));
+SOUND(CAMPINGRIFLE_FIRE2, W_Sound("campingrifle_fire2"));
+SOUND(CAMPINGRIFLE_FIRE, W_Sound("campingrifle_fire"));
+SOUND(CRYLINK_FIRE2, W_Sound("crylink_fire2"));
+SOUND(CRYLINK_FIRE, W_Sound("crylink_fire"));
+SOUND(CRYLINK_IMPACT2, W_Sound("crylink_impact2"));
+SOUND(CRYLINK_IMPACT, W_Sound("crylink_impact"));
+SOUND(CRYLINK_LINKJOIN, W_Sound("crylink_linkjoin"));
+SOUND(DRYFIRE, W_Sound("dryfire"));
+SOUND(ELECTRO_BOUNCE, W_Sound("electro_bounce"));
+SOUND(ELECTRO_FIRE2, W_Sound("electro_fire2"));
+SOUND(ELECTRO_FIRE, W_Sound("electro_fire"));
+SOUND(ELECTRO_FLY, W_Sound("electro_fly"));
+SOUND(ELECTRO_IMPACT, W_Sound("electro_impact"));
+SOUND(ELECTRO_IMPACT_COMBO, W_Sound("electro_impact_combo"));
+SOUND(FIREBALL_FIRE2, W_Sound("fireball_fire2"));
+SOUND(FIREBALL_FIRE, W_Sound("fireball_fire"));
+SOUND(FIREBALL_FLY2, W_Sound("fireball_fly2"));
+SOUND(FIREBALL_FLY, W_Sound("fireball_fly"));
+SOUND(FIREBALL_IMPACT2, W_Sound("fireball_impact2"));
+SOUND(FIREBALL_PREFIRE2, W_Sound("fireball_prefire2"));
+SOUND(FLAC_FIRE, W_Sound("flac_fire"));
+SOUND(GRENADE_BOUNCE1, W_Sound("grenade_bounce1"));
+SOUND(GRENADE_BOUNCE2, W_Sound("grenade_bounce2"));
+SOUND(GRENADE_BOUNCE3, W_Sound("grenade_bounce3"));
+SOUND(GRENADE_BOUNCE4, W_Sound("grenade_bounce4"));
+SOUND(GRENADE_BOUNCE5, W_Sound("grenade_bounce5"));
+SOUND(GRENADE_BOUNCE6, W_Sound("grenade_bounce6"));
+SOUND(GRENADE_FIRE, W_Sound("grenade_fire"));
+SOUND(GRENADE_IMPACT, W_Sound("grenade_impact"));
+SOUND(GRENADE_STICK, W_Sound("grenade_stick"));
+SOUND(HAGAR_BEEP, W_Sound("hagar_beep"));
+SOUND(HAGAR_FIRE, W_Sound("hagar_fire"));
+SOUND(HAGAR_LOAD, W_Sound("hagar_load"));
+SOUND(HAGEXP1, W_Sound("hagexp1"));
+SOUND(HAGEXP2, W_Sound("hagexp2"));
+SOUND(HAGEXP3, W_Sound("hagexp3"));
+SOUND(HOOKBOMB_FIRE, W_Sound("hookbomb_fire"));
+SOUND(HOOKBOMB_IMPACT, W_Sound("hookbomb_impact"));
+SOUND(HOOK_FIRE, W_Sound("hook_fire"));
+SOUND(HOOK_IMPACT, W_Sound("hook_impact"));
+SOUND(LASERGUN_FIRE, W_Sound("lasergun_fire"));
+SOUND(LASERIMPACT, W_Sound("laserimpact"));
+SOUND(LGBEAM_FLY, W_Sound("lgbeam_fly"));
+SOUND(MINE_DET, W_Sound("mine_det"));
+SOUND(MINE_EXP, W_Sound("mine_exp"));
+SOUND(MINE_FIRE, W_Sound("mine_fire"));
+SOUND(MINE_STICK, W_Sound("mine_stick"));
+SOUND(MINE_TRIGGER, W_Sound("mine_trigger"));
+SOUND(MINSTANEXFIRE, W_Sound("minstanexfire"));
+SOUND(NEXCHARGE, W_Sound("nexcharge"));
+SOUND(NEXFIRE, W_Sound("nexfire"));
+SOUND(NEXIMPACT, W_Sound("neximpact"));
+SOUND(NEXWHOOSH1, W_Sound("nexwhoosh1"));
+SOUND(NEXWHOOSH2, W_Sound("nexwhoosh2"));
+SOUND(NEXWHOOSH3, W_Sound("nexwhoosh3"));
+SOUND(RELOAD, W_Sound("reload")); // until weapons have individual reload sounds, precache the reload sound here
+SOUND(RIC1, W_Sound("ric1"));
+SOUND(RIC2, W_Sound("ric2"));
+SOUND(RIC3, W_Sound("ric3"));
+SOUND(ROCKET_DET, W_Sound("rocket_det"));
+SOUND(ROCKET_FIRE, W_Sound("rocket_fire"));
+SOUND(ROCKET_FLY, W_Sound("rocket_fly"));
+SOUND(ROCKET_IMPACT, W_Sound("rocket_impact"));
+SOUND(ROCKET_MODE, W_Sound("rocket_mode"));
+SOUND(SEEKEREXP1, W_Sound("seekerexp1"));
+SOUND(SEEKEREXP2, W_Sound("seekerexp2"));
+SOUND(SEEKEREXP3, W_Sound("seekerexp3"));
+SOUND(SEEKER_FIRE, W_Sound("seeker_fire"));
+SOUND(SHOTGUN_FIRE, W_Sound("shotgun_fire"));
+SOUND(SHOTGUN_MELEE, W_Sound("shotgun_melee"));
+SOUND(STRENGTH_FIRE, W_Sound("strength_fire"));
+SOUND(TAGEXP1, W_Sound("tagexp1"));
+SOUND(TAGEXP2, W_Sound("tagexp2"));
+SOUND(TAGEXP3, W_Sound("tagexp3"));
+SOUND(TAG_FIRE, W_Sound("tag_fire"));
+SOUND(TAG_IMPACT, W_Sound("tag_impact"));
+SOUND(TAG_ROCKET_FLY, W_Sound("tag_rocket_fly"));
+SOUND(UNAVAILABLE, W_Sound("unavailable"));
+SOUND(UZI_FIRE, W_Sound("uzi_fire"));
+SOUND(WEAPONPICKUP, W_Sound("weaponpickup"));
+SOUND(WEAPONPICKUP_NEW_TOYS, W_Sound("weaponpickup_new_toys"));
+SOUND(WEAPON_SWITCH, W_Sound("weapon_switch"));
+
+SOUND(CTF_CAPTURE_RED, "ctf/red_capture.wav");
+SOUND(CTF_CAPTURE_BLUE, "ctf/blue_capture.wav");
+SOUND(CTF_CAPTURE_YELLOW, "ctf/yellow_capture.ogg");
+SOUND(CTF_CAPTURE_PINK, "ctf/pink_capture.ogg");
+
+SOUND(DOM_CLAIM, "domination/claim.wav");
+
+SOUND(KA_DROPPED, "keepaway/dropped.wav");
+SOUND(KA_PICKEDUP, "keepaway/pickedup.wav");
+SOUND(KA_RESPAWN, "keepaway/respawn.wav");
+SOUND(KA_TOUCH, "keepaway/touch.wav");
+
+SOUND(NB_SHOOT1, "nexball/shoot1.ogg");
+SOUND(NB_SHOOT2, "nexball/shoot2.ogg");
+
+SOUND(ONS_CONTROLPOINT_BUILD, "onslaught/controlpoint_build.ogg");
+SOUND(ONS_CONTROLPOINT_BUILT, "onslaught/controlpoint_built.ogg");
+SOUND(ONS_CONTROLPOINT_UNDERATTACK, "onslaught/controlpoint_underattack.ogg");
+SOUND(ONS_DAMAGEBLOCKEDBYSHIELD, "onslaught/damageblockedbyshield.wav");
+SOUND(ONS_ELECTRICITY_EXPLODE, "onslaught/electricity_explode.ogg");
+SOUND(ONS_GENERATOR_DECAY, "onslaught/generator_decay.ogg");
+SOUND(ONS_GENERATOR_UNDERATTACK, "onslaught/generator_underattack.ogg");
+SOUND(ONS_HIT1, "onslaught/ons_hit1.ogg");
+SOUND(ONS_HIT2, "onslaught/ons_hit2.ogg");
+SOUND(ONS_SPARK1, "onslaught/ons_spark1.ogg");
+SOUND(ONS_SPARK2, "onslaught/ons_spark2.ogg");
+SOUND(ONS_SHOCKWAVE, "onslaught/shockwave.ogg");
+
+SOUND(PORTO_BOUNCE, "porto/bounce.ogg");
+SOUND(PORTO_CREATE, "porto/create.ogg");
+SOUND(PORTO_EXPIRE, "porto/expire.ogg");
+SOUND(PORTO_EXPLODE, "porto/explode.ogg");
+SOUND(PORTO_FIRE, "porto/fire.ogg");
+SOUND(PORTO_UNSUPPORTED, "porto/unsupported.ogg");
+
+SOUND(TUR_PHASER, "turrets/phaser.ogg");
+
+SOUND(VEH_ALARM, "vehicles/alarm.wav");
+SOUND(VEH_ALARM_SHIELD, "vehicles/alarm_shield.wav");
+SOUND(VEH_MISSILE_ALARM, "vehicles/missile_alarm.wav");
+
+SOUND(VEH_RACER_BOOST, "vehicles/racer_boost.wav");
+SOUND(VEH_RACER_IDLE, "vehicles/racer_idle.wav");
+SOUND(VEH_RACER_MOVE, "vehicles/racer_move.wav");
+
+SOUND(VEH_RAPTOR_FLY, "vehicles/raptor_fly.wav");
+SOUND(VEH_RAPTOR_SPEED, "vehicles/raptor_speed.wav");
+
+SOUND(VEH_SPIDERBOT_DIE, "vehicles/spiderbot_die.wav");
+SOUND(VEH_SPIDERBOT_IDLE, "vehicles/spiderbot_idle.wav");
+SOUND(VEH_SPIDERBOT_JUMP, "vehicles/spiderbot_jump.wav");
+SOUND(VEH_SPIDERBOT_LAND, "vehicles/spiderbot_land.wav");
+SOUND(VEH_SPIDERBOT_STRAFE, "vehicles/spiderbot_strafe.wav");
+SOUND(VEH_SPIDERBOT_WALK, "vehicles/spiderbot_walk.wav");
+
+SOUND(NADE_BEEP, "overkill/grenadebip.ogg");
+
+SOUND(BUFF_LOST, "relics/relic_effect.wav");
+
+SOUND(POWEROFF, "misc/poweroff.wav");
+SOUND(POWERUP, "misc/powerup.ogg");
+SOUND(SHIELD_RESPAWN, "misc/shield_respawn.wav");
+SOUND(STRENGTH_RESPAWN, "misc/strength_respawn.wav");
+
+SOUND(ARMOR25, "misc/armor25.wav");
+SOUND(ARMORIMPACT, "misc/armorimpact.wav");
+SOUND(BODYIMPACT1, "misc/bodyimpact1.wav");
+SOUND(BODYIMPACT2, "misc/bodyimpact2.wav");
+
+SOUND(ITEMPICKUP, "misc/itempickup.ogg");
+SOUND(ITEMRESPAWNCOUNTDOWN, "misc/itemrespawncountdown.ogg");
+SOUND(ITEMRESPAWN, "misc/itemrespawn.ogg");
+SOUND(MEGAHEALTH, "misc/megahealth.ogg");
+
+SOUND(LAVA, "player/lava.wav");
+SOUND(SLIME, "player/slime.wav");
+
+SOUND(GIB, "misc/gib.wav");
+SOUND(GIB_SPLAT01, "misc/gib_splat01.wav");
+SOUND(GIB_SPLAT02, "misc/gib_splat02.wav");
+SOUND(GIB_SPLAT03, "misc/gib_splat03.wav");
+SOUND(GIB_SPLAT04, "misc/gib_splat04.wav");
+
+SOUND(HIT, "misc/hit.wav");
+SOUND(TYPEHIT, "misc/typehit.wav");
+
+SOUND(SPAWN, "misc/spawn.ogg");
+
+SOUND(TALK, "misc/talk.wav");
+
+SOUND(TELEPORT, "misc/teleport.ogg");
+
+SOUND(INVSHOT, "misc/invshot.wav");
+
+SOUND(JETPACK_FLY, "misc/jetpack_fly.ogg");
diff --git a/qcsrc/common/sounds/sounds.qh b/qcsrc/common/sounds/sounds.qh
new file mode 100644 (file)
index 0000000..6b6a8a1
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef SOUNDS_H
+#define SOUNDS_H
+
+#define SND(id) (SND_##id.sound_str())
+
+void RegisterSounds();
+const int MAX_SOUNDS = 128;
+entity SOUNDS[MAX_SOUNDS], SOUNDS_first, SOUNDS_last;
+int SOUNDS_COUNT;
+
+CLASS(Sound, Object)
+    ATTRIB(Sound, m_id, int, 0)
+    ATTRIB(Sound, sound_str, string(), func_null)
+    CONSTRUCTOR(Sound, string() path)
+    {
+        CONSTRUCT(Sound);
+        this.sound_str = path;
+    }
+    METHOD(Sound, sound_precache, void(entity this)) {
+        string s = this.sound_str();
+        if (s && s != "" && !fexists(strcat("sound/", s))) {
+            LOG_WARNINGF("Missing sound: \"%s\"\n", s);
+            return;
+        }
+        LOG_TRACEF("precache_sound(\"%s\")\n", s);
+        precache_sound(s);
+    }
+ENDCLASS(Sound)
+
+#define SOUND(name, path) \
+    string SND_##name##_get() { return path; } \
+    REGISTER(RegisterSounds, SND, SOUNDS, SOUNDS_COUNT, name, m_id, NEW(Sound, SND_##name##_get))
+REGISTER_REGISTRY(RegisterSounds)
+
+STATIC_INIT(RegisterSounds_precache) {
+    FOREACH(SOUNDS, true, LAMBDA({
+        it.sound_precache(it);
+    }));
+}
+
+SOUND(Null, "misc/null.wav");
+#include "sounds.inc"
+
+#endif
index 37c85ca65a36d4c13bdf02022710c954fee715d8..a75a806195fbf4faef52ee99f0b3757f3712b39c 100644 (file)
@@ -4,22 +4,6 @@
 entity turret_info[TUR_MAXCOUNT];
 entity dummy_turret_info;
 
-void turrets_common_precache()
-{
-       precache_sound (W_Sound("rocket_impact"));
-
-#ifdef SVQC
-       precache_sound(W_Sound("rocket_impact"));
-#endif
-
-#ifdef TURRET_DEBUG
-       precache_model ("models/pathlib/goodsquare.md3");
-       precache_model ("models/pathlib/badsquare.md3");
-       precache_model ("models/pathlib/square.md3");
-       precache_model ("models/pathlib/edge.md3");
-#endif
-}
-
 void register_turret(float id, float(float) func, float turretflags, vector min_s, vector max_s, string modelname, string headmodelname, string shortname, string mname)
 {
        entity e;
@@ -36,10 +20,6 @@ void register_turret(float id, float(float) func, float turretflags, vector min_
        e.maxs = max_s;
        e.model = strzone(strcat("models/turrets/", modelname));
        e.head_model = strzone(strcat("models/turrets/", headmodelname));
-
-       #ifndef MENUQC
-       turrets_common_precache();
-       #endif
 }
 float t_null(float dummy) { return 0; }
 void register_turrets_done()
index afecb7fa56a377d33f49c9df7ea03e8a799f702c..de6030deff75d6ef79d9e6d07f66b98bb9c1b3d1 100644 (file)
@@ -48,7 +48,6 @@ float t_machinegun(float req)
         }
         case TR_PRECACHE:
         {
-            precache_sound (W_Sound("uzi_fire"));
             return true;
         }
     }
index e1ddef3a9d359292e2e0ff09508e3b1e04681070..67d82dbf5eaff5b028e52809855dd180b302f778 100644 (file)
@@ -137,7 +137,6 @@ float t_phaser(float req)
         }
         case TR_PRECACHE:
         {
-            precache_sound ("turrets/phaser.wav");
             return true;
         }
     }
index 9e7b0cbe136255a0fd4a9a86c8a24d2db8165732..7f33fb5f28abf99cf70ddda4e3c7cfbef2f0da5f 100644 (file)
@@ -634,7 +634,6 @@ float t_walker(float req)
         }
         case TR_PRECACHE:
         {
-            precache_sound (W_Sound("rocket_impact"));
             return true;
         }
     }
index a054edde8a56748c5d10fcd4e8d5640ce4882a5a..a506a59fcd2808ac26419691fe3c1b5ca7f90b17 100644 (file)
@@ -271,15 +271,6 @@ string fstrunzone(string s)
        return sc;
 }
 
-bool fexists(string f)
-{
-    int fh = fopen(f, FILE_READ);
-    if (fh < 0)
-        return false;
-    fclose(fh);
-    return true;
-}
-
 // Databases (hash tables)
 const float DB_BUCKETS = 8192;
 void db_save(float db, string pFilename)
index 3f3b77ea3308c80749042021a1ba5a5389e6e8fa..6e26f171264eb1c1f1fda5ae170604e1b86ad98e 100644 (file)
 #ifndef MENUQC
 STATIC_INIT(vehicles_common_initialize)
 {
-#ifdef CSQC
-       precache_sound ("vehicles/alarm.wav");
-       precache_sound ("vehicles/alarm_shield.wav");
-#endif // CSQC
 #ifdef SVQC
-       precache_sound("onslaught/ons_hit2.wav");
-       precache_sound("onslaught/electricity_explode.wav");
-
        addstat(STAT_HUD, AS_INT, hud);
        addstat(STAT_VEHICLESTAT_HEALTH,  AS_INT, vehicle_health);
        addstat(STAT_VEHICLESTAT_SHIELD,  AS_INT, vehicle_shield);
index 62a6e850fdb2c4bcc1c2b7f5bb029b39d6451889..e3dd5334b6a2d0823d9e967431d82814eb0269d1 100644 (file)
@@ -856,14 +856,6 @@ bool v_racer(int req)
 
                case VR_PRECACHE:
                {
-               #ifdef SVQC
-                       precache_sound (W_Sound("lasergun_fire"));
-                       precache_sound (W_Sound("rocket_fire"));
-
-                       precache_sound ("vehicles/racer_idle.wav");
-                       precache_sound ("vehicles/racer_move.wav");
-                       precache_sound ("vehicles/racer_boost.wav");
-               #endif
                        return true;
                }
        }
index 96a84892cfb43cb02aabf6778df63f718729e5f4..a0162346808c801f680767f172f353f4d38f5da7 100644 (file)
@@ -969,10 +969,6 @@ float v_raptor(float req)
                }
                case VR_PRECACHE:
                {
-                       precache_sound ("vehicles/raptor_fly.wav");
-                       precache_sound ("vehicles/raptor_speed.wav");
-                       precache_sound ("vehicles/missile_alarm.wav");
-
                        return true;
                }
        }
index 7d03c7736f9547e99f18710a55b52ecd19581901..c641ec6022cd5ae14d5759c0a75bc2cbf58fb9a8 100644 (file)
@@ -925,15 +925,6 @@ float v_spiderbot(float req)
                }
                case VR_PRECACHE:
                {
-                       precache_sound (W_Sound("uzi_fire") );
-                       precache_sound (W_Sound("rocket_impact"));
-
-                       precache_sound ("vehicles/spiderbot_die.wav");
-                       precache_sound ("vehicles/spiderbot_idle.wav");
-                       precache_sound ("vehicles/spiderbot_jump.wav");
-                       precache_sound ("vehicles/spiderbot_strafe.wav");
-                       precache_sound ("vehicles/spiderbot_walk.wav");
-                       precache_sound ("vehicles/spiderbot_land.wav");
                        return true;
                }
        }
index 046298a4c4f97c7bd2111a74503b2ac7483d46c6..611af779620f1abd17ceead1fe9669423c96885b 100644 (file)
@@ -331,7 +331,16 @@ int GetAmmoStat(.int ammotype)
 
 string W_Sound(string w_snd)
 {
-       string output = strcat("weapons/", w_snd, ".wav");
+       #define extensions(X) X(wav) X(ogg)
+       #define tryext(ext) { if (fexists(strcat("sound/", output = strcat("weapons/", w_snd, "."#ext)))) break; }
+       string output;
+       do {
+               extensions(tryext);
+               #undef tryext
+               #undef extensions
+               output = strcat("weapons/", w_snd);
+       } while(0);
+
 #ifdef SVQC
        MUTATOR_CALLHOOK(WeaponSound, w_snd, output);
        return weapon_sound_output;
index a6a073099664a9afd8a5aef2ceefdc445faf78b9..c748e18379b3c159e0c37fb5b464f0ac0eba2a61 100644 (file)
@@ -716,10 +716,6 @@ bool W_Arc(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("arc_fire"));
-                       precache_sound(W_Sound("arc_loop"));
-                       precache_sound(W_Sound("arc_stop"));
-                       precache_sound(W_Sound("arc_loop_overheat"));
                        if(!arc_shotorigin[0])
                        {
                                arc_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC.m_id), false, false, 1);
@@ -1524,7 +1520,6 @@ bool W_Arc(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("arc_loop"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index b20713c029d0f2464133a96a031a7002edb90d14..ba28f8277b61670e86b21b33828e312da1a6dc47 100644 (file)
@@ -223,7 +223,6 @@ bool W_Blaster(int request)
 
                case WR_INIT:
                {
-                       precache_sound(W_Sound("lasergun_fire"));
                        BLASTER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -275,7 +274,6 @@ bool W_Blaster(int request)
 
                case WR_INIT:
                {
-                       precache_sound(W_Sound("laserimpact"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index 6821d5a0e1adbf98999c7542fd26aafccf6857e7..78c7dc8b2b6f603bd32c93b157d0fac67029b15d 100644 (file)
@@ -638,9 +638,6 @@ bool W_Crylink(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("crylink_fire"));
-                       precache_sound(W_Sound("crylink_fire2"));
-                       precache_sound(W_Sound("crylink_linkjoin"));
                        CRYLINK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -712,8 +709,6 @@ bool W_Crylink(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("crylink_impact2"));
-                       precache_sound(W_Sound("crylink_impact"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index cb2d16659c4b2e71fd518e4d58261beb580cfd22..86a1ba10e8c596994226415d2148fe422ed3e69f 100644 (file)
@@ -567,12 +567,6 @@ bool W_Devastator(int req)
                }
                case WR_INIT:
                {
-                       //if(autocvar_sv_precacheweapons)
-                       //{
-                               precache_sound(W_Sound("rocket_det"));
-                               precache_sound(W_Sound("rocket_fire"));
-                               precache_sound(W_Sound("rocket_mode"));
-                       //}
                        DEVASTATOR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -668,7 +662,6 @@ bool W_Devastator(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("rocket_impact"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index 7f02a00ce2013542972aae39d2674b564ed53a09..08febe047f602ee1aa4322b4369e3cf428006d9b 100644 (file)
@@ -498,11 +498,6 @@ bool W_Electro(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("electro_bounce"));
-                       precache_sound(W_Sound("electro_fire"));
-                       precache_sound(W_Sound("electro_fire2"));
-                       precache_sound(W_Sound("electro_impact"));
-                       precache_sound(W_Sound("electro_impact_combo"));
                        ELECTRO_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -602,8 +597,6 @@ bool W_Electro(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("electro_impact"));
-                       precache_sound(W_Sound("electro_impact_combo"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index a37ae8f0997c4bc825ec7a7b01f99d4cbf5110e0..e8da0a1997e37aa5dbbe0badd01a60fa7a1e7009 100644 (file)
@@ -399,9 +399,6 @@ bool W_Fireball(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("fireball_fire"));
-                       precache_sound(W_Sound("fireball_fire2"));
-                       precache_sound(W_Sound("fireball_prefire2"));
                        FIREBALL_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -467,7 +464,6 @@ bool W_Fireball(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("fireball_impact2"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index d55a1b6072e3943369e5b64d71715f56da4e83a3..882781a2b7f2301c1ee2e51ed823639a40f9fbd7 100644 (file)
@@ -451,9 +451,6 @@ bool W_Hagar(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("hagar_fire"));
-                       precache_sound(W_Sound("hagar_load"));
-                       precache_sound(W_Sound("hagar_beep"));
                        HAGAR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -545,9 +542,6 @@ bool W_Hagar(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("hagexp1"));
-                       precache_sound(W_Sound("hagexp2"));
-                       precache_sound(W_Sound("hagexp3"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index 074b76053882051306d3daac23a1f78f127537d1..dffd5e4df07c3315e1e0261c545dbba7f42d97c6 100644 (file)
@@ -241,7 +241,6 @@ bool W_HLAC(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("lasergun_fire"));
                        HLAC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -296,7 +295,6 @@ bool W_HLAC(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("laserimpact"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index c55304118b678a4e9f1e60fb8f4e209d9efb8e2f..8afb8ab801d715263925d06d77ee65dbf5b8c945 100644 (file)
@@ -118,7 +118,6 @@ bool W_HeavyMachineGun(int req)
                }
                case WR_INIT:
                {
-                       precache_sound (W_Sound("uzi_fire"));
                        HMG_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -187,9 +186,6 @@ bool W_HeavyMachineGun(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("ric1"));
-                       precache_sound(W_Sound("ric2"));
-                       precache_sound(W_Sound("ric3"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index b7f51b54c4319c66590ef942576399b2a898ddd4..fff06f15f9f04c2b09033e872cc98b8620aa7f8e 100644 (file)
@@ -288,9 +288,6 @@ bool W_Hook(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("hook_impact")); // done by g_hook.qc
-                       precache_sound(W_Sound("hook_fire"));
-                       precache_sound(W_Sound("hookbomb_fire"));
                        HOOK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -350,7 +347,6 @@ bool W_Hook(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("hookbomb_impact"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index 01efced0f5b1f1bca56f31ff70cb674d2d8f44aa..dcad706f91c09eed5921c00391816fee9cdff792 100644 (file)
@@ -304,7 +304,6 @@ bool W_MachineGun(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("uzi_fire"));
                        MACHINEGUN_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -387,9 +386,6 @@ bool W_MachineGun(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("ric1"));
-                       precache_sound(W_Sound("ric2"));
-                       precache_sound(W_Sound("ric3"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index 1c7e89fde2924574374d1399b4df8ab8763f973f..0e72161753583cbb7db52358173e4316c08a806b 100644 (file)
@@ -530,10 +530,6 @@ bool W_MineLayer(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("mine_det"));
-                       precache_sound(W_Sound("mine_fire"));
-                       precache_sound(W_Sound("mine_stick"));
-                       precache_sound(W_Sound("mine_trigger"));
                        MINELAYER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -599,7 +595,6 @@ bool W_MineLayer(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("mine_exp"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index d03eb8e565d4080cdf16200dc467ee5f7acff880..99d4446953bb56641633defd0d5e8d660a1a2af4 100644 (file)
@@ -405,14 +405,6 @@ bool W_Mortar(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("grenade_bounce1"));
-                       precache_sound(W_Sound("grenade_bounce2"));
-                       precache_sound(W_Sound("grenade_bounce3"));
-                       precache_sound(W_Sound("grenade_bounce4"));
-                       precache_sound(W_Sound("grenade_bounce5"));
-                       precache_sound(W_Sound("grenade_bounce6"));
-                       precache_sound(W_Sound("grenade_stick"));
-                       precache_sound(W_Sound("grenade_fire"));
                        MORTAR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -473,7 +465,6 @@ bool W_Mortar(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("grenade_impact"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index 58c28716aebc025c15edfb5656beb79f4eca7879..0f87f82a691860991ad3dfc2ec94a3c7a9e66033 100644 (file)
@@ -373,12 +373,6 @@ bool W_Porto(int req)
                }
                case WR_INIT:
                {
-                       precache_sound("porto/bounce.wav");
-                       precache_sound("porto/create.wav");
-                       precache_sound("porto/expire.wav");
-                       precache_sound("porto/explode.wav");
-                       precache_sound("porto/fire.wav");
-                       precache_sound("porto/unsupported.wav");
                        PORTO_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
index 66be38175f19fbabf8e57fde0e58ae93860411ae..fd2c1a0e8184d87361e6d045ec759a017665a0b5 100644 (file)
@@ -204,8 +204,6 @@ bool W_Rifle(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("campingrifle_fire"));
-                       precache_sound(W_Sound("campingrifle_fire2"));
                        RIFLE_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -285,9 +283,6 @@ bool W_Rifle(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("ric1"));
-                       precache_sound(W_Sound("ric2"));
-                       precache_sound(W_Sound("ric3"));
                        if(autocvar_cl_reticle && autocvar_cl_reticle_weapon)
                        {
                                precache_pic("gfx/reticle_nex");
index 51c0404405eef0a110ffc40376189f11dc848808..f6abe5c1e0c8947cada59790fe83c63871211d40 100644 (file)
@@ -182,7 +182,6 @@ bool W_RocketPropelledChainsaw(int req)
                }
                case WR_INIT:
                {
-                       precache_sound (W_Sound("rocket_fire"));
                        RPC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -245,7 +244,6 @@ bool W_RocketPropelledChainsaw(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("rocket_impact"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index 0687437afb10ad9e685c1a280d9f59c4a3a33073..54c4bb464193f9b1cfba7189fe3c57eb254f055f 100644 (file)
@@ -662,9 +662,6 @@ bool W_Seeker(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("tag_fire"));
-                       precache_sound(W_Sound("flac_fire"));
-                       precache_sound(W_Sound("seeker_fire"));
                        SEEKER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -768,13 +765,6 @@ bool W_Seeker(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("seekerexp1"));
-                       precache_sound(W_Sound("seekerexp2"));
-                       precache_sound(W_Sound("seekerexp3"));
-                       precache_sound(W_Sound("tagexp1"));
-                       precache_sound(W_Sound("tagexp2"));
-                       precache_sound(W_Sound("tagexp3"));
-                       precache_sound(W_Sound("tag_impact"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index b56a41fbbf25151c3275b9c6b5d80383f3367ac7..a0451d87eedecc2a95db73cad2dfb7c04cfefec2 100644 (file)
@@ -708,9 +708,6 @@ bool W_Shockwave(int req)
                }
                case WR_INIT:
                {
-                       precache_sound("misc/itempickup.wav");
-                       precache_sound(W_Sound("lasergun_fire"));
-                       precache_sound(W_Sound("shotgun_melee"));
                        SHOCKWAVE_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -875,9 +872,6 @@ bool W_Shockwave(int req)
                }
                case WR_INIT:
                {
-                       //precache_sound(W_Sound("ric1"));
-                       //precache_sound(W_Sound("ric2"));
-                       //precache_sound(W_Sound("ric3"));
                        return false;
                }
                case WR_ZOOMRETICLE:
index 814d5730368d3ec40c1bb3c405efee9a492d001e..ad4d8cc43cf767c098caa28b743a0ee0e3d06b24 100644 (file)
@@ -286,9 +286,6 @@ float W_Shotgun(float req)
                }
                case WR_INIT:
                {
-                       precache_sound("misc/itempickup.wav");
-                       precache_sound(W_Sound("shotgun_fire"));
-                       precache_sound(W_Sound("shotgun_melee"));
                        SHOTGUN_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -371,9 +368,6 @@ float W_Shotgun(float req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("ric1"));
-                       precache_sound(W_Sound("ric2"));
-                       precache_sound(W_Sound("ric3"));
                        return true;
                }
                case WR_ZOOMRETICLE:
index 13c3fef8c691c228a1d55cbc5e6784df94d157b4..601773fdc5297d0fe76d1fe3f59c7cbc2ecc78bc 100644 (file)
@@ -362,10 +362,6 @@ float W_Vaporizer(float req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("minstanexfire"));
-                       precache_sound(W_Sound("nexwhoosh1"));
-                       precache_sound(W_Sound("nexwhoosh2"));
-                       precache_sound(W_Sound("nexwhoosh3"));
                        //W_Blaster(WR_INIT); // Samual: Is this really the proper thing to do? Didn't we already run this previously?
                        VAPORIZER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
@@ -445,8 +441,6 @@ float W_Vaporizer(float req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("laserimpact"));
-                       precache_sound(W_Sound("neximpact"));
                        if(autocvar_cl_reticle && autocvar_cl_reticle_weapon)
                        {
                                precache_pic("gfx/reticle_nex");
index 2e515137c59ab5ff64eacf07775c3b4465469f0d..0ba4a2642e229eb4e65d46fb0bf5aa06ab82f45a 100644 (file)
@@ -253,11 +253,6 @@ bool W_Vortex(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("nexfire"));
-                       precache_sound(W_Sound("nexcharge"));
-                       precache_sound(W_Sound("nexwhoosh1"));
-                       precache_sound(W_Sound("nexwhoosh2"));
-                       precache_sound(W_Sound("nexwhoosh3"));
                        VORTEX_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -331,7 +326,6 @@ bool W_Vortex(int req)
                }
                case WR_INIT:
                {
-                       precache_sound(W_Sound("neximpact"));
                        if(autocvar_cl_reticle && autocvar_cl_reticle_weapon)
                        {
                                precache_pic("gfx/reticle_nex");
index aa541bd69e28204a0c0c074a3c298ace20fcd38c..5bc9c1b4c6dd32897405708b6231dbe15ec5c665 100644 (file)
@@ -7,6 +7,7 @@
 #include "cvar.qh"
 #include "defer.qh"
 #include "draw.qh"
+#include "file.qh"
 #include "i18n.qh"
 #include "lazy.qh"
 #include "log.qh"
diff --git a/qcsrc/lib/file.qh b/qcsrc/lib/file.qh
new file mode 100644 (file)
index 0000000..f732bfe
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef FILE_H
+#define FILE_H
+
+bool fexists(string f)
+{
+    int fh = fopen(f, FILE_READ);
+    if (fh < 0)
+        return false;
+    fclose(fh);
+    return true;
+}
+
+#endif
index 9d7617e006f9621665a4f4cb999181b25a7bde1f..d3771bafc88846e6c8982f3f62482c8daf99ad96 100644 (file)
@@ -10,5 +10,6 @@
 #include "../dpdefs/dpextensions.qh"
 
 #include "../common/models/models.qh"
+#include "../common/sounds/sounds.qh"
 
 #endif
index 356a2b74af2c765bf04528b55fa4a27568d1a04f..e401b53cfee46cbcfa343645dea901515709f83c 100644 (file)
@@ -1011,36 +1011,8 @@ void precache()
     }
 
     // gore and miscellaneous sounds
-    //precache_sound ("misc/h2ohit.wav");
-    precache_sound ("misc/armorimpact.wav");
-    precache_sound ("misc/bodyimpact1.wav");
-    precache_sound ("misc/bodyimpact2.wav");
-    precache_sound ("misc/gib.wav");
-    precache_sound ("misc/gib_splat01.wav");
-    precache_sound ("misc/gib_splat02.wav");
-    precache_sound ("misc/gib_splat03.wav");
-    precache_sound ("misc/gib_splat04.wav");
     PrecacheGlobalSound((globalsound_fall = "misc/hitground 4"));
     PrecacheGlobalSound((globalsound_metalfall = "misc/metalhitground 4"));
-    precache_sound ("misc/null.wav");
-    precache_sound ("misc/spawn.wav");
-    precache_sound ("misc/talk.wav");
-    precache_sound ("misc/teleport.wav");
-    precache_sound ("misc/poweroff.wav");
-    precache_sound ("player/lava.wav");
-    precache_sound ("player/slime.wav");
-
-    // common weapon precaches
-       precache_sound (W_Sound("reload")); // until weapons have individual reload sounds, precache the reload sound here
-    precache_sound (W_Sound("weapon_switch"));
-    precache_sound (W_Sound("weaponpickup"));
-    precache_sound (W_Sound("unavailable"));
-    precache_sound (W_Sound("dryfire"));
-    if (g_grappling_hook)
-    {
-        precache_sound (W_Sound("hook_fire")); // hook
-        precache_sound (W_Sound("hook_impact")); // hook
-    }
 
 #if 0
     // Disabled this code because it simply does not work (e.g. ignores bgmvolume, overlaps with "cd loop" controlled tracks).
@@ -1055,8 +1027,6 @@ void precache()
         ambientsound ('0 0 0', self.noise, VOL_BASE, ATTEN_NONE);
     }
 #endif
-
-#include "precache-for-csqc.inc"
 }
 
 
index 6fa778309f44f1b22a09bf55a844f1a773248a2e..dbf8e1ef8fe750db001eddf130896137c328c3d1 100644 (file)
@@ -622,8 +622,6 @@ void dom_DelayedInit() // Do this check with a delay so we can wait for teams to
 
 void dom_Initialize()
 {
-       precache_sound("domination/claim.wav");
-
        InitializeEntity(world, dom_DelayedInit, INITPRIO_GAMETYPE);
 }
 
index 6d7c8c99014567a349791a5845ef1a655ea456e0..e0d4fd954e89496b637303fa43189aa76c6a3f12 100644 (file)
@@ -428,11 +428,6 @@ void ka_Initialize() // run at the start of a match, initiates game mode
        if(!g_keepaway)
                return;
 
-       precache_sound("keepaway/pickedup.wav");
-       precache_sound("keepaway/dropped.wav");
-       precache_sound("keepaway/respawn.wav");
-       precache_sound("keepaway/touch.wav");
-
        ka_ScoreRules();
        ka_SpawnBall();
 }
index e3480a42e037dcdbf956b58e3daa2ab2eac893c9..1d159cea77452bcdbe7b663247cb05348cb22277 100644 (file)
@@ -860,9 +860,6 @@ float w_nexball_weapon(float req)
        }
        else if(req == WR_INIT)
        {
-               precache_sound("nexball/shoot1.wav");
-               precache_sound("nexball/shoot2.wav");
-               precache_sound("misc/typehit.wav");
        }
        else if(req == WR_SETUP)
        {
index e5d127748bb33edf212a67f98100865c698d1c38..bcdb833b0b20155ce7d726d21933af827d5b407e 100644 (file)
@@ -751,15 +751,6 @@ void ons_ControlPoint_Setup(entity cp)
 
        if(cp.message == "") { cp.message = "a"; }
 
-       // precache - TODO: clean up!
-       precache_sound("onslaught/controlpoint_build.wav");
-       precache_sound("onslaught/controlpoint_built.wav");
-       precache_sound(W_Sound("grenade_impact"));
-       precache_sound("onslaught/damageblockedbyshield.wav");
-       precache_sound("onslaught/controlpoint_underattack.wav");
-       precache_sound("onslaught/ons_spark1.wav");
-       precache_sound("onslaught/ons_spark2.wav");
-
        // appearence
        setmodel_fixsize(cp, MDL_ONS_CP_PAD1);
 
@@ -1008,16 +999,6 @@ void ons_GeneratorSetup(entity gen) // called when spawning a generator entity o
        gen.isshielded = true;
        gen.touch = onslaught_generator_touch;
 
-       // precache - TODO: clean up!
-       precache_sound("onslaught/generator_decay.wav");
-       precache_sound(W_Sound("grenade_impact"));
-       precache_sound(W_Sound("rocket_impact"));
-       precache_sound("onslaught/generator_underattack.wav");
-       precache_sound("onslaught/shockwave.wav");
-       precache_sound("onslaught/ons_hit1.wav");
-       precache_sound("onslaught/ons_hit2.wav");
-       precache_sound("onslaught/generator_underattack.wav");
-
        // appearence
        // model handled by CSQC
        setsize(gen, GENERATOR_MIN, GENERATOR_MAX);
@@ -2114,11 +2095,6 @@ void ons_DelayedInit() // Do this check with a delay so we can wait for teams to
 
 void ons_Initialize()
 {
-       precache_sound("ctf/red_capture.wav");
-       precache_sound("ctf/blue_capture.wav");
-       precache_sound("ctf/yellow_capture.wav");
-       precache_sound("ctf/pink_capture.wav");
-
        ons_captureshield_force = autocvar_g_onslaught_shield_force;
 
        addstat(STAT_ROUNDLOST, AS_INT, ons_roundlost);
index 79004e1c4163898d4c021d89fa2d2213564e5793..38181fd53799a29c6de6ef00180d1230864810ad 100644 (file)
@@ -957,12 +957,6 @@ void buffs_DelayedInit()
 
 void buffs_Initialize()
 {
-       precache_sound("misc/strength_respawn.wav");
-       precache_sound("misc/shield_respawn.wav");
-       precache_sound("relics/relic_effect.wav");
-       precache_sound(W_Sound("rocket_impact"));
-       precache_sound("keepaway/respawn.wav");
-
        addstat(STAT_BUFFS, AS_INT, buffs);
        addstat(STAT_BUFF_TIME, AS_FLOAT, buff_time);
 
index 99c785482591566d980e983541454aa9def1dcee..a1f55c297fcc2e96add2cc63cba2866271ac1d7e 100644 (file)
@@ -1198,15 +1198,6 @@ void nades_Initialize()
        addstat(STAT_NADE_BONUS_SCORE, AS_FLOAT, bonus_nade_score);
        addstat(STAT_HEALING_ORB, AS_FLOAT, stat_healing_orb);
        addstat(STAT_HEALING_ORB_ALPHA, AS_FLOAT, stat_healing_orb_alpha);
-
-       precache_sound(W_Sound("rocket_impact"));
-       precache_sound(W_Sound("grenade_bounce1"));
-       precache_sound(W_Sound("grenade_bounce2"));
-       precache_sound(W_Sound("grenade_bounce3"));
-       precache_sound(W_Sound("grenade_bounce4"));
-       precache_sound(W_Sound("grenade_bounce5"));
-       precache_sound(W_Sound("grenade_bounce6"));
-       precache_sound("overkill/grenadebip.ogg");
 }
 
 MUTATOR_DEFINITION(mutator_nades)
index 172ee4d651430b2d8a6e08458f54cfb71a4f17f9..b8891b2834b5b0a1ef456882311902c7e95ab023 100644 (file)
@@ -207,8 +207,6 @@ MUTATOR_DEFINITION(mutator_new_toys)
                if(time > 1) // game loads at time 1
                        error("This cannot be added at runtime\n");
 
-               precache_sound(W_Sound("weaponpickup_new_toys"));
-
                // mark the guns as ok to use by e.g. impulse 99
                float i;
                for(i = WEP_FIRST; i <= WEP_LAST; ++i)
index 5b7018b303c595be7813fe4e666625c34030346c..0aef8e9a06540ff6222fea1a4e1d05c9b3dc2d2b 100644 (file)
@@ -316,8 +316,6 @@ void ok_Initialize()
 
        precache_all_playermodels("models/ok_player/*.dpm");
 
-       precache_sound(W_Sound("dryfire"));
-
        addstat(STAT_OK_AMMO_CHARGE, AS_FLOAT, ok_use_ammocharge);
        addstat(STAT_OK_AMMO_CHARGEPOOL, AS_FLOAT, ok_ammo_charge);
 
index 0fbbf2732ed8545401b320a2fc00ec39c74ee1a5..8b5978d96412bac3130d3b1d150d72199f778581 100644 (file)
@@ -1119,14 +1119,6 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                precache_model (self.model);
                precache_sound (self.item_pickupsound);
 
-               precache_sound ("misc/itemrespawncountdown.wav");
-               if(itemid == ITEM_Strength.m_itemid)
-                       precache_sound ("misc/strength_respawn.wav");
-               else if(itemid == ITEM_Shield.m_itemid)
-                       precache_sound ("misc/shield_respawn.wav");
-               else
-                       precache_sound ("misc/itemrespawn.wav");
-
                if((itemflags & (FL_POWERUP | FL_WEAPON)) || (itemid & (IT_HEALTH | IT_ARMOR | IT_KEY1 | IT_KEY2)))
                        self.target = "###item###"; // for finding the nearest item using find()
 
@@ -1371,7 +1363,6 @@ void spawnfunc_item_health100() { spawnfunc_item_health_mega(); }
 
 void spawnfunc_item_strength()
 {SELFPARAM();
-               precache_sound("weapons/strength_fire.wav");
                if(!self.strength_finished)
                        self.strength_finished = autocvar_g_balance_powerup_strength_time;
                StartItemA (ITEM_Strength);
@@ -1425,13 +1416,6 @@ void spawnfunc_target_items (void)
        if(!self.superweapons_finished)
                self.superweapons_finished = autocvar_g_balance_superweapons_time;
 
-       precache_sound("misc/itempickup.wav");
-       precache_sound("misc/megahealth.wav");
-       precache_sound("misc/armor25.wav");
-       precache_sound("misc/powerup.wav");
-       precache_sound("misc/poweroff.wav");
-       precache_sound(W_Sound("weaponpickup"));
-
        n = tokenize_console(self.netname);
        if(argv(0) == "give")
        {