4 // player sounds, voice messages
5 // TODO implemented fall and falling
6 #define ALLPLAYERSOUNDS(X) \
18 #define ALLVOICEMSGS(X) \
31 // reserved sound names for the future (some models lack sounds for them):
32 // _VOICEMSG(flagcarriertakingdamage)
34 // reserved sound names for the future (ALL models lack sounds for them):
35 // _VOICEMSG(affirmative)
36 // _VOICEMSG(attacking)
37 // _VOICEMSG(defending)
40 // _VOICEMSG(droppedflag)
41 // _VOICEMSG(negative)
42 // _VOICEMSG(seenenemy)
44 .string m_globalsoundstr;
45 REGISTRY(GlobalSounds, BITS(8) - 1)
46 #define GlobalSounds_from(i) _GlobalSounds_from(i, NULL)
47 #define REGISTER_GLOBALSOUND(id, str) \
48 REGISTER(RegisterGlobalSounds, GS, GlobalSounds, id, m_id, new(GlobalSound)) \
51 this.m_globalsoundstr = str; \
53 REGISTER_REGISTRY(RegisterGlobalSounds)
54 REGISTRY_SORT(GlobalSounds, 0)
55 STATIC_INIT(GlobalSounds_renumber) { FOREACH(GlobalSounds, true, LAMBDA(it.m_id = i)); }
56 REGISTRY_CHECK(GlobalSounds)
57 void PrecacheGlobalSound(string samplestring);
58 PRECACHE(GlobalSounds)
60 FOREACH(GlobalSounds, true, LAMBDA(PrecacheGlobalSound(it.m_globalsoundstr)));
63 REGISTER_GLOBALSOUND(STEP, "misc/footstep0 6")
64 REGISTER_GLOBALSOUND(STEP_METAL, "misc/metalfootstep0 6")
65 REGISTER_GLOBALSOUND(FALL, "misc/hitground 4")
66 REGISTER_GLOBALSOUND(FALL_METAL, "misc/metalhitground 4")
70 #define X(m) .string playersound_##m;
75 bool GetPlayerSoundSampleField_notFound;
76 float GetVoiceMessageVoiceType(string type);
77 .string GetVoiceMessageSampleField(string type);
78 .string GetPlayerSoundSampleField(string type);
79 void PrecachePlayerSounds(string f);
80 void ClearPlayerSounds(entity this);
81 float LoadPlayerSounds(string f, bool strict);
82 void UpdatePlayerSounds(entity this);
83 #define FakeGlobalSound(sample, chan, voicetype) _GlobalSound(NULL, sample, chan, voicetype, true)
84 void _GlobalSound(entity gs, string sample, float chan, float voicetype, bool fake);
85 #define GlobalSound(def, chan, voicetype) _GlobalSound(def, string_null, chan, voicetype, false)
86 void PlayerSound(.string samplefield, float chan, float voicetype);
87 void VoiceMessage(string type, string msg);