From 1a0201f7e978df307e496a43691b81950eba66b1 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 15 Jun 2010 12:17:25 +0000 Subject: SCI: cleanup svn-id: r49829 --- engines/sci/resource.cpp | 3 ++- engines/sci/resource_audio.cpp | 9 ++------- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'engines') 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(); -- cgit v1.2.3