| 317 | Poseidon::Foundation::WarningMessage("Environmental sound %s not found", (const char*)name); |
| 318 | } |
| 319 | |
| 320 | static void PreferExistingVoiceLanguageOverride(SoundPars& pars); |
| 321 | |
| 322 | void FindSFX(RString name, SoundEntry& emptySound, AutoArray<SoundEntry>& sounds) |
| 323 | { |
| 324 | // ignore @ - not used now |
| 325 | if (name[0] == '@') |
| 326 | { |
| 327 | name = (const char*)name + 1; |
| 328 | } |
| 329 | |
| 330 | // find in mission |
| 331 | const ParamEntry* cls = ExtParsMission.FindEntry("CfgSFX"); |
| 332 | const ParamEntry* entry = cls ? cls->FindEntry(name) : nullptr; |
| 333 | if (entry) |
| 334 | { |
| 335 | // load empty sound |
| 336 | emptySound = DynSound::LoadEntry((*entry) >> "empty"); |
| 337 | if (emptySound.name.GetLength() > 0) |
| 338 | { |
| 339 | emptySound.name = GetMissionDirectory() + emptySound.name; |
| 340 | } |
| 341 | // load sound scheme |
| 342 | const ParamEntry& list = (*entry) >> "sounds"; |
| 343 | int n = list.GetSize(); |
| 344 | sounds.Resize(n); |
| 345 | for (int i = 0; i < n; i++) |
| 346 | { |
| 347 | RString name = list[i]; |
| 348 | SoundEntry& sound = sounds[i]; |
| 349 | sound = DynSound::LoadEntry((*entry) >> name); |
| 350 | if (sound.name.GetLength() > 0) |
| 351 | { |
| 352 | sound.name = GetMissionDirectory() + sound.name; |
| 353 | PreferExistingVoiceLanguageOverride(sound); |
| 354 | } |
| 355 | } |
| 356 | // return sound location |
| 357 | return; // ExtParsMission.GetName(); |
| 358 | } |
| 359 | |
| 360 | // find in campaign |
| 361 | cls = ExtParsCampaign.FindEntry("CfgSFX"); |
| 362 | entry = cls ? cls->FindEntry(name) : nullptr; |
| 363 | if (entry) |
| 364 | { |
| 365 | // load empty sound |
| 366 | emptySound = DynSound::LoadEntry((*entry) >> "empty"); |
| 367 | if (emptySound.name.GetLength() > 0) |
| 368 | { |
| 369 | emptySound.name = BaseDirectory + RString("dtaExt\\") + emptySound.name; |
| 370 | } |
| 371 | // load sound scheme |
| 372 | const ParamEntry& list = (*entry) >> "sounds"; |
| 373 | int n = list.GetSize(); |
| 374 | sounds.Resize(n); |
| 375 | for (int i = 0; i < n; i++) |
| 376 | { |
no test coverage detected