]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Sounds: infer extensions
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 3 Nov 2015 09:47:21 +0000 (20:47 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 3 Nov 2015 09:47:21 +0000 (20:47 +1100)
qcsrc/client/tuba.qc
qcsrc/common/items/item/armor.qc
qcsrc/common/items/item/health.qc
qcsrc/common/items/item/powerup.qc
qcsrc/common/mutators/mutator/instagib/items.qc
qcsrc/common/sounds/all.inc
qcsrc/common/sounds/all.qh
qcsrc/common/sounds/sound.qh
qcsrc/common/weapons/all.qc
qcsrc/server/t_items.qc

index ed2964936a3bd3942ba90cf1af2921c5d5197fcd..68858ab5203a27bb31252ff8fd8b461a51fccf37 100644 (file)
@@ -3,7 +3,7 @@
 #include "../common/constants.qh"
 
 
-#define TUBA_STARTNOTE(i, n) W_Sound(strcat("tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n)))
+#define TUBA_STARTNOTE(i, n) _Sound_fixpath(W_Sound(strcat("tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n))))
 
 const int TUBA_MIN = -18;
 const int TUBA_MAX = 27;
index bea60a49e1837e8883fcfaa440bd895e61805740..5bd550838aab3f40b93d7552fad04a96c13b437a 100644 (file)
@@ -5,7 +5,7 @@
 
 #ifndef MENUQC
 MODEL(ArmorSmall_ITEM, Item_Model("item_armor_small.md3"));
-SOUND(ArmorSmall, "misc/armor1.wav");
+SOUND(ArmorSmall, "misc/armor1");
 #endif
 
 REGISTER_ITEM(ArmorSmall, Armor) {
@@ -25,7 +25,7 @@ REGISTER_ITEM(ArmorSmall, Armor) {
 
 #ifndef MENUQC
 MODEL(ArmorMedium_ITEM, Item_Model("item_armor_medium.md3"));
-SOUND(ArmorMedium, "misc/armor10.wav");
+SOUND(ArmorMedium, "misc/armor10");
 #endif
 
 REGISTER_ITEM(ArmorMedium, Armor) {
@@ -45,7 +45,7 @@ REGISTER_ITEM(ArmorMedium, Armor) {
 
 #ifndef MENUQC
 MODEL(ArmorLarge_ITEM, Item_Model("item_armor_big.md3"));
-SOUND(ArmorLarge, "misc/armor17_5.wav");
+SOUND(ArmorLarge, "misc/armor17_5");
 #endif
 
 REGISTER_ITEM(ArmorLarge, Armor) {
@@ -67,7 +67,7 @@ REGISTER_ITEM(ArmorLarge, Armor) {
 
 #ifndef MENUQC
 MODEL(ArmorMega_ITEM, Item_Model("item_armor_large.md3"));
-SOUND(ArmorMega, "misc/armor25.wav");
+SOUND(ArmorMega, "misc/armor25");
 #endif
 
 REGISTER_ITEM(ArmorMega, Armor) {
index de075a2022816aa7716767f91a1bbe8d0a0b3bca..6a2b5b13895a4b00ff2dacb05393395bfeae03b8 100644 (file)
@@ -5,7 +5,7 @@
 
 #ifndef MENUQC
 MODEL(HealthSmall_ITEM, Item_Model("g_h1.md3"));
-SOUND(HealthSmall, "misc/minihealth.ogg");
+SOUND(HealthSmall, "misc/minihealth");
 #endif
 
 REGISTER_ITEM(HealthSmall, Health) {
@@ -25,7 +25,7 @@ REGISTER_ITEM(HealthSmall, Health) {
 
 #ifndef MENUQC
 MODEL(HealthMedium_ITEM, Item_Model("g_h25.md3"));
-SOUND(HealthMedium, "misc/mediumhealth.ogg");
+SOUND(HealthMedium, "misc/mediumhealth");
 #endif
 
 REGISTER_ITEM(HealthMedium, Health) {
@@ -45,7 +45,7 @@ REGISTER_ITEM(HealthMedium, Health) {
 
 #ifndef MENUQC
 MODEL(HealthLarge_ITEM, Item_Model("g_h50.md3"));
-SOUND(HealthLarge, "misc/mediumhealth.ogg");
+SOUND(HealthLarge, "misc/mediumhealth");
 #endif
 
 REGISTER_ITEM(HealthLarge, Health) {
@@ -67,7 +67,7 @@ REGISTER_ITEM(HealthLarge, Health) {
 
 #ifndef MENUQC
 MODEL(HealthMega_ITEM, Item_Model("g_h100.md3"));
-SOUND(HealthMega, "misc/megahealth.ogg");
+SOUND(HealthMega, "misc/megahealth");
 #endif
 
 REGISTER_ITEM(HealthMega, Health) {
index a1cf732c15f3c36d841c869d28538155287169b3..7deba67df50bb48c9ddedeed3a455c9bab126c0e 100644 (file)
@@ -6,7 +6,7 @@
 
 #ifndef MENUQC
 MODEL(Strength_ITEM, Item_Model("g_strength.md3"));
-SOUND(Strength, "misc/powerup.ogg");
+SOUND(Strength, "misc/powerup");
 #endif
 
 REGISTER_ITEM(Strength, Powerup) {
@@ -24,7 +24,7 @@ REGISTER_ITEM(Strength, Powerup) {
 
 #ifndef MENUQC
 MODEL(Shield_ITEM, Item_Model("g_invincible.md3"));
-SOUND(Shield, "misc/powerup_shield.ogg");
+SOUND(Shield, "misc/powerup_shield");
 #endif
 
 REGISTER_ITEM(Shield, Powerup) {
index ec2e25e338b7074298bb2d7f709bbac418086084..a069e535f414559a5967677fcd67b13eacba91c5 100644 (file)
@@ -9,7 +9,7 @@ GETTER(float, instagib_respawntimejitter_ammo)
 
 #ifndef MENUQC
 MODEL(VaporizerCells_ITEM, Item_Model("a_cells.md3"));
-SOUND(VaporizerCells, "misc/itempickup.ogg");
+SOUND(VaporizerCells, "misc/itempickup");
 #endif
 
 REGISTER_ITEM(VaporizerCells, Ammo) {
@@ -29,7 +29,7 @@ REGISTER_ITEM(VaporizerCells, Ammo) {
 
 #ifndef MENUQC
 MODEL(ExtraLife_ITEM, Item_Model("g_h100.md3"));
-SOUND(ExtraLife, "misc/megahealth.ogg");
+SOUND(ExtraLife, "misc/megahealth");
 #endif
 
 REGISTER_ITEM(ExtraLife, Powerup) {
@@ -47,7 +47,7 @@ REGISTER_ITEM(ExtraLife, Powerup) {
 
 #ifndef MENUQC
 MODEL(Invisibility_ITEM, Item_Model("g_strength.md3"));
-SOUND(Invisibility, "misc/powerup.ogg");
+SOUND(Invisibility, "misc/powerup");
 #endif
 
 REGISTER_ITEM(Invisibility, Powerup) {
@@ -65,7 +65,7 @@ REGISTER_ITEM(Invisibility, Powerup) {
 
 #ifndef MENUQC
 MODEL(Speed_ITEM, Item_Model("g_invincible.md3"));
-SOUND(Speed, "misc/powerup_shield.ogg");
+SOUND(Speed, "misc/powerup_shield");
 #endif
 
 REGISTER_ITEM(Speed, Powerup) {
index 87c28c353f30a5d8f1e83fc7085f5f8b2b1a1fe3..69a95be0cce22074d75686a5aaf52c90c017ad80 100644 (file)
@@ -106,11 +106,11 @@ SOUND(WEAPONPICKUP, W_Sound("weaponpickup"));
 SOUND(WEAPONPICKUP_NEW_TOYS, W_Sound("weaponpickup_new_toys"));
 SOUND(WEAPON_SWITCH, W_Sound("weapon_switch"));
 
-SOUND(CTF_CAPTURE_NEUTRAL, "ctf/capture.ogg");
-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(CTF_CAPTURE_NEUTRAL, "ctf/capture");
+SOUND(CTF_CAPTURE_RED, "ctf/red_capture");
+SOUND(CTF_CAPTURE_BLUE, "ctf/blue_capture");
+SOUND(CTF_CAPTURE_YELLOW, "ctf/yellow_capture");
+SOUND(CTF_CAPTURE_PINK, "ctf/pink_capture");
 Sound SND_CTF_CAPTURE(int teamid) {
     switch (teamid) {
         case NUM_TEAM_1:    return SND_CTF_CAPTURE_RED;
@@ -121,11 +121,11 @@ Sound SND_CTF_CAPTURE(int teamid) {
     }
 }
 
-SOUND(CTF_DROPPED_NEUTRAL,  "ctf/neutral_dropped.wav");
-SOUND(CTF_DROPPED_RED,      "ctf/red_dropped.wav");
-SOUND(CTF_DROPPED_BLUE,     "ctf/blue_dropped.wav");
-SOUND(CTF_DROPPED_YELLOW,   "ctf/yellow_dropped.wav");
-SOUND(CTF_DROPPED_PINK,     "ctf/pink_dropped.wav");
+SOUND(CTF_DROPPED_NEUTRAL,  "ctf/neutral_dropped");
+SOUND(CTF_DROPPED_RED,      "ctf/red_dropped");
+SOUND(CTF_DROPPED_BLUE,     "ctf/blue_dropped");
+SOUND(CTF_DROPPED_YELLOW,   "ctf/yellow_dropped");
+SOUND(CTF_DROPPED_PINK,     "ctf/pink_dropped");
 Sound SND_CTF_DROPPED(int teamid) {
     switch (teamid) {
         case NUM_TEAM_1:    return SND_CTF_DROPPED_RED;
@@ -136,14 +136,14 @@ Sound SND_CTF_DROPPED(int teamid) {
     }
 }
 
-SOUND(CTF_PASS, "ctf/pass.wav");
-SOUND(CTF_RESPAWN, "ctf/flag_respawn.wav");
+SOUND(CTF_PASS, "ctf/pass");
+SOUND(CTF_RESPAWN, "ctf/flag_respawn");
 
-SOUND(CTF_RETURNED_NEUTRAL,  "ctf/return.wav");
-SOUND(CTF_RETURNED_RED,      "ctf/red_returned.wav");
-SOUND(CTF_RETURNED_BLUE,     "ctf/blue_returned.wav");
-SOUND(CTF_RETURNED_YELLOW,   "ctf/yellow_returned.wav");
-SOUND(CTF_RETURNED_PINK,     "ctf/pink_returned.wav");
+SOUND(CTF_RETURNED_NEUTRAL,  "ctf/return");
+SOUND(CTF_RETURNED_RED,      "ctf/red_returned");
+SOUND(CTF_RETURNED_BLUE,     "ctf/blue_returned");
+SOUND(CTF_RETURNED_YELLOW,   "ctf/yellow_returned");
+SOUND(CTF_RETURNED_PINK,     "ctf/pink_returned");
 Sound SND_CTF_RETURNED(int teamid) {
     switch (teamid) {
         case NUM_TEAM_1:    return SND_CTF_RETURNED_RED;
@@ -154,11 +154,11 @@ Sound SND_CTF_RETURNED(int teamid) {
     }
 }
 
-SOUND(CTF_TAKEN_NEUTRAL,  "ctf/neutral_taken.wav");
-SOUND(CTF_TAKEN_RED,      "ctf/red_taken.wav");
-SOUND(CTF_TAKEN_BLUE,     "ctf/blue_taken.wav");
-SOUND(CTF_TAKEN_YELLOW,   "ctf/yellow_taken.wav");
-SOUND(CTF_TAKEN_PINK,     "ctf/pink_taken.wav");
+SOUND(CTF_TAKEN_NEUTRAL,  "ctf/neutral_taken");
+SOUND(CTF_TAKEN_RED,      "ctf/red_taken");
+SOUND(CTF_TAKEN_BLUE,     "ctf/blue_taken");
+SOUND(CTF_TAKEN_YELLOW,   "ctf/yellow_taken");
+SOUND(CTF_TAKEN_PINK,     "ctf/pink_taken");
 Sound SND_CTF_TAKEN(int teamid) {
     switch (teamid) {
         case NUM_TEAM_1:    return SND_CTF_TAKEN_RED;
@@ -169,109 +169,109 @@ Sound SND_CTF_TAKEN(int teamid) {
     }
 }
 
-SOUND(CTF_TOUCH, "ctf/touch.wav");
-
-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(KH_ALARM, "kh/alarm.wav");
-SOUND(KH_CAPTURE, "kh/capture.wav");
-SOUND(KH_COLLECT, "kh/collect.wav");
-SOUND(KH_DESTROY, "kh/destroy.wav");
-SOUND(KH_DROP, "kh/drop.wav");
-
-SOUND(NB_BOUNCE, "nexball/bounce.ogg");
-SOUND(NB_DROP, "nexball/drop.ogg");
-SOUND(NB_SHOOT1, "nexball/shoot1.ogg");
-SOUND(NB_SHOOT2, "nexball/shoot2.ogg");
-SOUND(NB_STEAL, "nexball/steal.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(CTF_TOUCH, "ctf/touch");
+
+SOUND(DOM_CLAIM, "domination/claim");
+
+SOUND(KA_DROPPED, "keepaway/dropped");
+SOUND(KA_PICKEDUP, "keepaway/pickedup");
+SOUND(KA_RESPAWN, "keepaway/respawn");
+SOUND(KA_TOUCH, "keepaway/touch");
+
+SOUND(KH_ALARM, "kh/alarm");
+SOUND(KH_CAPTURE, "kh/capture");
+SOUND(KH_COLLECT, "kh/collect");
+SOUND(KH_DESTROY, "kh/destroy");
+SOUND(KH_DROP, "kh/drop");
+
+SOUND(NB_BOUNCE, "nexball/bounce");
+SOUND(NB_DROP, "nexball/drop");
+SOUND(NB_SHOOT1, "nexball/shoot1");
+SOUND(NB_SHOOT2, "nexball/shoot2");
+SOUND(NB_STEAL, "nexball/steal");
+
+SOUND(ONS_CONTROLPOINT_BUILD, "onslaught/controlpoint_build");
+SOUND(ONS_CONTROLPOINT_BUILT, "onslaught/controlpoint_built");
+SOUND(ONS_CONTROLPOINT_UNDERATTACK, "onslaught/controlpoint_underattack");
+SOUND(ONS_DAMAGEBLOCKEDBYSHIELD, "onslaught/damageblockedbyshield");
+SOUND(ONS_ELECTRICITY_EXPLODE, "onslaught/electricity_explode");
+SOUND(ONS_GENERATOR_DECAY, "onslaught/generator_decay");
+SOUND(ONS_GENERATOR_UNDERATTACK, "onslaught/generator_underattack");
+SOUND(ONS_HIT1, "onslaught/ons_hit1");
+SOUND(ONS_HIT2, "onslaught/ons_hit2");
+SOUND(ONS_SPARK1, "onslaught/ons_spark1");
+SOUND(ONS_SPARK2, "onslaught/ons_spark2");
+SOUND(ONS_SHOCKWAVE, "onslaught/shockwave");
+
+SOUND(PORTO_BOUNCE, "porto/bounce");
+SOUND(PORTO_CREATE, "porto/create");
+SOUND(PORTO_EXPIRE, "porto/expire");
+SOUND(PORTO_EXPLODE, "porto/explode");
+SOUND(PORTO_FIRE, "porto/fire");
+SOUND(PORTO_UNSUPPORTED, "porto/unsupported");
+
+SOUND(TUR_PHASER, "turrets/phaser");
+
+SOUND(VEH_ALARM, "vehicles/alarm");
+SOUND(VEH_ALARM_SHIELD, "vehicles/alarm_shield");
+SOUND(VEH_MISSILE_ALARM, "vehicles/missile_alarm");
 
 SOUND(VEH_BUMBLEBEE_FIRE, W_Sound("flacexp3"));
 
-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_RACER_BOOST, "vehicles/racer_boost");
+SOUND(VEH_RACER_IDLE, "vehicles/racer_idle");
+SOUND(VEH_RACER_MOVE, "vehicles/racer_move");
 
-SOUND(VEH_RAPTOR_FLY, "vehicles/raptor_fly.wav");
-SOUND(VEH_RAPTOR_SPEED, "vehicles/raptor_speed.wav");
+SOUND(VEH_RAPTOR_FLY, "vehicles/raptor_fly");
+SOUND(VEH_RAPTOR_SPEED, "vehicles/raptor_speed");
 
-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(VEH_SPIDERBOT_DIE, "vehicles/spiderbot_die");
+SOUND(VEH_SPIDERBOT_IDLE, "vehicles/spiderbot_idle");
+SOUND(VEH_SPIDERBOT_JUMP, "vehicles/spiderbot_jump");
+SOUND(VEH_SPIDERBOT_LAND, "vehicles/spiderbot_land");
+SOUND(VEH_SPIDERBOT_STRAFE, "vehicles/spiderbot_strafe");
+SOUND(VEH_SPIDERBOT_WALK, "vehicles/spiderbot_walk");
 
-SOUND(NADE_BEEP, "overkill/grenadebip.ogg");
+SOUND(NADE_BEEP, "overkill/grenadebip");
 
-SOUND(BUFF_LOST, "relics/relic_effect.wav");
+SOUND(BUFF_LOST, "relics/relic_effect");
 
-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(POWEROFF, "misc/poweroff");
+SOUND(POWERUP, "misc/powerup");
+SOUND(SHIELD_RESPAWN, "misc/shield_respawn");
+SOUND(STRENGTH_RESPAWN, "misc/strength_respawn");
 
-SOUND(ARMOR25, "misc/armor25.wav");
-SOUND(ARMORIMPACT, "misc/armorimpact.wav");
-SOUND(BODYIMPACT1, "misc/bodyimpact1.wav");
-SOUND(BODYIMPACT2, "misc/bodyimpact2.wav");
+SOUND(ARMOR25, "misc/armor25");
+SOUND(ARMORIMPACT, "misc/armorimpact");
+SOUND(BODYIMPACT1, "misc/bodyimpact1");
+SOUND(BODYIMPACT2, "misc/bodyimpact2");
 
-SOUND(ITEMPICKUP, "misc/itempickup.ogg");
-SOUND(ITEMRESPAWNCOUNTDOWN, "misc/itemrespawncountdown.ogg");
-SOUND(ITEMRESPAWN, "misc/itemrespawn.ogg");
-SOUND(MEGAHEALTH, "misc/megahealth.ogg");
+SOUND(ITEMPICKUP, "misc/itempickup");
+SOUND(ITEMRESPAWNCOUNTDOWN, "misc/itemrespawncountdown");
+SOUND(ITEMRESPAWN, "misc/itemrespawn");
+SOUND(MEGAHEALTH, "misc/megahealth");
 
-SOUND(LAVA, "player/lava.wav");
-SOUND(SLIME, "player/slime.wav");
+SOUND(LAVA, "player/lava");
+SOUND(SLIME, "player/slime");
 
-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(GIB, "misc/gib");
+SOUND(GIB_SPLAT01, "misc/gib_splat01");
+SOUND(GIB_SPLAT02, "misc/gib_splat02");
+SOUND(GIB_SPLAT03, "misc/gib_splat03");
+SOUND(GIB_SPLAT04, "misc/gib_splat04");
 Sound SND_GIB_SPLAT_RANDOM() {
     return Sounds_from(SND_GIB_SPLAT01.m_id + floor(prandom() * 4));
 }
 
-SOUND(HIT, "misc/hit.wav");
-SOUND(TYPEHIT, "misc/typehit.wav");
+SOUND(HIT, "misc/hit");
+SOUND(TYPEHIT, "misc/typehit");
 
-SOUND(SPAWN, "misc/spawn.ogg");
+SOUND(SPAWN, "misc/spawn");
 
-SOUND(TALK, "misc/talk.wav");
+SOUND(TALK, "misc/talk");
 
-SOUND(TELEPORT, "misc/teleport.ogg");
+SOUND(TELEPORT, "misc/teleport");
 
-SOUND(INVSHOT, "misc/invshot.wav");
+SOUND(INVSHOT, "misc/invshot");
 
-SOUND(JETPACK_FLY, "misc/jetpack_fly.ogg");
+SOUND(JETPACK_FLY, "misc/jetpack_fly");
index 1bf8ba170e506af00b2198746eebfbaa7fcf7644..4ad0e9b102cbc214eaf01876ecd83ba1f9f841c1 100644 (file)
@@ -12,7 +12,7 @@ REGISTER_REGISTRY(RegisterSounds)
     REGISTER(RegisterSounds, SND, Sounds, name, m_id, NEW(Sound, SND_##name##_get))
 
 // Used in places where a string is required
-#define SND(id) (SND_##id.sound_str())
+#define SND(id) Sound_fixpath(SND_##id)
 
 PRECACHE(Sounds) {
     FOREACH(Sounds, true, LAMBDA({
@@ -20,7 +20,7 @@ PRECACHE(Sounds) {
     }));
 }
 
-SOUND(Null, "misc/null.wav");
+SOUND(Null, "misc/null");
 #include "all.inc"
 
 #endif
index bc393dda3d218e67929daed1c3675db4cdd8ff39..dfc80e390a6696ab111f881e693158766021cba6 100644 (file)
@@ -4,33 +4,56 @@
 // Play all sounds via sound7, for access to the extra channels.
 // Otherwise, channels 8 to 15 would be blocked for a weird QW feature.
 #ifdef SVQC
-    #define _sound(e, c, s, v, a) do { \
-        entity __e = e; \
-        if (!sound_allowed(MSG_BROADCAST, __e)) break; \
-        sound7(__e, c, s, v, a, 0, 0); \
-    } while (0)
+       #define _sound(e, c, s, v, a) \
+               do \
+               { \
+                       entity __e = e; \
+                       if (!sound_allowed(MSG_BROADCAST, __e)) break; \
+                       sound7(__e, c, s, v, a, 0, 0); \
+               } \
+               while (0)
 #else
-    #define _sound(e, c, s, v, a) sound7(e, c, s, v, a, 0, 0)
+       #define _sound(e, c, s, v, a) sound7(e, c, s, v, a, 0, 0)
 #endif
-#define sound(e, c, s, v, a) _sound(e, c, s.sound_str(), v, a)
+#define sound(e, c, s, v, a) _sound(e, c, Sound_fixpath(s), v, a)
 
 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;
+       ATTRIB(Sound, m_id, int, 0)
+       ATTRIB(Sound, sound_str, string(), func_null)
+       CONSTRUCTOR(Sound, string() path)
+       {
+               CONSTRUCT(Sound);
+               this.sound_str = path;
+       }
+       #define Sound_fixpath(this) _Sound_fixpath((this).sound_str())
+       string _Sound_fixpath(string base)
+       {
+        if (base == "") return string_null;
+        #define extensions(x) \
+            x(wav) \
+            x(ogg) \
+            x(flac) \
+            /**/
+        string full, relative;
+        #define tryext(ext) { if (fexists(full = strcat("sound/", relative = strcat(base, "." #ext)))) break; }
+        do
+        {
+            extensions(tryext);
+#undef tryext
+#undef extensions
+            LOG_WARNINGF("Missing sound: \"%s\"\n", full);
+            return string_null;
         }
-        LOG_TRACEF("precache_sound(\"%s\")\n", s);
-        precache_sound(s);
-    }
+        while (0);
+        return relative;
+       }
+       METHOD(Sound, sound_precache, void(entity this))
+       {
+               string s = Sound_fixpath(this);
+               if (!s) return;
+               LOG_TRACEF("precache_sound(\"%s\")\n", s);
+               precache_sound(s);
+       }
 ENDCLASS(Sound)
 
 #endif
index ffbc0712da186a0d5d73972c7f385ed3498b016e..b338122139730e150fa773b28e27ded825aca60d 100644 (file)
@@ -291,16 +291,7 @@ int GetAmmoStat(.int ammotype)
 
 string W_Sound(string w_snd)
 {
-       #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);
-
+       string output = strcat("weapons/", w_snd);
 #ifdef SVQC
        MUTATOR_CALLHOOK(WeaponSound, w_snd, output);
        return weapon_sound_output;
index 77e3cfae0a9f81e1d0a274ad225b2234a36904b8..c2088a9844ff72504c958cf83bae1b33a5c724ac 100644 (file)
@@ -762,7 +762,7 @@ void Item_Touch()
        other.last_pickup = time;
 
        Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
-       _sound (other, CH_TRIGGER, (this.item_pickupsound ? this.item_pickupsound : this.item_pickupsound_ent.sound_str()), VOL_BASE, ATTEN_NORM);
+       _sound (other, CH_TRIGGER, (this.item_pickupsound ? this.item_pickupsound : Sound_fixpath(this.item_pickupsound_ent)), VOL_BASE, ATTEN_NORM);
 
        if (this.classname == "droppedweapon")
                remove (this);