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.
|
|
|
|
*
|
2021-12-26 18:47:58 +01:00
|
|
|
* 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 3 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
|
2021-12-26 18:47:58 +01:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2009-12-29 23:18:24 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "base/plugins.h"
|
|
|
|
|
|
|
|
#include "engines/advancedDetector.h"
|
2016-09-15 14:34:48 +02:00
|
|
|
#include "common/config-manager.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-08-25 13:52:43 +05:30
|
|
|
#include "mohawk/detection.h"
|
2019-10-05 19:04:58 +02:00
|
|
|
|
2020-08-25 17:45:31 +05:30
|
|
|
#include "mohawk/riven_metaengine.h"
|
|
|
|
#include "mohawk/myst_metaengine.h"
|
2011-03-28 15:20:30 -04:00
|
|
|
|
2009-12-29 23:18:24 +00:00
|
|
|
|
|
|
|
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"},
|
2021-04-21 15:08:50 +02:00
|
|
|
{"seussps", "Dr Seuss's Preschool"},
|
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"},
|
2021-05-23 21:17:23 +02:00
|
|
|
{"create", "The Story of Creation"},
|
|
|
|
{"daniel", "Daniel in the Lions' Den"},
|
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
|
|
|
};
|
|
|
|
|
2020-08-25 13:52:43 +05:30
|
|
|
#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
|
|
|
};
|
|
|
|
|
2020-10-11 23:14:39 +02:00
|
|
|
class MohawkMetaEngineDetection : public AdvancedMetaEngineDetection {
|
2009-12-29 23:18:24 +00:00
|
|
|
public:
|
2020-10-11 23:14:39 +02:00
|
|
|
MohawkMetaEngineDetection() : AdvancedMetaEngineDetection(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
|
|
|
|
2021-06-10 20:33:00 +08:00
|
|
|
ADDetectedGame fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist, ADDetectedGameExtraInfo **extra) const override {
|
2020-09-12 07:00:53 +02:00
|
|
|
return detectGameFilebased(allFiles, Mohawk::fileBased);
|
2011-06-14 18:11:14 +02:00
|
|
|
}
|
|
|
|
|
2022-01-13 20:34:25 +00:00
|
|
|
const char *getName() const override {
|
2016-09-15 18:23:35 +02:00
|
|
|
return "mohawk";
|
|
|
|
}
|
|
|
|
|
2022-01-13 20:34:25 +00:00
|
|
|
const char *getEngineName() 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";
|
|
|
|
}
|
|
|
|
|
2021-06-10 21:35:32 +08:00
|
|
|
DetectedGame toDetectedGame(const ADDetectedGame &adGame, ADDetectedGameExtraInfo *extraInfo) const override;
|
2009-12-29 23:18:24 +00:00
|
|
|
};
|
|
|
|
|
2021-06-10 21:35:32 +08:00
|
|
|
DetectedGame MohawkMetaEngineDetection::toDetectedGame(const ADDetectedGame &adGame, ADDetectedGameExtraInfo *extraInfo) const {
|
2020-10-11 23:14:39 +02:00
|
|
|
DetectedGame game = AdvancedMetaEngineDetection::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-06-05 19:43:03 +02:00
|
|
|
if (game.gameId == "myst"
|
|
|
|
&& Common::checkGameGUIOption(GAMEOPTION_25TH, game.getGUIOptions())
|
|
|
|
&& Common::checkGameGUIOption(GAMEOPTION_ME, game.getGUIOptions())) {
|
2020-08-08 00:06:42 +05:30
|
|
|
const Mohawk::MystLanguage *languages = Mohawk::MohawkMetaEngine_Myst::listLanguages();
|
2020-06-05 19:43:03 +02:00
|
|
|
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
|
|
|
|
2020-06-05 19:43:03 +02:00
|
|
|
if (game.gameId == "riven"
|
|
|
|
&& Common::checkGameGUIOption(GAMEOPTION_25TH, game.getGUIOptions())) {
|
2020-08-08 00:06:42 +05:30
|
|
|
const Mohawk::RivenLanguage *languages = Mohawk::MohawkMetaEngine_Riven::listLanguages();
|
2020-06-05 19:43:03 +02:00
|
|
|
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
|
|
|
return game;
|
2020-03-24 19:13:10 +01:00
|
|
|
}
|
|
|
|
|
2020-10-11 23:14:39 +02:00
|
|
|
REGISTER_PLUGIN_STATIC(MOHAWK_DETECTION, PLUGIN_TYPE_ENGINE_DETECTION, MohawkMetaEngineDetection);
|