diff options
Diffstat (limited to 'engines/sci/detection.cpp')
-rw-r--r-- | engines/sci/detection.cpp | 62 |
1 files changed, 21 insertions, 41 deletions
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 09c348f273..bac9b3467a 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -105,9 +105,8 @@ static const PlainGameDescriptor s_sciGameTitles[] = { // === SCI2.1 games ======================================================== {"chest", "Inside the Chest"}, // aka Behind the Developer's Shield {"gk2", "The Beast Within: A Gabriel Knight Mystery"}, - // TODO: Inside The Chest/Behind the Developer's Shield {"kq7", "King's Quest VII: The Princeless Bride"}, - // TODO: King's Questions + {"kquestions", "King's Questions"}, {"lsl6hires", "Leisure Suit Larry 6: Shape Up or Slip Out!"}, {"mothergoosehires","Mixed-Up Mother Goose Deluxe"}, {"phantasmagoria", "Phantasmagoria"}, @@ -161,6 +160,7 @@ static const GameIdStrToEnum s_gameIdStrToEnum[] = { { "kq5", GID_KQ5 }, { "kq6", GID_KQ6 }, { "kq7", GID_KQ7 }, + { "kquestions", GID_KQUESTIONS }, { "laurabow", GID_LAURABOW }, { "laurabow2", GID_LAURABOW2 }, { "lighthouse", GID_LIGHTHOUSE }, @@ -242,6 +242,7 @@ static const OldNewIdTableEntry s_oldNewTable[] = { // kq5 is the same // kq6 is the same { "kq7cd", "kq7", SCI_VERSION_NONE }, + { "quizgame-demo", "kquestions", SCI_VERSION_NONE }, { "mm1", "laurabow", SCI_VERSION_NONE }, { "cb1", "laurabow", SCI_VERSION_NONE }, { "lb2", "laurabow2", SCI_VERSION_NONE }, @@ -370,8 +371,8 @@ static const ADExtraGuiOptionsMap optionsList[] = { { GAMEOPTION_EGA_UNDITHER, { - _s("EGA undithering"), - _s("Enable undithering in EGA games"), + _s("Skip EGA dithering pass (full color backgrounds)"), + _s("Skip dithering pass in EGA games, graphics are shown with full colors"), "disable_dithering", false } @@ -562,31 +563,28 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, // If these files aren't found, it can't be SCI - if (!foundResMap && !foundRes000) { + if (!foundResMap && !foundRes000) return 0; - } ResourceManager resMan; - resMan.addAppropriateSources(fslist); - resMan.init(true); + resMan.addAppropriateSourcesForDetection(fslist); + resMan.initForDetection(); // TODO: Add error handling. #ifndef ENABLE_SCI32 // Is SCI32 compiled in? If not, and this is a SCI32 game, // stop here - if (getSciVersion() >= SCI_VERSION_2) { - return (const ADGameDescription *)&s_fallbackDesc; - } + if (getSciVersionForDetection() >= SCI_VERSION_2) + return 0; #endif ViewType gameViews = resMan.getViewType(); // Have we identified the game views? If not, stop here - // Can't be SCI (or unsupported SCI views). Pinball Creep by sierra also uses resource.map/resource.000 files - // but doesnt share sci format at all, if we dont return 0 here we will detect this game as SCI - if (gameViews == kViewUnknown) { + // Can't be SCI (or unsupported SCI views). Pinball Creep by Sierra also uses resource.map/resource.000 files + // but doesn't share SCI format at all + if (gameViews == kViewUnknown) return 0; - } // Set the platform to Amiga if the game is using Amiga views if (gameViews == kViewAmiga) @@ -596,9 +594,8 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, Common::String sierraGameId = resMan.findSierraGameId(); // If we don't have a game id, the game is not SCI - if (sierraGameId.empty()) { + if (sierraGameId.empty()) return 0; - } Common::String gameId = convertSierraGameId(sierraGameId, &s_fallbackDesc.flags, resMan); strncpy(s_fallbackGameIdBuf, gameId.c_str(), sizeof(s_fallbackGameIdBuf) - 1); @@ -794,22 +791,9 @@ void SciMetaEngine::removeSaveState(const char *target, int slot) const { } Common::Error SciEngine::loadGameState(int slot) { - Common::String fileName = Common::String::format("%s.%03d", _targetName.c_str(), slot); - Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager(); - Common::SeekableReadStream *in = saveFileMan->openForLoading(fileName); - - if (in) { - // found a savegame file - gamestate_restore(_gamestate, in); - delete in; - } - - if (_gamestate->r_acc != make_reg(0, 1)) { - return Common::kNoError; - } else { - warning("Restoring gamestate '%s' failed", fileName.c_str()); - return Common::kUnknownError; - } + _gamestate->_delayedRestoreGameId = slot; + _gamestate->_delayedRestoreGame = true; + return Common::kNoError; } Common::Error SciEngine::saveGameState(int slot, const Common::String &desc) { @@ -837,16 +821,12 @@ Common::Error SciEngine::saveGameState(int slot, const Common::String &desc) { return Common::kNoError; } -// Before enabling the load option in the ScummVM menu, the main game loop must -// have run at least once. When the game loop runs, kGameIsRestarting is invoked, -// thus the speed throttler is initialized. Hopefully fixes bug #3565505. - bool SciEngine::canLoadGameStateCurrently() { - return !_gamestate->executionStackBase && (_gamestate->_throttleLastTime > 0 || _gamestate->_throttleTrigger); + return !_gamestate->executionStackBase; } bool SciEngine::canSaveGameStateCurrently() { - return !_gamestate->executionStackBase && (_gamestate->_throttleLastTime > 0 || _gamestate->_throttleTrigger); + return !_gamestate->executionStackBase; } } // End of namespace Sci |