GRIFFON: Move the engine options into the MetaEngine subclass

This commit is contained in:
Cameron Cawley 2022-11-03 20:41:39 +00:00 committed by Eugene Sandulenko
parent 2d6ac650b3
commit e8dee87a04
3 changed files with 56 additions and 27 deletions

View File

@ -23,34 +23,14 @@
#include "engines/advancedDetector.h"
#include "common/text-to-speech.h"
#include "common/translation.h"
#include "griffon/detection.h"
static const PlainGameDescriptor griffonGames[] = {
{"griffon", "The Griffon Legend"},
{nullptr, nullptr}
};
#ifdef USE_TTS
#define GAMEOPTION_TTS_NARRATOR GUIO_GAMEOPTIONS1
static const ADExtraGuiOptionsMap optionsList[] = {
{
GAMEOPTION_TTS_NARRATOR,
{
_s("Enable Text to Speech"),
_s("Use TTS to read the descriptions (if TTS is available)"),
"tts_enabled",
false,
0,
0
}
},
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
#endif
namespace Griffon {
static const ADGameDescription gameDescriptions[] = {
@ -75,11 +55,7 @@ static const ADGameDescription gameDescriptions[] = {
class GriffonMetaEngineDetection: public AdvancedMetaEngineDetection {
public:
GriffonMetaEngineDetection() : AdvancedMetaEngineDetection(Griffon::gameDescriptions, sizeof(ADGameDescription), griffonGames
#ifdef USE_TTS
, optionsList
#endif
) {
GriffonMetaEngineDetection() : AdvancedMetaEngineDetection(Griffon::gameDescriptions, sizeof(ADGameDescription), griffonGames) {
}
const char *getName() const override {

View File

@ -0,0 +1,27 @@
/* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef GRIFFON_DETECTION_H
#define GRIFFON_DETECTION_H
#define GAMEOPTION_TTS_NARRATOR GUIO_GAMEOPTIONS1
#endif

View File

@ -29,6 +29,26 @@
#include "backends/keymapper/standard-actions.h"
#include "griffon/griffon.h"
#include "griffon/detection.h"
#ifdef USE_TTS
static const ADExtraGuiOptionsMap optionsList[] = {
{
GAMEOPTION_TTS_NARRATOR,
{
_s("Enable Text to Speech"),
_s("Use TTS to read the descriptions (if TTS is available)"),
"tts_enabled",
false,
0,
0
}
},
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
#endif
class GriffonMetaEngine: public AdvancedMetaEngine {
public:
@ -36,6 +56,12 @@ public:
return "griffon";
}
#ifdef USE_TTS
const ADExtraGuiOptionsMap *getAdvancedExtraGuiOptions() const override {
return optionsList;
}
#endif
int getMaximumSaveSlot() const override {
return ConfMan.getInt("autosave_period") ? 4 : 3;
}