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.*
@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
#include "../dpdefs/csprogsdefs.qh"
#include "../common/models/models.qh"
+#include "../common/sounds/sounds.qh"
#endif
#include "../common/movetypes/movetypes.qh"
.float alpha;
-bool cpicon_precached;
.int count;
.float pain_finished;
.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; }
self.count = (self.health - self.max_health) * frametime;
cpicon_changeteam();
- cpicon_precache();
cpicon_construct();
}
const int CPSF_SETUP = 8;
void ent_cpicon();
-void cpicon_precache();
#endif
-#include "csqcmodel_hooks.qh"
#include "_all.qh"
#include "gibs.qh"
}
}
-void CSQCPlayer_Precache()
-{
- precache_sound("misc/jetpack_fly.wav");
-}
-
// general functions
.int csqcmodel_predraw_run;
.int anim_frame;
+++ /dev/null
-#ifndef CSQCMODEL_HOOKS
-#define CSQCMODEL_HOOKS
-
-void CSQCPlayer_Precache();
-
-#endif
#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)
self.count = 40;
generator_changeteam();
- generator_precache();
generator_construct();
}
const int GSF_SETUP = 8;
void ent_generator();
-void generator_precache();
#endif
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");
-}
void Ent_GibSplash(bool isNew);
-void GibSplash_Precache();
#endif
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!
#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);
#include "_all.qh"
#include "controlpoint.qh"
-#include "csqcmodel_hooks.qh"
#include "damage.qh"
#include "effects.qh"
#include "generator.qh"
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)
{
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; }
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);
}
+++ /dev/null
-#!/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
-
}
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;
}
}
case MR_PRECACHE:
{
- precache_sound (W_Sound("grenade_impact"));
- precache_sound (W_Sound("tagexp1"));
return true;
}
#endif
}
case MR_PRECACHE:
{
- precache_sound (W_Sound("electro_fire2"));
return true;
}
#endif
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
--- /dev/null
+// 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");
--- /dev/null
+#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
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;
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()
}
case TR_PRECACHE:
{
- precache_sound (W_Sound("uzi_fire"));
return true;
}
}
}
case TR_PRECACHE:
{
- precache_sound ("turrets/phaser.wav");
return true;
}
}
}
case TR_PRECACHE:
{
- precache_sound (W_Sound("rocket_impact"));
return true;
}
}
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)
#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);
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;
}
}
}
case VR_PRECACHE:
{
- precache_sound ("vehicles/raptor_fly.wav");
- precache_sound ("vehicles/raptor_speed.wav");
- precache_sound ("vehicles/missile_alarm.wav");
-
return true;
}
}
}
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;
}
}
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;
}
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);
}
case WR_INIT:
{
- precache_sound(W_Sound("arc_loop"));
return true;
}
case WR_ZOOMRETICLE:
case WR_INIT:
{
- precache_sound(W_Sound("lasergun_fire"));
BLASTER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
return true;
}
case WR_INIT:
{
- precache_sound(W_Sound("laserimpact"));
return true;
}
case WR_ZOOMRETICLE:
}
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;
}
}
case WR_INIT:
{
- precache_sound(W_Sound("crylink_impact2"));
- precache_sound(W_Sound("crylink_impact"));
return true;
}
case WR_ZOOMRETICLE:
}
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;
}
}
case WR_INIT:
{
- precache_sound(W_Sound("rocket_impact"));
return true;
}
case WR_ZOOMRETICLE:
}
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;
}
}
case WR_INIT:
{
- precache_sound(W_Sound("electro_impact"));
- precache_sound(W_Sound("electro_impact_combo"));
return true;
}
case WR_ZOOMRETICLE:
}
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;
}
}
case WR_INIT:
{
- precache_sound(W_Sound("fireball_impact2"));
return true;
}
case WR_ZOOMRETICLE:
}
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;
}
}
case WR_INIT:
{
- precache_sound(W_Sound("hagexp1"));
- precache_sound(W_Sound("hagexp2"));
- precache_sound(W_Sound("hagexp3"));
return true;
}
case WR_ZOOMRETICLE:
}
case WR_INIT:
{
- precache_sound(W_Sound("lasergun_fire"));
HLAC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
return true;
}
}
case WR_INIT:
{
- precache_sound(W_Sound("laserimpact"));
return true;
}
case WR_ZOOMRETICLE:
}
case WR_INIT:
{
- precache_sound (W_Sound("uzi_fire"));
HMG_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
return true;
}
}
case WR_INIT:
{
- precache_sound(W_Sound("ric1"));
- precache_sound(W_Sound("ric2"));
- precache_sound(W_Sound("ric3"));
return true;
}
case WR_ZOOMRETICLE:
}
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;
}
}
case WR_INIT:
{
- precache_sound(W_Sound("hookbomb_impact"));
return true;
}
case WR_ZOOMRETICLE:
}
case WR_INIT:
{
- precache_sound(W_Sound("uzi_fire"));
MACHINEGUN_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
return true;
}
}
case WR_INIT:
{
- precache_sound(W_Sound("ric1"));
- precache_sound(W_Sound("ric2"));
- precache_sound(W_Sound("ric3"));
return true;
}
case WR_ZOOMRETICLE:
}
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;
}
}
case WR_INIT:
{
- precache_sound(W_Sound("mine_exp"));
return true;
}
case WR_ZOOMRETICLE:
}
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;
}
}
case WR_INIT:
{
- precache_sound(W_Sound("grenade_impact"));
return true;
}
case WR_ZOOMRETICLE:
}
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;
}
}
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;
}
}
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");
}
case WR_INIT:
{
- precache_sound (W_Sound("rocket_fire"));
RPC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
return true;
}
}
case WR_INIT:
{
- precache_sound(W_Sound("rocket_impact"));
return true;
}
case WR_ZOOMRETICLE:
}
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;
}
}
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:
}
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;
}
}
case WR_INIT:
{
- //precache_sound(W_Sound("ric1"));
- //precache_sound(W_Sound("ric2"));
- //precache_sound(W_Sound("ric3"));
return false;
}
case WR_ZOOMRETICLE:
}
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;
}
}
case WR_INIT:
{
- precache_sound(W_Sound("ric1"));
- precache_sound(W_Sound("ric2"));
- precache_sound(W_Sound("ric3"));
return true;
}
case WR_ZOOMRETICLE:
}
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;
}
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");
}
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;
}
}
case WR_INIT:
{
- precache_sound(W_Sound("neximpact"));
if(autocvar_cl_reticle && autocvar_cl_reticle_weapon)
{
precache_pic("gfx/reticle_nex");
#include "cvar.qh"
#include "defer.qh"
#include "draw.qh"
+#include "file.qh"
#include "i18n.qh"
#include "lazy.qh"
#include "log.qh"
--- /dev/null
+#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
#include "../dpdefs/dpextensions.qh"
#include "../common/models/models.qh"
+#include "../common/sounds/sounds.qh"
#endif
}
// 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).
ambientsound ('0 0 0', self.noise, VOL_BASE, ATTEN_NONE);
}
#endif
-
-#include "precache-for-csqc.inc"
}
void dom_Initialize()
{
- precache_sound("domination/claim.wav");
-
InitializeEntity(world, dom_DelayedInit, INITPRIO_GAMETYPE);
}
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();
}
}
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)
{
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);
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);
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);
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);
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)
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)
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);
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()
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);
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")
{