Initialize the ambient sound system
| 171 | |
| 172 | // Initialize the ambient sound system |
| 173 | void InitAmbientSoundSystem() { |
| 174 | atexit(FreeAmbientSoundData); |
| 175 | |
| 176 | ReadAmbientData(); |
| 177 | |
| 178 | // Get rid of deleted patterns |
| 179 | for (int p = 0; p < Num_ambient_sound_patterns; p++) { |
| 180 | |
| 181 | asp *asp = &Ambient_sound_patterns[p]; |
| 182 | |
| 183 | if (!asp->name[0]) { |
| 184 | Ambient_sound_patterns[p] = Ambient_sound_patterns[Num_ambient_sound_patterns - 1]; |
| 185 | Num_ambient_sound_patterns--; |
| 186 | } |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | // Return the index of a named ambient sound pattern |
| 191 | // Returns number, or -1 if can't find |
no test coverage detected