MADS: Move the engine options into the MetaEngine subclass

This commit is contained in:
Cameron Cawley 2022-11-03 21:14:16 +00:00 committed by Eugene Sandulenko
parent f3cb449566
commit 1f0a0ebe87
4 changed files with 95 additions and 91 deletions

View File

@ -1,2 +1,2 @@
engines/mads/detection.cpp
engines/mads/metaengine.cpp
engines/mads/nebular/dialogs_nebular.cpp

View File

@ -24,7 +24,6 @@
#include "common/str-array.h"
#include "engines/advancedDetector.h"
#include "common/system.h"
#include "common/translation.h"
#include "mads/detection.h"
#include "mads/mads.h"
@ -43,99 +42,11 @@ static const DebugChannelDef debugFlagList[] = {
DEBUG_CHANNEL_END
};
#define GAMEOPTION_EASY_MOUSE GUIO_GAMEOPTIONS1
#define GAMEOPTION_ANIMATED_INVENTORY GUIO_GAMEOPTIONS2
#define GAMEOPTION_ANIMATED_INTERFACE GUIO_GAMEOPTIONS3
#define GAMEOPTION_NAUGHTY_MODE GUIO_GAMEOPTIONS4
//#define GAMEOPTION_GRAPHICS_DITHERING GUIO_GAMEOPTIONS5
#ifdef USE_TTS
#define GAMEOPTION_TTS_NARRATOR GUIO_GAMEOPTIONS5
#endif
#include "mads/detection_tables.h"
static const ADExtraGuiOptionsMap optionsList[] = {
{
GAMEOPTION_EASY_MOUSE,
{
_s("Easy mouse interface"),
_s("Shows object names when hovering the mouse over them"),
"EasyMouse",
true,
0,
0
}
},
{
GAMEOPTION_ANIMATED_INVENTORY,
{
_s("Animated inventory items"),
_s("Animated inventory items"),
"InvObjectsAnimated",
true,
0,
0
}
},
{
GAMEOPTION_ANIMATED_INTERFACE,
{
_s("Animated game interface"),
_s("Animated game interface"),
"TextWindowAnimated",
true,
0,
0
}
},
{
GAMEOPTION_NAUGHTY_MODE,
{
_s("Naughty game mode"),
_s("Naughty game mode"),
"NaughtyMode",
true,
0,
0
}
},
/*{
GAMEOPTION_GRAPHICS_DITHERING,
{
_s("Graphics dithering"),
_s("Graphics dithering"),
"GraphicsDithering",
true,
0,
0
}
},*/
#ifdef USE_TTS
{
GAMEOPTION_TTS_NARRATOR,
{
_s("TTS Narrator"),
_s("Use TTS to read the descriptions (if TTS is available)"),
"tts_narrator",
false,
0,
0
}
},
#endif
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
class MADSMetaEngineDetection : public AdvancedMetaEngineDetection {
public:
MADSMetaEngineDetection() : AdvancedMetaEngineDetection(MADS::gameDescriptions, sizeof(MADS::MADSGameDescription), MADSGames, optionsList) {
MADSMetaEngineDetection() : AdvancedMetaEngineDetection(MADS::gameDescriptions, sizeof(MADS::MADSGameDescription), MADSGames) {
_maxScanDepth = 3;
}

View File

@ -44,6 +44,16 @@ struct MADSGameDescription {
uint32 features;
};
#define GAMEOPTION_EASY_MOUSE GUIO_GAMEOPTIONS1
#define GAMEOPTION_ANIMATED_INVENTORY GUIO_GAMEOPTIONS2
#define GAMEOPTION_ANIMATED_INTERFACE GUIO_GAMEOPTIONS3
#define GAMEOPTION_NAUGHTY_MODE GUIO_GAMEOPTIONS4
//#define GAMEOPTION_GRAPHICS_DITHERING GUIO_GAMEOPTIONS5
#ifdef USE_TTS
#define GAMEOPTION_TTS_NARRATOR GUIO_GAMEOPTIONS5
#endif
} // End of namespace MADS
#endif // MADS_DETECTION_H

View File

@ -29,6 +29,7 @@
#include "common/str-array.h"
#include "common/memstream.h"
#include "common/system.h"
#include "common/translation.h"
#include "graphics/surface.h"
#include "mads/events.h"
@ -39,6 +40,84 @@
namespace MADS {
static const ADExtraGuiOptionsMap optionsList[] = {
{
GAMEOPTION_EASY_MOUSE,
{
_s("Easy mouse interface"),
_s("Shows object names when hovering the mouse over them"),
"EasyMouse",
true,
0,
0
}
},
{
GAMEOPTION_ANIMATED_INVENTORY,
{
_s("Animated inventory items"),
_s("Animated inventory items"),
"InvObjectsAnimated",
true,
0,
0
}
},
{
GAMEOPTION_ANIMATED_INTERFACE,
{
_s("Animated game interface"),
_s("Animated game interface"),
"TextWindowAnimated",
true,
0,
0
}
},
{
GAMEOPTION_NAUGHTY_MODE,
{
_s("Naughty game mode"),
_s("Naughty game mode"),
"NaughtyMode",
true,
0,
0
}
},
/*{
GAMEOPTION_GRAPHICS_DITHERING,
{
_s("Graphics dithering"),
_s("Graphics dithering"),
"GraphicsDithering",
true,
0,
0
}
},*/
#ifdef USE_TTS
{
GAMEOPTION_TTS_NARRATOR,
{
_s("TTS Narrator"),
_s("Use TTS to read the descriptions (if TTS is available)"),
"tts_narrator",
false,
0,
0
}
},
#endif
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
uint32 MADSEngine::getGameID() const {
return _gameDescription->gameID;
}
@ -67,6 +146,10 @@ public:
return "mads";
}
const ADExtraGuiOptionsMap *getAdvancedExtraGuiOptions() const override {
return MADS::optionsList;
}
bool hasFeature(MetaEngineFeature f) const override;
Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;