]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/effects/qc/globalsound.qh
Move server-side chat handling to its own file, and add a note about miscfunctions
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / effects / qc / globalsound.qh
index b5631ed5fd246774277adb823dae760d31700b9d..cec501c5589f0c2fd41c9cdae784cb5a11e16edc 100644 (file)
@@ -1,5 +1,9 @@
 #pragma once
 
+#if defined(SVQC)
+       #include <server/chat.qh>
+#endif
+
 #ifdef SVQC
        /** Use new sound handling. TODO: use when sounds play correctly on clients */
        bool autocvar_g_debug_globalsounds = false;
@@ -11,7 +15,6 @@
 ..string m_playersoundfld;
 
 REGISTRY(PlayerSounds, BITS(8) - 1)
-#define PlayerSounds_from(i) _PlayerSounds_from(i, NULL)
 #define REGISTER_PLAYERSOUND(id) \
        .string _playersound_##id; \
        REGISTER(PlayerSounds, playersound, id, m_id, new_pure(PlayerSound)) \
@@ -21,6 +24,8 @@ REGISTRY(PlayerSounds, BITS(8) - 1)
        }
 REGISTER_REGISTRY(PlayerSounds)
 REGISTRY_SORT(PlayerSounds)
+
+REGISTRY_DEFINE_GET(PlayerSounds, NULL)
 STATIC_INIT(PlayerSounds_renumber)
 {
        FOREACH(PlayerSounds, true, it.m_id = i);
@@ -84,7 +89,6 @@ REGISTER_VOICEMSG(seenenemy, VOICETYPE_TEAMRADIO, false)
 
 .string m_globalsoundstr;
 REGISTRY(GlobalSounds, BITS(8) - 1)
-#define GlobalSounds_from(i) _GlobalSounds_from(i, NULL)
 #define REGISTER_GLOBALSOUND(id, str) \
        REGISTER(GlobalSounds, GS, id, m_id, new_pure(GlobalSound)) \
        { \
@@ -92,6 +96,8 @@ REGISTRY(GlobalSounds, BITS(8) - 1)
        }
 REGISTER_REGISTRY(GlobalSounds)
 REGISTRY_SORT(GlobalSounds)
+
+REGISTRY_DEFINE_GET(GlobalSounds, NULL)
 STATIC_INIT(GlobalSounds_renumber)
 {
        FOREACH(GlobalSounds, true, it.m_id = i);
@@ -121,6 +127,8 @@ entity GetVoiceMessage(string type);
 
 string GlobalSound_sample(string pair, float r);
 
+float GlobalSound_pitch(float _pitch);
+
 #ifdef SVQC
 
        void _GlobalSound(entity this, entity gs, entity ps, string sample, float chan, float vol, float voicetype, bool fake);