#define PlayerSounds_from(i) _PlayerSounds_from(i, NULL)
#define REGISTER_PLAYERSOUND(id) \
.string _playersound_##id; \
- REGISTER(RegisterPlayerSounds, playersound, PlayerSounds, id, m_id, new(PlayerSound)) \
+ REGISTER(PlayerSounds, playersound, id, m_id, new(PlayerSound)) \
{ \
make_pure(this); \
this.m_playersoundstr = #id; \
this.m_playersoundfld = _playersound_##id; \
}
-REGISTER_REGISTRY(RegisterPlayerSounds)
-REGISTRY_SORT(PlayerSounds, 0)
-STATIC_INIT(PlayerSounds_renumber) { FOREACH(PlayerSounds, true, LAMBDA(it.m_id = i)); }
+REGISTER_REGISTRY(PlayerSounds)
+REGISTRY_SORT(PlayerSounds)
+STATIC_INIT(PlayerSounds_renumber)
+{
+ FOREACH(PlayerSounds, true, LAMBDA(it.m_id = i));
+}
REGISTRY_CHECK(PlayerSounds)
// TODO implement fall and falling
.int m_playersoundvt;
#define REGISTER_VOICEMSG(id, vt) \
.string _playersound_##id; \
- REGISTER(RegisterPlayerSounds, playersound, PlayerSounds, id, m_id, new(VoiceMessage)) \
+ REGISTER(PlayerSounds, playersound, id, m_id, new(VoiceMessage)) \
{ \
make_pure(this); \
this.instanceOfVoiceMessage = true; \
REGISTRY(GlobalSounds, BITS(8) - 1)
#define GlobalSounds_from(i) _GlobalSounds_from(i, NULL)
#define REGISTER_GLOBALSOUND(id, str) \
- REGISTER(RegisterGlobalSounds, GS, GlobalSounds, id, m_id, new(GlobalSound)) \
+ REGISTER(GlobalSounds, GS, id, m_id, new(GlobalSound)) \
{ \
make_pure(this); \
this.m_globalsoundstr = str; \
}
-REGISTER_REGISTRY(RegisterGlobalSounds)
-REGISTRY_SORT(GlobalSounds, 0)
-STATIC_INIT(GlobalSounds_renumber) { FOREACH(GlobalSounds, true, LAMBDA(it.m_id = i)); }
+REGISTER_REGISTRY(GlobalSounds)
+REGISTRY_SORT(GlobalSounds)
+STATIC_INIT(GlobalSounds_renumber)
+{
+ FOREACH(GlobalSounds, true, LAMBDA(it.m_id = i));
+}
REGISTRY_CHECK(GlobalSounds)
void PrecacheGlobalSound(string samplestring);
PRECACHE(GlobalSounds)
REGISTER_GLOBALSOUND(FALL, "misc/hitground 4")
REGISTER_GLOBALSOUND(FALL_METAL, "misc/metalhitground 4")
-#ifdef SVQC
-
- bool GetPlayerSoundSampleField_notFound;
+bool GetPlayerSoundSampleField_notFound;
+void PrecachePlayerSounds(string f);
+#ifdef CSQC
.string GetVoiceMessageSampleField(string type);
.string GetPlayerSoundSampleField(string type);
- void PrecachePlayerSounds(string f);
void ClearPlayerSounds(entity this);
float LoadPlayerSounds(entity this, string f, bool strict);
void UpdatePlayerSounds(entity this);
- void _GlobalSound(entity gs, entity ps, string sample, float chan, float voicetype, bool fake);
- #define GlobalSound(def, chan, voicetype) _GlobalSound(def, NULL, string_null, chan, voicetype, false)
- #define GlobalSound_string(def, chan, voicetype) _GlobalSound(NULL, NULL, def, chan, voicetype, false)
- #define PlayerSound(def, chan, voicetype) _GlobalSound(NULL, def, string_null, chan, voicetype, false)
- #define VoiceMessage(def, msg) \
- do \
- { \
- entity VM = def; \
- int voicetype = VM.m_playersoundvt; \
- bool ownteam = (voicetype == VOICETYPE_TEAMRADIO); \
- int flood = Say(this, ownteam, world, msg, true); \
- bool fake; \
- if (IS_SPEC(this) || IS_OBSERVER(this) || flood < 0) fake = true; \
- else if (flood > 0) fake = false; \
- else break; \
- _GlobalSound(NULL, VM, string_null, CH_VOICE, voicetype, fake); \
- } \
- while (0)
+#endif
+
+#ifdef SVQC
+
+ void _GlobalSound(entity this, entity gs, entity ps, string sample, float chan, float voicetype, bool fake);
+ #define GlobalSound(this, def, chan, voicetype) _GlobalSound(this, def, NULL, string_null, chan, voicetype, false)
+ #define GlobalSound_string(this, def, chan, voicetype) _GlobalSound(this, NULL, NULL, def, chan, voicetype, false)
+ #define PlayerSound(thise, def, chan, voicetype) _GlobalSound(this, NULL, def, string_null, chan, voicetype, false)
+ #define VoiceMessage(this, def, msg) \
+ do \
+ { \
+ entity VM = def; \
+ int voicetype = VM.m_playersoundvt; \
+ bool ownteam = (voicetype == VOICETYPE_TEAMRADIO); \
+ int flood = Say(this, ownteam, world, msg, true); \
+ bool fake; \
+ if (IS_SPEC(this) || IS_OBSERVER(this) || flood < 0) fake = true; \
+ else if (flood > 0) fake = false; \
+ else break; \
+ _GlobalSound(this, NULL, VM, string_null, CH_VOICE, voicetype, fake); \
+ } \
+ while (0)
#endif