[Scummvm-cvs-logs] SF.net SVN: scummvm:[54167] scummvm/trunk/engines/sci
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Tue Nov 9 20:37:42 CET 2010
Revision: 54167
http://scummvm.svn.sourceforge.net/scummvm/?rev=54167&view=rev
Author: thebluegr
Date: 2010-11-09 19:37:42 +0000 (Tue, 09 Nov 2010)
Log Message:
-----------
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
Modified Paths:
--------------
scummvm/trunk/engines/sci/detection_tables.h
scummvm/trunk/engines/sci/engine/seg_manager.cpp
scummvm/trunk/engines/sci/resource.cpp
scummvm/trunk/engines/sci/sci.cpp
Modified: scummvm/trunk/engines/sci/detection_tables.h
===================================================================
--- scummvm/trunk/engines/sci/detection_tables.h 2010-11-09 18:58:44 UTC (rev 54166)
+++ scummvm/trunk/engines/sci/detection_tables.h 2010-11-09 19:37:42 UTC (rev 54167)
@@ -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, { \
Modified: scummvm/trunk/engines/sci/engine/seg_manager.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.cpp 2010-11-09 18:58:44 UTC (rev 54166)
+++ scummvm/trunk/engines/sci/engine/seg_manager.cpp 2010-11-09 19:37:42 UTC (rev 54167)
@@ -946,8 +946,18 @@
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);
Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp 2010-11-09 18:58:44 UTC (rev 54166)
+++ scummvm/trunk/engines/sci/resource.cpp 2010-11-09 19:37:42 UTC (rev 54167)
@@ -824,6 +824,13 @@
_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 @@
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 @@
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");
}
}
Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp 2010-11-09 18:58:44 UTC (rev 54166)
+++ scummvm/trunk/engines/sci/sci.cpp 2010-11-09 19:37:42 UTC (rev 54167)
@@ -224,7 +224,20 @@
_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
// the presence of the fastCast object)
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