diff options
author | Max Horn | 2010-06-15 12:17:25 +0000 |
---|---|---|
committer | Max Horn | 2010-06-15 12:17:25 +0000 |
commit | 1a0201f7e978df307e496a43691b81950eba66b1 (patch) | |
tree | 99eccbe2e2e0b4038cb25b916ffef6c1b769c176 | |
parent | 6248daccfc636533ad294df7739b00c0f011f2e3 (diff) | |
download | scummvm-rg350-1a0201f7e978df307e496a43691b81950eba66b1.tar.gz scummvm-rg350-1a0201f7e978df307e496a43691b81950eba66b1.tar.bz2 scummvm-rg350-1a0201f7e978df307e496a43691b81950eba66b1.zip |
SCI: cleanup
svn-id: r49829
-rw-r--r-- | engines/sci/resource.cpp | 3 | ||||
-rw-r--r-- | engines/sci/resource_audio.cpp | 9 |
2 files changed, 4 insertions, 8 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 7d6835a336..df66fe0e38 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -351,7 +351,8 @@ Common::SeekableReadStream *ResourceSource::getVolumeFile(Resource *res) { if (!fileStream) { warning("Failed to open %s", getLocationName().c_str()); - res->unalloc(); + if (res) + res->unalloc(); } return fileStream; diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp index 4f38fe15d1..472a9773ae 100644 --- a/engines/sci/resource_audio.cpp +++ b/engines/sci/resource_audio.cpp @@ -36,20 +36,15 @@ namespace Sci { AudioVolumeResourceSource::AudioVolumeResourceSource(const Common::String &name, ResourceSource *map, int volNum) : VolumeResourceSource(name, map, volNum, kSourceAudioVolume) { - ResourceManager *resMan = g_sci->getResMan(); - /* * Check if this audio volume got compressed by our tool. If that is the * case, set _audioCompressionType and read in the offset translation * table for later usage. */ - Common::SeekableReadStream *fileStream = resMan->getVolumeFile(this); - - if (!fileStream) { - warning("Failed to open %s", getLocationName().c_str()); + Common::SeekableReadStream *fileStream = getVolumeFile(0); + if (!fileStream) return; - } fileStream->seek(0, SEEK_SET); uint32 compressionType = fileStream->readUint32BE(); |