[Scummvm-cvs-logs] SF.net SVN: scummvm:[49451] scummvm/trunk/engines/sci
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sun Jun 6 15:04:24 CEST 2010
Revision: 49451
http://scummvm.svn.sourceforge.net/scummvm/?rev=49451&view=rev
Author: thebluegr
Date: 2010-06-06 13:04:24 +0000 (Sun, 06 Jun 2010)
Log Message:
-----------
Now opening all files via getVolumeFile()
Modified Paths:
--------------
scummvm/trunk/engines/sci/resource.cpp
scummvm/trunk/engines/sci/resource.h
scummvm/trunk/engines/sci/resource_audio.cpp
Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp 2010-06-06 12:37:43 UTC (rev 49450)
+++ scummvm/trunk/engines/sci/resource.cpp 2010-06-06 13:04:24 UTC (rev 49451)
@@ -299,10 +299,15 @@
return loadPatch(res, &file);
}
-Common::File *ResourceManager::getVolumeFile(const char *filename) {
+Common::SeekableReadStream *ResourceManager::getVolumeFile(ResourceSource *source) {
Common::List<Common::File *>::iterator it = _volumeFiles.begin();
Common::File *file;
+ if (source->resourceFile)
+ return source->resourceFile->createReadStream();
+
+ const char *filename = source->location_name.c_str();
+
// check if file is already opened
while (it != _volumeFiles.end()) {
file = *it;
@@ -353,14 +358,8 @@
return;
}
- Common::SeekableReadStream *fileStream;
+ Common::SeekableReadStream *fileStream = getVolumeFile(res->_source);
- // Either loading from volume or patch loading failed
- if (res->_source->resourceFile)
- fileStream = res->_source->resourceFile->createReadStream();
- else
- fileStream = getVolumeFile(res->_source->location_name.c_str());
-
if (!fileStream) {
warning("Failed to open %s", res->_source->location_name.c_str());
res->unalloc();
@@ -1604,10 +1603,7 @@
if (res->_source->source_type != kSourceVolume)
continue;
- if (res->_source->resourceFile)
- fileStream = res->_source->resourceFile->createReadStream();
- else
- fileStream = getVolumeFile(res->_source->location_name.c_str());
+ fileStream = getVolumeFile(res->_source);
if (!fileStream)
continue;
Modified: scummvm/trunk/engines/sci/resource.h
===================================================================
--- scummvm/trunk/engines/sci/resource.h 2010-06-06 12:37:43 UTC (rev 49450)
+++ scummvm/trunk/engines/sci/resource.h 2010-06-06 13:04:24 UTC (rev 49451)
@@ -393,7 +393,7 @@
*/
const char *versionDescription(ResVersion version) const;
- Common::File *getVolumeFile(const char *filename);
+ Common::SeekableReadStream *getVolumeFile(ResourceSource *source);
void loadResource(Resource *res);
bool loadPatch(Resource *res, Common::SeekableReadStream *file);
bool loadFromPatchFile(Resource *res);
Modified: scummvm/trunk/engines/sci/resource_audio.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource_audio.cpp 2010-06-06 12:37:43 UTC (rev 49450)
+++ scummvm/trunk/engines/sci/resource_audio.cpp 2010-06-06 13:04:24 UTC (rev 49451)
@@ -33,13 +33,8 @@
namespace Sci {
void ResourceManager::checkIfAudioVolumeIsCompressed(ResourceSource *source) {
- Common::SeekableReadStream *fileStream;
+ Common::SeekableReadStream *fileStream = getVolumeFile(source);
- if (source->resourceFile)
- fileStream = source->resourceFile->createReadStream();
- else
- fileStream = getVolumeFile(source->location_name.c_str());
-
if (!fileStream) {
warning("Failed to open %s", source->location_name.c_str());
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list