| 199 | } |
| 200 | |
| 201 | void SoundEffectsManager::playSpatialSound(const std::string& family, |
| 202 | float XPos, float YPos, float height) |
| 203 | { |
| 204 | auto it = mSpatialSounds.find(family); |
| 205 | if(it == mSpatialSounds.end()) |
| 206 | { |
| 207 | OD_LOG_ERR("Couldn't find sound family=" + family); |
| 208 | return; |
| 209 | } |
| 210 | |
| 211 | std::vector<GameSound*>& sounds = it->second; |
| 212 | if(sounds.empty()) |
| 213 | { |
| 214 | OD_LOG_ERR("No sound found for sound family=" + family); |
| 215 | return; |
| 216 | } |
| 217 | |
| 218 | unsigned int soundId = Random::Uint(0, sounds.size() - 1); |
| 219 | sounds[soundId]->play(XPos, YPos, height); |
| 220 | } |
| 221 | |
| 222 | void SoundEffectsManager::playRelativeSound(const std::string& family) |
| 223 | { |
no test coverage detected