]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/sounds/all.qh
Replace some of the remaining cvar globals with autocvars, allows changing a few...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / sounds / all.qh
1 #pragma once
2
3 #include "sound.qh"
4
5 #ifdef SVQC
6 void soundat(entity e, vector o, float chan, string samp, float vol, float _atten);
7
8 void stopsoundto(float _dest, entity e, float chan);
9
10 void soundtoat(float _dest, entity e, vector o, float chan, string samp, float vol, float _atten, float _pitch);
11
12 bool sound_allowed(int dest, entity e);
13
14 float spamsound(entity e, float chan, Sound samp, float vol, float _atten);
15
16 void play2(entity e, string filename);
17
18 void play2all(string samp);
19
20 void play2team(float t, string filename);
21
22 void soundto(float dest, entity e, float chan, string samp, float vol, float atten, float _pitch);
23
24 void stopsound(entity e, float chan);
25 #endif
26
27 REGISTRY(Sounds, BITS(9))
28 REGISTER_REGISTRY(Sounds)
29
30 #define SOUND(name, path) \
31     string SND_##name##_get() { return path; } \
32     REGISTER(Sounds, SND, name, m_id, NEW(Sound, SND_##name##_get))
33
34 /** @deprecated Used in places where a string is required for legacy reasons, prefer using SND_id constants instead */
35 #define SND(id) Sound_fixpath(SND_##id)
36
37 PRECACHE(Sounds) {
38     FOREACH(Sounds, true, it.sound_precache(it));
39 }
40
41 SOUND(Null, "misc/null");
42 REGISTRY_DEFINE_GET(Sounds, SND_Null)
43 #include "all.inc"
44 #include "all.qc"