aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2010-11-09 19:37:42 +0000
committerFilippos Karapetis2010-11-09 19:37:42 +0000
commit1a85ce8e036a292b3d2569d8044b787e76ce48f9 (patch)
treeef6a631b35fa012598d89323b2e63cc7fa3a2c85 /engines
parent45f4f84e03320cdcac569405b6209b5e763f0bdf (diff)
downloadscummvm-rg350-1a85ce8e036a292b3d2569d8044b787e76ce48f9.tar.gz
scummvm-rg350-1a85ce8e036a292b3d2569d8044b787e76ce48f9.tar.bz2
scummvm-rg350-1a85ce8e036a292b3d2569d8044b787e76ce48f9.zip
SCI: Some slight work on SCI3
- Enabled the SCI3 game entries for testing purposes - The resource manager is initialized fully now (with a slight hack) - Added a hack for the demo of Shivers 2 (which seemingly has no scripts or vocabularies) - The engine will stop before parsing any game scripts in SCI3 games, and opens the console for resource manager-related functionality svn-id: r54167
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/detection_tables.h2
-rw-r--r--engines/sci/engine/seg_manager.cpp14
-rw-r--r--engines/sci/resource.cpp17
-rw-r--r--engines/sci/sci.cpp13
4 files changed, 39 insertions, 7 deletions
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 79acbf41b7..669cff57b0 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -26,7 +26,7 @@
namespace Sci {
// SCI3 games have a different script format (in CSC files) and are currently unsupported
-//#define ENABLE_SCI3_GAMES
+#define ENABLE_SCI3_GAMES
#define FANMADE_L(name, resMapMd5, resMapSize, resMd5, resSize, lang) \
{"sci-fanmade", name, { \
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index d509046a15..cd4baa0ac3 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -946,8 +946,18 @@ void SegManager::freeString(reg_t addr) {
void SegManager::createClassTable() {
Resource *vocab996 = _resMan->findResource(ResourceId(kResourceTypeVocab, 996), 1);
- if (!vocab996)
- error("SegManager: failed to open vocab 996");
+ if (!vocab996) {
+ if (getSciVersion() <= SCI_VERSION_2_1) {
+ error("SegManager: failed to open vocab 996");
+ } else {
+ // TODO/FIXME: The demo of Shivers 2 has no vocabularies or scripts!
+ // This is either a problem with the resource manager, or the game is
+ // simply not using SCI. Since we are not actually running game scripts
+ // in SCI3, stop here for now
+ warning("SegManager: failed to open vocab 996 in SCI3");
+ return;
+ }
+ }
int totalClasses = vocab996->size >> 2;
_classTable.resize(totalClasses);
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index f08c72a833..cb3b2807e6 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -824,6 +824,13 @@ void ResourceManager::init(bool initFromFallbackDetector) {
_mapVersion = detectMapVersion();
_volVersion = detectVolVersion();
+
+ // TODO/FIXME: Remove once SCI3 resource detection is finished
+ if ((_mapVersion == kResVersionSci3 || _volVersion == kResVersionSci3) && (_mapVersion != _volVersion)) {
+ warning("FIXME: Incomplete SCI3 detection: setting map and volume version to SCI3");
+ _mapVersion = _volVersion = kResVersionSci3;
+ }
+
if ((_volVersion == kResVersionUnknown) && (_mapVersion != kResVersionUnknown)) {
warning("Volume version not detected, but map version has been detected. Setting volume version to map version");
_volVersion = _mapVersion;
@@ -1046,6 +1053,8 @@ ResVersion ResourceManager::detectMapVersion() {
byte buff[6];
ResourceSource *rsrc= 0;
+ // TODO: Add SCI3 support
+
for (Common::List<ResourceSource *>::iterator it = _sources.begin(); it != _sources.end(); ++it) {
rsrc = *it;
@@ -2150,12 +2159,12 @@ void ResourceManager::detectSciVersion() {
case kResVersionSci11:
s_sciVersion = SCI_VERSION_1_1;
return;
+ case kResVersionSci3:
+ s_sciVersion = SCI_VERSION_3;
+ return;
default:
s_sciVersion = SCI_VERSION_NONE;
- if (_volVersion == kResVersionSci3)
- error("detectSciVersion(): Detected an SCI3 game, currently unsupported");
- else
- error("detectSciVersion(): Unable to detect the game's SCI version");
+ error("detectSciVersion(): Unable to detect the game's SCI version");
}
}
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index c9b94d1a8b..60b4ad4098 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -224,6 +224,19 @@ Common::Error SciEngine::run() {
_audio = new AudioPlayer(_resMan);
_gamestate = new EngineState(segMan);
_eventMan = new EventManager(_resMan->detectFontExtended());
+
+ // TODO/FIXME: Remove once SCI3 support is improved
+ if (getSciVersion() == SCI_VERSION_3) {
+ initGraphics(); // invoked to init the graphics subsystem
+ _gamestate->_msgState = NULL; // for proper engine destruction
+ // Attach the console to use resource manager functionality
+ _console->attach();
+ _console->DebugPrintf("\nSCI3 game, stopping before actual game initialization.\n"
+ "Resource-related functionality should be usable at this point\n\n");
+ _console->onFrame();
+
+ return Common::kNoError;
+ }
// The game needs to be initialized before the graphics system is initialized, as
// the graphics code checks parts of the seg manager upon initialization (e.g. for