]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/sounds/all.qh
Registry: hide arrays
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / sounds / all.qh
1 #ifndef SOUNDS_ALL_H
2 #define SOUNDS_ALL_H
3
4 #include "sound.qh"
5
6 REGISTRY(Sounds, BITS(8))
7 #define Sounds_from(i) _Sounds_from(i, SND_Null)
8 REGISTER_REGISTRY(RegisterSounds)
9
10 #define SOUND(name, path) \
11     string SND_##name##_get() { return path; } \
12     REGISTER(RegisterSounds, SND, Sounds, name, m_id, NEW(Sound, SND_##name##_get))
13
14 // Used in places where a string is required
15 #define SND(id) (SND_##id.sound_str())
16
17 STATIC_INIT(RegisterSounds_precache) {
18     FOREACH(Sounds, true, LAMBDA({
19         it.sound_precache(it);
20     }));
21 }
22
23 SOUND(Null, "misc/null.wav");
24 #include "all.inc"
25
26 #endif