aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/resource.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2010-11-09 16:56:31 +0000
committerMatthew Hoops2010-11-09 16:56:31 +0000
commit4582a94ff9045a132cd473e5cc61d20c382d7056 (patch)
treeecbcce296957b97a73f676b3dcff2e8acdd679d9 /engines/sci/resource.cpp
parent567441f0320630f37129655df1b73103b5a4d64f (diff)
downloadscummvm-rg350-4582a94ff9045a132cd473e5cc61d20c382d7056.tar.gz
scummvm-rg350-4582a94ff9045a132cd473e5cc61d20c382d7056.tar.bz2
scummvm-rg350-4582a94ff9045a132cd473e5cc61d20c382d7056.zip
SCI: Fix Lighthouse SCI2.1 demo
This is a regression from r54155. Fixed by moving the chunk resource loading earlier. svn-id: r54162
Diffstat (limited to 'engines/sci/resource.cpp')
-rw-r--r--engines/sci/resource.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 02602a3b85..703dc47760 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -667,6 +667,22 @@ int ResourceManager::addInternalSources() {
}
delete resources;
+
+#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);
+
+ if (resources->empty() && testResource(ResourceId(kResourceTypeChunk, 0)))
+ addResourcesFromChunk(0);
+
+ delete resources;
+ }
+#endif
+
return 1;
}
@@ -865,21 +881,6 @@ void ResourceManager::init() {
}
#endif
}
-
-#ifdef ENABLE_SCI32
- if (getSciVersion() >= SCI_VERSION_2_1) {
- // 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.
-
- Common::List<ResourceId> *scriptList = listResources(kResourceTypeScript);
-
- if (scriptList->empty() && testResource(ResourceId(kResourceTypeChunk, 0)))
- addResourcesFromChunk(0);
-
- delete scriptList;
- }
-#endif
}
ResourceManager::~ResourceManager() {