aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sci.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2009-05-14 09:12:27 +0000
committerFilippos Karapetis2009-05-14 09:12:27 +0000
commit999d46b241a4aade493f76b4f3623a39c4fed930 (patch)
tree56a1c2079395ab22ccae8a003691230f073635e3 /engines/sci/sci.cpp
parent2ca7605050c25eff88931fe523c2b005856803f1 (diff)
downloadscummvm-rg350-999d46b241a4aade493f76b4f3623a39c4fed930.tar.gz
scummvm-rg350-999d46b241a4aade493f76b4f3623a39c4fed930.tar.bz2
scummvm-rg350-999d46b241a4aade493f76b4f3623a39c4fed930.zip
Started using game-specific flags and removed/replaced some SCI version checks with flags.
- The SCI0 new script header and the angles check have been replaced by the GF_SCI0_OLD flag - The SCI0 new drawpic parameter and the new priority check have been replaced by the GF_SCI0_OLDGFXFUNCS flag - Removed the code which retries to use the newer script header in SCI0 games if the detected one is wrong, as that case should be covered by the GF_SCI0_OLD flag - Removed the leftover min_version and max_version variables from gamestate - Cleaned up kGetTime() a bit svn-id: r40552
Diffstat (limited to 'engines/sci/sci.cpp')
-rw-r--r--engines/sci/sci.cpp48
1 files changed, 3 insertions, 45 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 3359ed9898..6c6dd7356c 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -81,50 +81,7 @@ static void init_console() {
}
static int init_gamestate(EngineState *gamestate, sci_version_t version) {
- int errc;
-
- if ((errc = script_init_engine(gamestate, version))) { // Initialize game state
- int recovered = 0;
-
- if (errc == SCI_ERROR_INVALID_SCRIPT_VERSION) {
- int tversion = SCI_VERSION_FTU_NEW_SCRIPT_HEADER - ((version < SCI_VERSION_FTU_NEW_SCRIPT_HEADER) ? 0 : 1);
-
- while (!recovered && tversion) {
- printf("Trying version %d.%03x.%03d instead\n", SCI_VERSION_MAJOR(tversion),
- SCI_VERSION_MINOR(tversion), SCI_VERSION_PATCHLEVEL(tversion));
-
- errc = script_init_engine(gamestate, tversion);
-
- if ((recovered = !errc))
- version = tversion;
-
- if (errc != SCI_ERROR_INVALID_SCRIPT_VERSION)
- break;
-
- switch (tversion) {
-
- case SCI_VERSION_FTU_NEW_SCRIPT_HEADER - 1:
- if (version >= SCI_VERSION_FTU_NEW_SCRIPT_HEADER)
- tversion = 0;
- else
- tversion = SCI_VERSION_FTU_NEW_SCRIPT_HEADER;
- break;
-
- case SCI_VERSION_FTU_NEW_SCRIPT_HEADER:
- tversion = 0;
- break;
- }
- }
- if (recovered)
- printf("Success.\n");
- }
-
- if (!recovered) {
- fprintf(stderr, "Script initialization failed. Aborting...\n");
- return 1;
- }
- }
- return 0;
+ return script_init_engine(gamestate, version);
}
SciEngine::SciEngine(OSystem *syst, const SciGameDescription *desc)
@@ -222,6 +179,7 @@ Common::Error SciEngine::run() {
EngineState *gamestate = new EngineState();
gamestate->resmgr = _resmgr;
gamestate->gfx_state = NULL;
+ gamestate->flags = getFlags();
if (init_gamestate(gamestate, version))
return Common::kUnknownError;
@@ -328,7 +286,7 @@ Common::Platform SciEngine::getPlatform() const {
}
uint32 SciEngine::getFlags() const {
- return _gameDescription->desc.flags;
+ return _gameDescription->flags;
}
Common::String SciEngine::getSavegameName(int nr) const {