X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fsounds%2Fall.qh;h=a7fe25f17d1e324d07069f46e16057efbd22ba96;hb=2b67ae817f499cefc1778834117ce3f7b56cbdd9;hp=d39c701d7f0a2887295f557a01747bbb4c8bf18a;hpb=c51698509e174e343dff48128a1dcfff1527c535;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/sounds/all.qh b/qcsrc/common/sounds/all.qh index d39c701d7..a7fe25f17 100644 --- a/qcsrc/common/sounds/all.qh +++ b/qcsrc/common/sounds/all.qh @@ -4,22 +4,21 @@ #include "sound.qh" REGISTRY(Sounds, BITS(8)) -REGISTER_REGISTRY(RegisterSounds) +#define Sounds_from(i) _Sounds_from(i, SND_Null) +REGISTER_REGISTRY(Sounds) #define SOUND(name, path) \ string SND_##name##_get() { return path; } \ - REGISTER(RegisterSounds, SND, Sounds, name, m_id, NEW(Sound, SND_##name##_get)) + REGISTER(Sounds, SND, name, m_id, NEW(Sound, SND_##name##_get)) -// Used in places where a string is required -#define SND(id) (SND_##id.sound_str()) +/** @deprecated Used in places where a string is required for legacy reasons, prefer using SND_id constants instead */ +#define SND(id) Sound_fixpath(SND_##id) -STATIC_INIT(RegisterSounds_precache) { - FOREACH(Sounds, true, LAMBDA({ - it.sound_precache(it); - })); +PRECACHE(Sounds) { + FOREACH(Sounds, true, it.sound_precache(it)); } -SOUND(Null, "misc/null.wav"); +SOUND(Null, "misc/null"); #include "all.inc" - +#include "all.qc" #endif