return null if sound is not found

svn-id: r16737
This commit is contained in:
Paweł Kołodziejski 2005-02-06 10:09:37 +00:00
parent d261e3c9d3
commit ac72fcd63d
2 changed files with 7 additions and 2 deletions

View File

@ -140,10 +140,11 @@ File *BundleMgr::getFile(const char *filename, int32 &offset, int32 &size) {
_file.seek(_bundleTable[i].offset, SEEK_SET);
offset = _bundleTable[i].offset;
size = _bundleTable[i].size;
break;
return &_file;
}
}
return &_file;
return NULL;
}
bool BundleMgr::open(const char *filename, bool &compressed) {

View File

@ -366,6 +366,10 @@ ImuseDigiSndMgr::soundStruct *ImuseDigiSndMgr::openSound(int32 soundId, const ch
int32 offset = 0, size = 0;
sprintf(fileName, "%s.map", soundName);
File *rmapFile = sound->bundle->getFile(fileName, offset, size);
if (!rmapFile) {
closeSound(sound);
return NULL;
}
prepareSoundFromRMAP(rmapFile, sound, offset, size);
strcpy(sound->name, soundName);
sound->soundId = soundId;