| 283 | } |
| 284 | |
| 285 | bool DSoundManager::LoadSound(unsigned int theSfxID, const StringImpl& theFilename) |
| 286 | { |
| 287 | if ((theSfxID < 0) || (theSfxID >= MAX_SOURCE_SOUNDS)) |
| 288 | return false; |
| 289 | |
| 290 | ReleaseSound(theSfxID); |
| 291 | |
| 292 | if (!mDirectSound) |
| 293 | return true; // sounds just won't play, but this is not treated as a failure condition |
| 294 | |
| 295 | mSourceFileNames[theSfxID] = theFilename; |
| 296 | |
| 297 | StringImpl aFilename = theFilename; |
| 298 | |
| 299 | if (aFilename.EndsWith(".wav", StringImpl::CompareKind_OrdinalIgnoreCase)) |
| 300 | { |
| 301 | if (LoadWAVSound(theSfxID, aFilename)) |
| 302 | return true; |
| 303 | } |
| 304 | |
| 305 | return false; |
| 306 | } |
| 307 | |
| 308 | int DSoundManager::LoadSound(const StringImpl& theFilename) |
| 309 | { |
no test coverage detected