diff options
Diffstat (limited to 'engines/sci/sci.cpp')
-rw-r--r-- | engines/sci/sci.cpp | 85 |
1 files changed, 3 insertions, 82 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 74eb37f5dc..02e92e7d11 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -128,86 +128,6 @@ init_gamestate(state_t *gamestate, sci_version_t version) { return 0; } -static void -detect_versions(sci_version_t *version, int *res_version) { - sci_version_t exe_version; - sci_version_t hash_version; - int hash_res_version; - guint32 code; - int got_exe_version; - const char *game_name; - - sciprintf("Detecting interpreter and resource versions...\n"); - - got_exe_version = !version_detect_from_executable(&exe_version); - - if (got_exe_version) { - sciprintf("Interpreter version: %d.%03d.%03d (by executable scan)\n", - SCI_VERSION_MAJOR(exe_version), - SCI_VERSION_MINOR(exe_version), - SCI_VERSION_PATCHLEVEL(exe_version)); - - if (SCI_VERSION_MAJOR(exe_version) >= 1) { - sciprintf("FIXME: Implement version mapping (results of executable scan ignored)\n"); - got_exe_version = 0; - } - - } - - game_name = version_guess_from_hashcode(&hash_version, &hash_res_version, &code); - - if (game_name) { - sciprintf("Interpreter version: %d.%03d.%03d (by hash code %08X)\n", - SCI_VERSION_MAJOR(hash_version), - SCI_VERSION_MINOR(hash_version), - SCI_VERSION_PATCHLEVEL(hash_version), code); - if (got_exe_version && exe_version != hash_version) - sciprintf("UNEXPECTED INCONSISTENCY: Hash code %08X indicates interpreter version\n" - " %d.%03d.%03d, but analysis of the executable yields %d.%03d.%03d (for game\n" - " '%s'). Please report this!\n", - code, - SCI_VERSION_MAJOR(hash_version), - SCI_VERSION_MINOR(hash_version), - SCI_VERSION_PATCHLEVEL(hash_version), - SCI_VERSION_MAJOR(exe_version), - SCI_VERSION_MINOR(exe_version), - SCI_VERSION_PATCHLEVEL(exe_version), game_name); - - if (hash_res_version != SCI_VERSION_AUTODETECT) - sciprintf("Resource version: %d (by hash code)\n", hash_res_version); - - sciprintf("Game identified as '%s'\n", game_name); - } else { - sciprintf("Could not identify game by hash code: %08X\n", code); - - if (got_exe_version) - sciprintf("Please report the preceding two lines and the name of the game you were trying\n" - "to run to the FreeSCI development team to help other users!\n", - code); - } - - if (game_name) - *version = hash_version; - else if (got_exe_version) - *version = exe_version; - else - *version = 0; - - if (game_name) - *res_version = hash_res_version; - else - *res_version = SCI_VERSION_AUTODETECT; - - if (*version) - sciprintf("Using interpreter version %d.%03d.%03d\n", - SCI_VERSION_MAJOR(*version), - SCI_VERSION_MINOR(*version), - SCI_VERSION_PATCHLEVEL(*version)); - - if (*res_version != SCI_VERSION_AUTODETECT) - sciprintf("Using resource version %d\n", *res_version); -} - SciEngine::SciEngine(OSystem *syst, const SciGameDescription *desc) : Engine(syst) { // Put your engine in a sane state, but do nothing big yet; @@ -221,6 +141,7 @@ SciEngine::SciEngine(OSystem *syst, const SciGameDescription *desc) // Set up the engine specific debug levels //Common::addSpecialDebugLevel(SCI_DEBUG_RESOURCES, "resources", "Debug the resources loading"); + _version = desc->version; printf("SciEngine::SciEngine\n"); } @@ -269,12 +190,12 @@ Common::Error SciEngine::go() { script_debug_flag = 0; sci_version_t version; - int res_version; + int res_version = SCI_VERSION_AUTODETECT; // FIXME. An evil hack until File class will be used properly chdir(ConfMan.get("path").c_str()); - detect_versions(&version, &res_version); + version = getVersion(); char resource_dir[MAXPATHLEN+1] = ""; getcwd(resource_dir, MAXPATHLEN); /* Store resource directory */ |