]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/sounds/all.qh
Merge branch 'bones_was_here/sv_maxidle_playertospectator' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / sounds / all.qh
index 8225db7368c30f5593c2c1e435897b0123cbb8d5..2a0d7ac4f04645600541ede6d9d8c704ab45b70d 100644 (file)
@@ -1,26 +1,44 @@
-#ifndef SOUNDS_ALL_H
-#define SOUNDS_ALL_H
+#pragma once
 
 #include "sound.qh"
 
-REGISTRY(Sounds, BITS(8))
-#define Sounds_from(i) _Sounds_from(i, SND_Null)
+#ifdef SVQC
+void soundat(entity e, vector o, float chan, string samp, float vol, float _atten);
+
+void stopsoundto(float _dest, entity e, float chan);
+
+void soundtoat(float _dest, entity e, vector o, float chan, string samp, float vol, float _atten, float _pitch);
+
+bool sound_allowed(int dest, entity e);
+
+float spamsound(entity e, float chan, Sound samp, float vol, float _atten);
+
+void play2(entity e, string filename);
+
+void play2all(string samp);
+
+void play2team(float t, string filename);
+
+void soundto(float dest, entity e, float chan, string samp, float vol, float atten, float _pitch);
+
+void stopsound(entity e, float chan);
+#endif
+
+REGISTRY(Sounds, BITS(9))
 REGISTER_REGISTRY(Sounds)
 
 #define SOUND(name, path) \
     string SND_##name##_get() { return path; } \
     REGISTER(Sounds, SND, name, m_id, NEW(Sound, SND_##name##_get))
 
-// Used in places where a string is required
+/** @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)
 
 PRECACHE(Sounds) {
-    FOREACH(Sounds, true, LAMBDA({
-        it.sound_precache(it);
-    }));
+    FOREACH(Sounds, true, it.sound_precache(it));
 }
 
 SOUND(Null, "misc/null");
+REGISTRY_DEFINE_GET(Sounds, SND_Null)
 #include "all.inc"
 #include "all.qc"
-#endif