4 // Play all sounds via sound7, for access to the extra channels.
5 // Otherwise, channels 8 to 15 would be blocked for a weird QW feature.
7 #define _sound(e, c, s, v, a) \
11 if (!sound_allowed(MSG_BROADCAST, __e)) break; \
12 sound7(__e, c, s, v, a, 0, 0); \
16 #define _sound(e, c, s, v, a) sound7(e, c, s, v, a, 0, 0)
18 #define sound(e, c, s, v, a) _sound(e, c, Sound_fixpath(s), v, a)
21 ATTRIB(Sound, m_id, int, 0)
22 ATTRIB(Sound, sound_str, string(), func_null)
23 CONSTRUCTOR(Sound, string() path)
26 this.sound_str = path;
28 #define Sound_fixpath(this) _Sound_fixpath((this).sound_str())
29 string _Sound_fixpath(string base)
31 if (base == "") return string_null;
32 #define extensions(x) \
37 string full, relative;
38 #define tryext(ext) { if (fexists(full = strcat("sound/", relative = strcat(base, "." #ext)))) break; }
44 LOG_WARNINGF("Missing sound: \"%s\"\n", full);
50 METHOD(Sound, sound_precache, void(entity this))
52 string s = Sound_fixpath(this);
54 LOG_TRACEF("precache_sound(\"%s\")\n", s);