2020-10-10 01:30:49 -07: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.
|
|
|
|
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "engines/advancedDetector.h"
|
|
|
|
#include "base/plugins.h"
|
|
|
|
|
2021-05-14 15:20:42 +03:00
|
|
|
#include "backends/keymapper/action.h"
|
|
|
|
#include "backends/keymapper/keymap.h"
|
|
|
|
|
|
|
|
#include "common/translation.h"
|
2020-10-10 01:30:49 -07:00
|
|
|
|
2021-05-14 15:20:42 +03:00
|
|
|
#include "asylum/asylum.h"
|
|
|
|
#include "asylum/shared.h"
|
2020-10-10 01:30:49 -07:00
|
|
|
|
|
|
|
class AsylumMetaEngine : public AdvancedMetaEngine {
|
|
|
|
public:
|
2021-05-19 22:46:45 +01:00
|
|
|
const char *getName() const override {
|
2021-02-19 15:27:13 +00:00
|
|
|
return "asylum";
|
2020-10-10 01:30:49 -07:00
|
|
|
}
|
|
|
|
|
2021-05-19 22:46:45 +01:00
|
|
|
const char *getOriginalCopyright() const {
|
2020-10-10 01:30:49 -07:00
|
|
|
return "Sanitarium (c) ASC Games";
|
|
|
|
}
|
|
|
|
|
2021-06-07 00:26:09 +02:00
|
|
|
bool hasFeature(MetaEngineFeature f) const override;
|
2021-02-12 12:07:09 +03:00
|
|
|
Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const override;
|
2021-05-14 15:20:42 +03:00
|
|
|
Common::KeymapArray initKeymaps(const char *target) const override;
|
2020-10-10 01:30:49 -07:00
|
|
|
};
|
|
|
|
|
2021-05-19 22:46:45 +01:00
|
|
|
bool AsylumMetaEngine::hasFeature(MetaEngineFeature f) const {
|
|
|
|
return false;
|
2020-10-10 01:30:49 -07:00
|
|
|
}
|
|
|
|
|
2021-02-12 12:07:09 +03:00
|
|
|
Common::Error AsylumMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
|
2020-10-10 01:30:49 -07:00
|
|
|
if (desc) {
|
|
|
|
*engine = new Asylum::AsylumEngine(syst, desc);
|
|
|
|
}
|
2021-02-12 12:07:09 +03:00
|
|
|
return desc ? Common::kNoError : Common::kUnsupportedGameidError;
|
2020-10-10 01:30:49 -07:00
|
|
|
}
|
|
|
|
|
2021-05-14 15:20:42 +03:00
|
|
|
Common::KeymapArray AsylumMetaEngine::initKeymaps(const char *target) const {
|
|
|
|
using namespace Common;
|
|
|
|
using namespace Asylum;
|
|
|
|
|
|
|
|
Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "asylum", "Sanitarium");
|
|
|
|
|
|
|
|
Action *act;
|
|
|
|
|
|
|
|
act = new Action("VERSION", _("Show version"));
|
|
|
|
act->setCustomEngineActionEvent(kAsylumActionShowVersion);
|
|
|
|
act->addDefaultInputMapping("v");
|
|
|
|
engineKeyMap->addAction(act);
|
|
|
|
|
|
|
|
act = new Action("LOAD", _("Quick load"));
|
|
|
|
act->setCustomEngineActionEvent(kAsylumActionQuickLoad);
|
|
|
|
act->addDefaultInputMapping("S+l");
|
|
|
|
engineKeyMap->addAction(act);
|
|
|
|
|
|
|
|
act = new Action("SAVE", _("Quick save"));
|
|
|
|
act->setCustomEngineActionEvent(kAsylumActionQuickSave);
|
|
|
|
act->addDefaultInputMapping("S+s");
|
|
|
|
engineKeyMap->addAction(act);
|
|
|
|
|
|
|
|
act = new Action("SARAH", _("Switch to Sarah"));
|
|
|
|
act->setCustomEngineActionEvent(kAsylumActionSwitchToSarah);
|
|
|
|
act->addDefaultInputMapping("s");
|
|
|
|
engineKeyMap->addAction(act);
|
|
|
|
|
|
|
|
act = new Action("GRIMWALL", _("Switch to Grimwall"));
|
|
|
|
act->setCustomEngineActionEvent(kAsylumActionSwitchToGrimwall);
|
|
|
|
act->addDefaultInputMapping("g");
|
|
|
|
engineKeyMap->addAction(act);
|
|
|
|
|
|
|
|
act = new Action("OLMEC", _("Switch to Olmec"));
|
|
|
|
act->setCustomEngineActionEvent(kAsylumActionSwitchToOlmec);
|
|
|
|
act->addDefaultInputMapping("o");
|
|
|
|
engineKeyMap->addAction(act);
|
|
|
|
|
|
|
|
return Keymap::arrayOf(engineKeyMap);
|
|
|
|
}
|
|
|
|
|
2020-10-10 01:30:49 -07:00
|
|
|
#if PLUGIN_ENABLED_DYNAMIC(ASYLUM)
|
|
|
|
REGISTER_PLUGIN_DYNAMIC(ASYLUM, PLUGIN_TYPE_ENGINE, AsylumMetaEngine);
|
|
|
|
#else
|
|
|
|
REGISTER_PLUGIN_STATIC(ASYLUM, PLUGIN_TYPE_ENGINE, AsylumMetaEngine);
|
|
|
|
#endif
|