| 245 | } |
| 246 | |
| 247 | static int GetOrCreateGroup(const char* group_name) |
| 248 | { |
| 249 | dmhash_t group_hash = dmHashString64(group_name); |
| 250 | |
| 251 | SoundSystem* sound = g_SoundSystem; |
| 252 | if (sound->m_GroupMap.Full()) { |
| 253 | return -1; |
| 254 | } |
| 255 | |
| 256 | if (sound->m_GroupMap.Get(group_hash)) { |
| 257 | return *sound->m_GroupMap.Get(group_hash); |
| 258 | } |
| 259 | |
| 260 | uint32_t index = sound->m_GroupMap.Size(); |
| 261 | SoundGroup* group = &sound->m_Groups[index]; |
| 262 | group->m_NameHash = group_hash; |
| 263 | group->m_Gain = 1.0f; |
| 264 | group->m_IsMuted = false; |
| 265 | sound->m_GroupMap.Put(group_hash, index); |
| 266 | return index; |
| 267 | } |
| 268 | |
| 269 | struct ThreadArgs { |
| 270 | SoundSystem* m_Sound; |