[Scummvm-cvs-logs] SF.net SVN: scummvm:[55866] scummvm/trunk/engines/sci
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Thu Feb 10 13:57:44 CET 2011
Revision: 55866
http://scummvm.svn.sourceforge.net/scummvm/?rev=55866&view=rev
Author: thebluegr
Date: 2011-02-10 12:57:43 +0000 (Thu, 10 Feb 2011)
Log Message:
-----------
SCI: Renamed addInternalSources -> addAudioSources and separated the script chunk loading code
Modified Paths:
--------------
scummvm/trunk/engines/sci/resource.cpp
scummvm/trunk/engines/sci/resource.h
Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp 2011-02-10 12:40:48 UTC (rev 55865)
+++ scummvm/trunk/engines/sci/resource.cpp 2011-02-10 12:57:43 UTC (rev 55866)
@@ -739,7 +739,7 @@
return 1;
}
-int ResourceManager::addInternalSources() {
+bool ResourceManager::addAudioSources() {
Common::List<ResourceId> *resources = listResources(kResourceTypeMap);
Common::List<ResourceId>::iterator itr = resources->begin();
@@ -751,20 +751,24 @@
else if (Common::File::exists("RESOURCE.AUD"))
addSource(new AudioVolumeResourceSource(this, "RESOURCE.AUD", src, 0));
else
- return 0;
+ return false;
++itr;
}
delete resources;
+ return true;
+}
+
+void ResourceManager::addScriptChunkSources() {
#ifdef ENABLE_SCI32
if (_mapVersion >= kResVersionSci2) {
// If we have no scripts, but chunk 0 is present, open up the chunk
// to try to get to any scripts in there. The Lighthouse SCI2.1 demo
// does exactly this.
- resources = listResources(kResourceTypeScript);
+ Common::List<ResourceId> *resources = listResources(kResourceTypeScript);
if (resources->empty() && testResource(ResourceId(kResourceTypeChunk, 0)))
addResourcesFromChunk(0);
@@ -772,8 +776,6 @@
delete resources;
}
#endif
-
- return 1;
}
void ResourceManager::scanNewSources() {
@@ -943,13 +945,14 @@
scanNewSources();
if (!initFromFallbackDetector) {
- if (!addInternalSources()) {
+ if (!addAudioSources()) {
// FIXME: This error message is not always correct.
// OTOH, it is nice to be able to detect missing files/sources
- // So we should definitely fix addInternalSources so this error
+ // So we should definitely fix addAudioSources so this error
// only pops up when necessary. Disabling for now.
//error("Somehow I can't seem to find the sound files I need (RESOURCE.AUD/RESOURCE.SFX), aborting");
}
+ addScriptChunkSources();
scanNewSources();
}
Modified: scummvm/trunk/engines/sci/resource.h
===================================================================
--- scummvm/trunk/engines/sci/resource.h 2011-02-10 12:40:48 UTC (rev 55865)
+++ scummvm/trunk/engines/sci/resource.h 2011-02-10 12:57:43 UTC (rev 55866)
@@ -435,7 +435,8 @@
*/
void scanNewSources();
- int addInternalSources();
+ bool addAudioSources();
+ void addScriptChunkSources();
void freeResourceSources();
/**
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