2009-12-29 23:18:24 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* 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.
|
2014-02-18 02:34:22 +01:00
|
|
|
*
|
2009-12-29 23:18:24 +00:00
|
|
|
* 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.
|
2014-02-18 02:34:22 +01:00
|
|
|
*
|
2009-12-29 23:18:24 +00:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "base/plugins.h"
|
|
|
|
|
2020-01-23 10:50:52 +01:00
|
|
|
#include "backends/keymapper/action.h"
|
|
|
|
#include "backends/keymapper/keymap.h"
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
#include "engines/advancedDetector.h"
|
2016-09-15 14:34:48 +02:00
|
|
|
#include "common/config-manager.h"
|
2009-12-29 23:18:24 +00:00
|
|
|
#include "common/savefile.h"
|
2011-04-24 11:34:27 +03:00
|
|
|
#include "common/system.h"
|
2011-04-28 20:24:24 +03:00
|
|
|
#include "common/textconsole.h"
|
2016-02-28 09:28:18 +01:00
|
|
|
#include "common/translation.h"
|
2009-12-29 23:18:24 +00:00
|
|
|
|
2020-03-22 15:19:56 +01:00
|
|
|
#include "mohawk/dialogs.h"
|
2009-12-29 23:18:24 +00:00
|
|
|
#include "mohawk/livingbooks.h"
|
2011-03-28 15:31:14 -04:00
|
|
|
|
|
|
|
#ifdef ENABLE_CSTIME
|
2011-01-20 21:35:00 +00:00
|
|
|
#include "mohawk/cstime.h"
|
2011-03-28 15:31:14 -04:00
|
|
|
#endif
|
2009-12-29 23:18:24 +00:00
|
|
|
|
2011-03-28 15:20:30 -04:00
|
|
|
#ifdef ENABLE_MYST
|
|
|
|
#include "mohawk/myst.h"
|
2016-02-22 08:31:02 +01:00
|
|
|
#include "mohawk/myst_state.h"
|
2011-03-28 15:20:30 -04:00
|
|
|
#endif
|
|
|
|
|
2019-10-05 19:04:58 +02:00
|
|
|
#ifdef ENABLE_MYSTME
|
|
|
|
#ifndef ENABLE_MYST
|
|
|
|
#error "Myst must be enabled for building Myst ME. Specify --enable-engine=myst,mystme"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2011-03-28 15:43:57 -04:00
|
|
|
#ifdef ENABLE_RIVEN
|
|
|
|
#include "mohawk/riven.h"
|
2016-07-10 20:43:34 +02:00
|
|
|
#include "mohawk/riven_saveload.h"
|
2011-03-28 15:43:57 -04:00
|
|
|
#endif
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
namespace Mohawk {
|
|
|
|
|
2018-06-30 21:49:41 +02:00
|
|
|
struct MohawkGameDescription {
|
|
|
|
ADGameDescription desc;
|
|
|
|
|
|
|
|
uint8 gameType;
|
|
|
|
uint32 features;
|
|
|
|
const char *appName;
|
|
|
|
};
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
const char* MohawkEngine::getGameId() const {
|
2016-03-08 18:53:55 +01:00
|
|
|
return _gameDescription->desc.gameId;
|
2009-12-29 23:18:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uint32 MohawkEngine::getFeatures() const {
|
|
|
|
return _gameDescription->features;
|
|
|
|
}
|
|
|
|
|
2020-03-27 20:14:46 +01:00
|
|
|
bool MohawkEngine::isGameVariant(MohawkGameFeatures feature) const {
|
|
|
|
return (_gameDescription->features & feature) != 0;
|
|
|
|
}
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
Common::Platform MohawkEngine::getPlatform() const {
|
|
|
|
return _gameDescription->desc.platform;
|
|
|
|
}
|
|
|
|
|
2010-11-24 21:12:21 +00:00
|
|
|
const char *MohawkEngine::getAppName() const {
|
|
|
|
return _gameDescription->appName;
|
2009-12-29 23:18:24 +00:00
|
|
|
}
|
|
|
|
|
2009-12-30 23:02:14 +00:00
|
|
|
uint8 MohawkEngine::getGameType() const {
|
2009-12-29 23:18:24 +00:00
|
|
|
return _gameDescription->gameType;
|
|
|
|
}
|
|
|
|
|
2009-12-30 23:02:14 +00:00
|
|
|
Common::String MohawkEngine_LivingBooks::getBookInfoFileName() const {
|
2009-12-29 23:18:24 +00:00
|
|
|
return _gameDescription->desc.filesDescriptions[0].fileName;
|
|
|
|
}
|
|
|
|
|
2009-12-30 23:02:14 +00:00
|
|
|
Common::Language MohawkEngine::getLanguage() const {
|
2009-12-29 23:18:24 +00:00
|
|
|
return _gameDescription->desc.language;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MohawkEngine::hasFeature(EngineFeature f) const {
|
|
|
|
return
|
2020-05-11 08:42:53 -04:00
|
|
|
(f == kSupportsReturnToLauncher);
|
2009-12-29 23:18:24 +00:00
|
|
|
}
|
|
|
|
|
2011-03-28 15:20:30 -04:00
|
|
|
#ifdef ENABLE_MYST
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
bool MohawkEngine_Myst::hasFeature(EngineFeature f) const {
|
2010-01-25 01:39:44 +00:00
|
|
|
return
|
2009-12-29 23:18:24 +00:00
|
|
|
MohawkEngine::hasFeature(f)
|
2020-03-22 15:19:56 +01:00
|
|
|
|| (f == kSupportsLoadingDuringRuntime)
|
|
|
|
|| (f == kSupportsSavingDuringRuntime)
|
|
|
|
|| (f == kSupportsChangingOptionsDuringRuntime);
|
2009-12-29 23:18:24 +00:00
|
|
|
}
|
|
|
|
|
2011-03-28 15:20:30 -04:00
|
|
|
#endif
|
|
|
|
|
2011-03-28 15:43:57 -04:00
|
|
|
#ifdef ENABLE_RIVEN
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
bool MohawkEngine_Riven::hasFeature(EngineFeature f) const {
|
2010-01-25 01:39:44 +00:00
|
|
|
return
|
2009-12-29 23:18:24 +00:00
|
|
|
MohawkEngine::hasFeature(f)
|
2020-03-22 15:19:56 +01:00
|
|
|
|| (f == kSupportsLoadingDuringRuntime)
|
|
|
|
|| (f == kSupportsSavingDuringRuntime)
|
|
|
|
|| (f == kSupportsChangingOptionsDuringRuntime);
|
2009-12-29 23:18:24 +00:00
|
|
|
}
|
|
|
|
|
2011-03-28 15:43:57 -04:00
|
|
|
#endif
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
} // End of Namespace Mohawk
|
|
|
|
|
|
|
|
static const PlainGameDescriptor mohawkGames[] = {
|
|
|
|
{"myst", "Myst"},
|
2016-09-15 09:22:47 +02:00
|
|
|
{"makingofmyst", "The Making of Myst"},
|
2009-12-29 23:18:24 +00:00
|
|
|
{"riven", "Riven: The Sequel to Myst"},
|
2011-01-03 22:53:12 +00:00
|
|
|
{"cstime", "Where in Time is Carmen Sandiego?"},
|
2011-01-31 23:10:18 +00:00
|
|
|
{"carmentq", "Carmen Sandiego's ThinkQuick Challenge"},
|
2011-04-07 18:13:32 -04:00
|
|
|
{"carmentqc", "Carmen Sandiego's ThinkQuick Challenge Custom Question Creator"},
|
2010-11-29 06:35:50 +00:00
|
|
|
{"maggiesfa", "Maggie's Farmyard Adventure"},
|
2009-12-29 23:18:24 +00:00
|
|
|
{"greeneggs", "Green Eggs and Ham"},
|
2011-03-27 11:44:02 -04:00
|
|
|
{"seussabc", "Dr Seuss's ABC"},
|
2009-12-29 23:18:24 +00:00
|
|
|
{"tortoise", "Aesop's Fables: The Tortoise and the Hare"},
|
2011-04-02 11:08:05 -04:00
|
|
|
{"arthur", "Arthur's Teacher Trouble"},
|
2009-12-29 23:18:24 +00:00
|
|
|
{"grandma", "Just Grandma and Me"},
|
|
|
|
{"ruff", "Ruff's Bone"},
|
|
|
|
{"newkid", "The New Kid on the Block"},
|
|
|
|
{"arthurrace", "Arthur's Reading Race"},
|
2010-07-09 22:10:22 +00:00
|
|
|
{"arthurbday", "Arthur's Birthday"},
|
|
|
|
{"lilmonster", "Little Monster at School"},
|
2011-01-26 18:40:28 +00:00
|
|
|
{"catinthehat", "The Cat in the Hat"},
|
2010-12-25 18:45:29 +00:00
|
|
|
{"rugrats", "Rugrats Adventure Game"},
|
2011-01-27 19:20:27 +00:00
|
|
|
{"lbsampler", "Living Books Sampler"},
|
2011-02-01 02:47:24 +00:00
|
|
|
{"bearfight", "The Berenstain Bears Get in a Fight"},
|
2011-04-24 12:10:07 +02:00
|
|
|
{"beardark", "The Berenstain Bears In The Dark"},
|
2011-02-01 02:54:51 +00:00
|
|
|
{"arthurcomp", "Arthur's Computer Adventure"},
|
2011-02-20 11:54:45 +01:00
|
|
|
{"harryhh","Harry and the Haunted House"},
|
2011-03-29 23:53:10 +02:00
|
|
|
{"stellaluna", "Stellaluna"},
|
|
|
|
{"sheila", "Sheila Rae, the Brave"},
|
2012-11-04 21:26:09 -05:00
|
|
|
{"rugratsps", "Rugrats Print Shop" },
|
2018-03-31 12:52:08 +02:00
|
|
|
{nullptr, nullptr}
|
2009-12-29 23:18:24 +00:00
|
|
|
};
|
|
|
|
|
2010-06-14 14:52:49 +00:00
|
|
|
#include "mohawk/detection_tables.h"
|
2009-12-29 23:18:24 +00:00
|
|
|
|
2010-06-15 10:59:43 +00:00
|
|
|
static const char *directoryGlobs[] = {
|
|
|
|
"all",
|
|
|
|
"assets1",
|
|
|
|
"data",
|
2010-12-25 18:45:29 +00:00
|
|
|
"program",
|
2011-01-31 23:10:18 +00:00
|
|
|
"95instal",
|
2010-12-25 18:45:29 +00:00
|
|
|
"Rugrats Adventure Game",
|
2018-03-31 12:52:08 +02:00
|
|
|
nullptr
|
2010-06-15 10:59:43 +00:00
|
|
|
};
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
class MohawkMetaEngine : public AdvancedMetaEngine {
|
|
|
|
public:
|
2020-03-22 15:19:56 +01:00
|
|
|
MohawkMetaEngine() : AdvancedMetaEngine(Mohawk::gameDescriptions, sizeof(Mohawk::MohawkGameDescription), mohawkGames) {
|
2011-06-11 17:52:32 +02:00
|
|
|
_maxScanDepth = 2;
|
|
|
|
_directoryGlobs = directoryGlobs;
|
2011-06-10 15:53:54 +02:00
|
|
|
}
|
2011-06-14 18:11:14 +02:00
|
|
|
|
2017-12-02 17:14:22 +01:00
|
|
|
ADDetectedGame fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const override {
|
2020-09-12 07:00:53 +02:00
|
|
|
return detectGameFilebased(allFiles, Mohawk::fileBased);
|
2011-06-14 18:11:14 +02:00
|
|
|
}
|
|
|
|
|
2020-01-31 13:57:55 +01:00
|
|
|
const char *getEngineId() const override {
|
2016-09-15 18:23:35 +02:00
|
|
|
return "mohawk";
|
|
|
|
}
|
|
|
|
|
2018-03-31 12:52:08 +02:00
|
|
|
const char *getName() const override {
|
2011-05-15 15:50:09 +01:00
|
|
|
return "Mohawk";
|
2009-12-29 23:18:24 +00:00
|
|
|
}
|
|
|
|
|
2018-03-31 12:52:08 +02:00
|
|
|
const char *getOriginalCopyright() const override {
|
2009-12-29 23:18:24 +00:00
|
|
|
return "Myst and Riven (C) Cyan Worlds\nMohawk OS (C) Ubisoft";
|
|
|
|
}
|
|
|
|
|
2020-06-05 19:43:03 +02:00
|
|
|
DetectedGame toDetectedGame(const ADDetectedGame &adGame) const override;
|
2020-03-24 19:13:10 +01:00
|
|
|
|
2018-03-31 12:52:08 +02:00
|
|
|
bool hasFeature(MetaEngineFeature f) const override;
|
|
|
|
bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;
|
|
|
|
SaveStateList listSaves(const char *target) const override;
|
2016-07-10 21:20:49 +02:00
|
|
|
SaveStateList listSavesForPrefix(const char *prefix, const char *extension) const;
|
2018-03-31 12:52:08 +02:00
|
|
|
int getMaximumSaveSlot() const override { return 999; }
|
|
|
|
void removeSaveState(const char *target, int slot) const override;
|
|
|
|
SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const override;
|
2020-01-28 18:44:08 +01:00
|
|
|
Common::KeymapArray initKeymaps(const char *target) const override;
|
2020-03-22 15:19:56 +01:00
|
|
|
void registerDefaultSettings(const Common::String &target) const override;
|
|
|
|
GUI::OptionsContainerWidget *buildEngineOptionsWidget(GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const override;
|
2009-12-29 23:18:24 +00:00
|
|
|
};
|
|
|
|
|
2020-06-05 19:43:03 +02:00
|
|
|
DetectedGame MohawkMetaEngine::toDetectedGame(const ADDetectedGame &adGame) const {
|
|
|
|
DetectedGame game = AdvancedMetaEngine::toDetectedGame(adGame);
|
2020-03-24 19:13:10 +01:00
|
|
|
|
|
|
|
// The AdvancedDetector model only allows specifying a single supported
|
|
|
|
// game language. The 25th anniversary edition Myst games are multilanguage.
|
|
|
|
// Here we amend the detected games to set the list of supported languages.
|
2020-03-27 19:45:25 +01:00
|
|
|
#ifdef ENABLE_MYST
|
2020-06-05 19:43:03 +02:00
|
|
|
if (game.gameId == "myst"
|
|
|
|
&& Common::checkGameGUIOption(GAMEOPTION_25TH, game.getGUIOptions())
|
|
|
|
&& Common::checkGameGUIOption(GAMEOPTION_ME, game.getGUIOptions())) {
|
|
|
|
const Mohawk::MystLanguage *languages = Mohawk::MohawkEngine_Myst::listLanguages();
|
|
|
|
while (languages->language != Common::UNK_LANG) {
|
|
|
|
game.appendGUIOptions(Common::getGameGUIOptionsDescriptionLanguage(languages->language));
|
|
|
|
languages++;
|
2020-03-27 19:45:25 +01:00
|
|
|
}
|
2020-06-05 19:43:03 +02:00
|
|
|
}
|
2020-03-27 19:45:25 +01:00
|
|
|
#endif
|
|
|
|
|
2020-03-24 19:13:10 +01:00
|
|
|
#ifdef ENABLE_RIVEN
|
2020-06-05 19:43:03 +02:00
|
|
|
if (game.gameId == "riven"
|
|
|
|
&& Common::checkGameGUIOption(GAMEOPTION_25TH, game.getGUIOptions())) {
|
|
|
|
const Mohawk::RivenLanguage *languages = Mohawk::MohawkEngine_Riven::listLanguages();
|
|
|
|
while (languages->language != Common::UNK_LANG) {
|
|
|
|
game.appendGUIOptions(Common::getGameGUIOptionsDescriptionLanguage(languages->language));
|
|
|
|
languages++;
|
2020-03-24 19:13:10 +01:00
|
|
|
}
|
|
|
|
}
|
2020-06-05 19:43:03 +02:00
|
|
|
#endif
|
2020-03-24 19:13:10 +01:00
|
|
|
|
2020-06-05 19:43:03 +02:00
|
|
|
return game;
|
2020-03-24 19:13:10 +01:00
|
|
|
}
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
bool MohawkMetaEngine::hasFeature(MetaEngineFeature f) const {
|
2010-01-25 01:39:44 +00:00
|
|
|
return
|
2009-12-29 23:18:24 +00:00
|
|
|
(f == kSupportsListSaves)
|
|
|
|
|| (f == kSupportsLoadingDuringStartup)
|
2016-02-22 08:31:02 +01:00
|
|
|
|| (f == kSupportsDeleteSave)
|
|
|
|
|| (f == kSavesSupportMetaInfo)
|
|
|
|
|| (f == kSavesSupportThumbnail)
|
|
|
|
|| (f == kSavesSupportCreationDate)
|
|
|
|
|| (f == kSavesSupportPlayTime);
|
2009-12-29 23:18:24 +00:00
|
|
|
}
|
|
|
|
|
2016-07-10 21:20:49 +02:00
|
|
|
SaveStateList MohawkMetaEngine::listSavesForPrefix(const char *prefix, const char *extension) const {
|
|
|
|
Common::String pattern = Common::String::format("%s-###.%s", prefix, extension);
|
|
|
|
Common::StringArray filenames = g_system->getSavefileManager()->listSavefiles(pattern);
|
|
|
|
size_t prefixLen = strlen(prefix);
|
|
|
|
|
|
|
|
SaveStateList saveList;
|
|
|
|
for (Common::StringArray::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) {
|
|
|
|
// Extract the slot number from the filename
|
|
|
|
char slot[4];
|
|
|
|
slot[0] = (*filename)[prefixLen + 1];
|
|
|
|
slot[1] = (*filename)[prefixLen + 2];
|
|
|
|
slot[2] = (*filename)[prefixLen + 3];
|
|
|
|
slot[3] = '\0';
|
|
|
|
|
|
|
|
int slotNum = atoi(slot);
|
|
|
|
|
|
|
|
saveList.push_back(SaveStateDescriptor(slotNum, ""));
|
|
|
|
}
|
|
|
|
|
|
|
|
Common::sort(saveList.begin(), saveList.end(), SaveStateDescriptorSlotComparator());
|
|
|
|
|
|
|
|
return saveList;
|
|
|
|
}
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
SaveStateList MohawkMetaEngine::listSaves(const char *target) const {
|
2016-09-15 14:34:48 +02:00
|
|
|
Common::String gameId = ConfMan.get("gameid", target);
|
2009-12-29 23:18:24 +00:00
|
|
|
SaveStateList saveList;
|
|
|
|
|
|
|
|
// Loading games is only supported in Myst/Riven currently.
|
2016-02-22 08:31:02 +01:00
|
|
|
#ifdef ENABLE_MYST
|
2016-09-15 14:34:48 +02:00
|
|
|
if (gameId == "myst") {
|
2016-07-10 21:20:49 +02:00
|
|
|
saveList = listSavesForPrefix("myst", "mys");
|
2016-04-03 07:48:50 +02:00
|
|
|
|
2016-07-10 21:20:49 +02:00
|
|
|
for (SaveStateList::iterator save = saveList.begin(); save != saveList.end(); ++save) {
|
2016-04-03 07:48:50 +02:00
|
|
|
// Read the description from the save
|
2016-07-10 21:20:49 +02:00
|
|
|
int slot = save->getSaveSlot();
|
|
|
|
Common::String description = Mohawk::MystGameState::querySaveDescription(slot);
|
|
|
|
save->setDescription(description);
|
2016-04-03 07:48:50 +02:00
|
|
|
}
|
2016-07-10 20:43:34 +02:00
|
|
|
}
|
2016-02-22 08:31:02 +01:00
|
|
|
#endif
|
2016-07-10 20:43:34 +02:00
|
|
|
#ifdef ENABLE_RIVEN
|
2016-09-15 14:34:48 +02:00
|
|
|
if (gameId == "riven") {
|
2016-07-10 21:20:49 +02:00
|
|
|
saveList = listSavesForPrefix("riven", "rvn");
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2016-07-10 21:20:49 +02:00
|
|
|
for (SaveStateList::iterator save = saveList.begin(); save != saveList.end(); ++save) {
|
|
|
|
// Read the description from the save
|
|
|
|
int slot = save->getSaveSlot();
|
|
|
|
Common::String description = Mohawk::RivenSaveLoad::querySaveDescription(slot);
|
|
|
|
save->setDescription(description);
|
2016-07-10 20:43:34 +02:00
|
|
|
}
|
2010-01-25 01:39:44 +00:00
|
|
|
}
|
2016-07-10 20:43:34 +02:00
|
|
|
#endif
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
return saveList;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MohawkMetaEngine::removeSaveState(const char *target, int slot) const {
|
2016-09-15 14:34:48 +02:00
|
|
|
Common::String gameId = ConfMan.get("gameid", target);
|
2016-04-03 07:48:50 +02:00
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
// Removing saved games is only supported in Myst/Riven currently.
|
2016-02-22 08:31:02 +01:00
|
|
|
#ifdef ENABLE_MYST
|
2016-09-15 14:34:48 +02:00
|
|
|
if (gameId == "myst") {
|
2016-04-03 07:48:50 +02:00
|
|
|
Mohawk::MystGameState::deleteSave(slot);
|
2016-07-10 21:20:49 +02:00
|
|
|
}
|
2016-02-22 08:31:02 +01:00
|
|
|
#endif
|
2016-07-10 21:20:49 +02:00
|
|
|
#ifdef ENABLE_RIVEN
|
2016-09-15 14:34:48 +02:00
|
|
|
if (gameId == "riven") {
|
2016-07-10 21:20:49 +02:00
|
|
|
Mohawk::RivenSaveLoad::deleteSave(slot);
|
2009-12-29 23:18:24 +00:00
|
|
|
}
|
2016-07-10 21:20:49 +02:00
|
|
|
#endif
|
2009-12-29 23:18:24 +00:00
|
|
|
}
|
|
|
|
|
2016-02-22 08:31:02 +01:00
|
|
|
SaveStateDescriptor MohawkMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
|
2016-09-15 14:34:48 +02:00
|
|
|
Common::String gameId = ConfMan.get("gameid", target);
|
|
|
|
|
2016-02-22 08:31:02 +01:00
|
|
|
#ifdef ENABLE_MYST
|
2016-09-15 14:34:48 +02:00
|
|
|
if (gameId == "myst") {
|
2016-04-03 07:48:50 +02:00
|
|
|
return Mohawk::MystGameState::querySaveMetaInfos(slot);
|
2016-07-10 20:43:34 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef ENABLE_RIVEN
|
2016-09-15 14:34:48 +02:00
|
|
|
if (gameId == "riven") {
|
2016-07-10 21:20:49 +02:00
|
|
|
return Mohawk::RivenSaveLoad::querySaveMetaInfos(slot);
|
2016-02-22 08:31:02 +01:00
|
|
|
} else
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
return SaveStateDescriptor();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-28 18:44:08 +01:00
|
|
|
Common::KeymapArray MohawkMetaEngine::initKeymaps(const char *target) const {
|
2020-01-23 10:50:52 +01:00
|
|
|
Common::String gameId = ConfMan.get("gameid", target);
|
|
|
|
|
2020-01-28 18:44:09 +01:00
|
|
|
#ifdef ENABLE_MYST
|
|
|
|
if (gameId == "myst" || gameId == "makingofmyst") {
|
|
|
|
return Mohawk::MohawkEngine_Myst::initKeymaps(target);
|
|
|
|
}
|
|
|
|
#endif
|
2020-01-27 01:26:35 +02:00
|
|
|
#ifdef ENABLE_RIVEN
|
2020-01-23 10:50:52 +01:00
|
|
|
if (gameId == "riven") {
|
2020-01-28 18:44:08 +01:00
|
|
|
return Mohawk::MohawkEngine_Riven::initKeymaps(target);
|
2020-01-23 10:50:52 +01:00
|
|
|
}
|
2020-01-27 01:26:35 +02:00
|
|
|
#endif
|
2020-01-23 10:50:52 +01:00
|
|
|
|
2020-01-28 18:44:08 +01:00
|
|
|
return AdvancedMetaEngine::initKeymaps(target);
|
2020-01-23 10:50:52 +01:00
|
|
|
}
|
|
|
|
|
2020-03-22 15:19:56 +01:00
|
|
|
void MohawkMetaEngine::registerDefaultSettings(const Common::String &target) const {
|
|
|
|
Common::String gameId = ConfMan.get("gameid", target);
|
|
|
|
|
|
|
|
#ifdef ENABLE_MYST
|
|
|
|
if (gameId == "myst" || gameId == "makingofmyst") {
|
|
|
|
return Mohawk::MohawkEngine_Myst::registerDefaultSettings();
|
|
|
|
}
|
|
|
|
#endif
|
2020-03-22 15:19:56 +01:00
|
|
|
#ifdef ENABLE_RIVEN
|
|
|
|
if (gameId == "riven") {
|
|
|
|
return Mohawk::MohawkEngine_Riven::registerDefaultSettings();
|
|
|
|
}
|
|
|
|
#endif
|
2020-03-22 15:19:56 +01:00
|
|
|
|
|
|
|
return AdvancedMetaEngine::registerDefaultSettings(target);
|
|
|
|
}
|
|
|
|
|
|
|
|
GUI::OptionsContainerWidget *MohawkMetaEngine::buildEngineOptionsWidget(GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const {
|
|
|
|
Common::String gameId = ConfMan.get("gameid", target);
|
|
|
|
|
|
|
|
#ifdef ENABLE_MYST
|
|
|
|
if (gameId == "myst" || gameId == "makingofmyst") {
|
|
|
|
return new Mohawk::MystOptionsWidget(boss, name, target);
|
|
|
|
}
|
|
|
|
#endif
|
2020-03-22 15:19:56 +01:00
|
|
|
#ifdef ENABLE_RIVEN
|
|
|
|
if (gameId == "riven") {
|
|
|
|
return new Mohawk::RivenOptionsWidget(boss, name, target);
|
|
|
|
}
|
|
|
|
#endif
|
2020-03-22 15:19:56 +01:00
|
|
|
|
|
|
|
return AdvancedMetaEngine::buildEngineOptionsWidget(boss, name, target);
|
|
|
|
}
|
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
bool MohawkMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
|
|
|
|
const Mohawk::MohawkGameDescription *gd = (const Mohawk::MohawkGameDescription *)desc;
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
if (gd) {
|
|
|
|
switch (gd->gameType) {
|
|
|
|
case Mohawk::GType_MYST:
|
|
|
|
case Mohawk::GType_MAKINGOF:
|
2011-03-28 15:20:30 -04:00
|
|
|
#ifdef ENABLE_MYST
|
2019-10-05 19:04:58 +02:00
|
|
|
#ifndef ENABLE_MYSTME
|
|
|
|
if (gd->features & Mohawk::GF_ME) {
|
|
|
|
warning("Myst ME support not compiled in");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
#endif
|
2009-12-29 23:18:24 +00:00
|
|
|
*engine = new Mohawk::MohawkEngine_Myst(syst, gd);
|
|
|
|
break;
|
2011-03-28 15:20:30 -04:00
|
|
|
#else
|
|
|
|
warning("Myst support not compiled in");
|
|
|
|
return false;
|
|
|
|
#endif
|
2009-12-29 23:18:24 +00:00
|
|
|
case Mohawk::GType_RIVEN:
|
2011-03-28 15:43:57 -04:00
|
|
|
#ifdef ENABLE_RIVEN
|
2009-12-29 23:18:24 +00:00
|
|
|
*engine = new Mohawk::MohawkEngine_Riven(syst, gd);
|
|
|
|
break;
|
2011-03-28 15:43:57 -04:00
|
|
|
#else
|
|
|
|
warning("Riven support not compiled in");
|
|
|
|
return false;
|
|
|
|
#endif
|
2010-01-22 03:43:57 +00:00
|
|
|
case Mohawk::GType_LIVINGBOOKSV1:
|
2010-11-29 12:51:53 +00:00
|
|
|
case Mohawk::GType_LIVINGBOOKSV2:
|
2010-01-22 03:43:57 +00:00
|
|
|
case Mohawk::GType_LIVINGBOOKSV3:
|
2011-01-31 23:10:18 +00:00
|
|
|
case Mohawk::GType_LIVINGBOOKSV4:
|
|
|
|
case Mohawk::GType_LIVINGBOOKSV5:
|
2009-12-29 23:18:24 +00:00
|
|
|
*engine = new Mohawk::MohawkEngine_LivingBooks(syst, gd);
|
|
|
|
break;
|
2011-01-03 22:53:12 +00:00
|
|
|
case Mohawk::GType_CSTIME:
|
2011-03-28 15:31:14 -04:00
|
|
|
#ifdef ENABLE_CSTIME
|
2011-01-20 21:35:00 +00:00
|
|
|
*engine = new Mohawk::MohawkEngine_CSTime(syst, gd);
|
|
|
|
break;
|
2011-03-28 15:31:14 -04:00
|
|
|
#else
|
|
|
|
warning("CSTime support not compiled in");
|
|
|
|
return false;
|
|
|
|
#endif
|
2009-12-29 23:18:24 +00:00
|
|
|
default:
|
2011-03-28 15:20:30 -04:00
|
|
|
error("Unknown Mohawk Engine");
|
2009-12-29 23:18:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-31 12:52:08 +02:00
|
|
|
return (gd != nullptr);
|
2009-12-29 23:18:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#if PLUGIN_ENABLED_DYNAMIC(MOHAWK)
|
|
|
|
REGISTER_PLUGIN_DYNAMIC(MOHAWK, PLUGIN_TYPE_ENGINE, MohawkMetaEngine);
|
|
|
|
#else
|
|
|
|
REGISTER_PLUGIN_STATIC(MOHAWK, PLUGIN_TYPE_ENGINE, MohawkMetaEngine);
|
|
|
|
#endif
|