MTROPOLIS: Move the engine options into the MetaEngine subclass

This commit is contained in:
Cameron Cawley 2022-11-03 21:24:49 +00:00 committed by Eugene Sandulenko
parent 1f0a0ebe87
commit 425bcfeb0c
5 changed files with 83 additions and 84 deletions

View File

@ -1,3 +1,3 @@
engines/mtropolis/detection.cpp
engines/mtropolis/metaengine.cpp
engines/mtropolis/mtropolis.cpp
engines/mtropolis/saveload.cpp

View File

@ -23,7 +23,6 @@
#include "engines/advancedDetector.h"
#include "common/config-manager.h"
#include "common/translation.h"
#include "mtropolis/detection.h"
@ -36,80 +35,6 @@ static const PlainGameDescriptor mTropolisGames[] = {
#include "mtropolis/detection_tables.h"
namespace MTropolis {
static const ADExtraGuiOptionsMap optionsList[] = {
{
GAMEOPTION_WIDESCREEN_MOD,
{
_s("16:9 widescreen mod"),
_s("Removes letterboxing and moves some display elements, improving coverage on widescreen displays"),
"mtropolis_mod_obsidian_widescreen",
false,
0,
0
}
},
{
GAMEOPTION_DYNAMIC_MIDI,
{
_s("Improved music mixing"),
_s("Enables dynamic MIDI mixer, improving quality, but behaving less like mTropolis Player."),
"mtropolis_mod_dynamic_midi",
true,
0,
0
}
},
{
GAMEOPTION_AUTO_SAVE_AT_CHECKPOINTS,
{
_s("Autosave at progress points"),
_s("Automatically saves the game after completing puzzles and chapters."),
"mtropolis_mod_auto_save_at_checkpoints",
true,
0,
0
}
},
{
GAMEOPTION_ENABLE_SHORT_TRANSITIONS,
{
_s("Enable short transitions"),
_s("Enables transitions that are set to maximum rate instead of skipping them."),
"mtropolis_mod_minimum_transition_duration",
true,
0,
0
}
},
{
GAMEOPTION_SOUND_EFFECT_SUBTITLES,
{
_s("Enable subtitles for important sound effects"),
_s("Enables subtitles for important sound effects. This may reduce the difficulty of sound recognition puzzles and minigames."),
"mtropolis_mod_sound_gameplay_subtitles",
false,
0,
0
}
},
{
GAMEOPTION_LAUNCH_DEBUG,
{
_s("Start with debugger"),
_s("Starts with the debugger dashboard active."),
"mtropolis_debug_at_start",
false,
0,
0
}
},
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
} // End of namespace MTropolis
static const char *directoryGlobs[] = {
"Obsidian",
"RESOURCE",
@ -121,7 +46,7 @@ static const char *directoryGlobs[] = {
class MTropolisMetaEngineDetection : public AdvancedMetaEngineDetection {
public:
MTropolisMetaEngineDetection() : AdvancedMetaEngineDetection(MTropolis::gameDescriptions, sizeof(MTropolis::MTropolisGameDescription), mTropolisGames, MTropolis::optionsList) {
MTropolisMetaEngineDetection() : AdvancedMetaEngineDetection(MTropolis::gameDescriptions, sizeof(MTropolis::MTropolisGameDescription), mTropolisGames) {
_guiOptions = GUIO3(GAMEOPTION_DYNAMIC_MIDI, GAMEOPTION_LAUNCH_DEBUG, GAMEOPTION_ENABLE_SHORT_TRANSITIONS);
_maxScanDepth = 3;
_directoryGlobs = directoryGlobs;

View File

@ -67,6 +67,13 @@ struct MTropolisGameDescription {
MTropolisGameBootID bootID;
};
#define GAMEOPTION_WIDESCREEN_MOD GUIO_GAMEOPTIONS1
#define GAMEOPTION_DYNAMIC_MIDI GUIO_GAMEOPTIONS2
#define GAMEOPTION_LAUNCH_DEBUG GUIO_GAMEOPTIONS3
#define GAMEOPTION_SOUND_EFFECT_SUBTITLES GUIO_GAMEOPTIONS4
#define GAMEOPTION_AUTO_SAVE_AT_CHECKPOINTS GUIO_GAMEOPTIONS5
#define GAMEOPTION_ENABLE_SHORT_TRANSITIONS GUIO_GAMEOPTIONS6
} // End of namespace MTropolis
#endif // MTROPOLIS_DETECTION_H

View File

@ -26,13 +26,6 @@
#include "mtropolis/detection.h"
#define GAMEOPTION_WIDESCREEN_MOD GUIO_GAMEOPTIONS1
#define GAMEOPTION_DYNAMIC_MIDI GUIO_GAMEOPTIONS2
#define GAMEOPTION_LAUNCH_DEBUG GUIO_GAMEOPTIONS3
#define GAMEOPTION_SOUND_EFFECT_SUBTITLES GUIO_GAMEOPTIONS4
#define GAMEOPTION_AUTO_SAVE_AT_CHECKPOINTS GUIO_GAMEOPTIONS5
#define GAMEOPTION_ENABLE_SHORT_TRANSITIONS GUIO_GAMEOPTIONS6
namespace MTropolis {
static const MTropolisGameDescription gameDescriptions[] = {

View File

@ -45,6 +45,76 @@ struct Surface;
namespace MTropolis {
static const ADExtraGuiOptionsMap optionsList[] = {
{
GAMEOPTION_WIDESCREEN_MOD,
{
_s("16:9 widescreen mod"),
_s("Removes letterboxing and moves some display elements, improving coverage on widescreen displays"),
"mtropolis_mod_obsidian_widescreen",
false,
0,
0
}
},
{
GAMEOPTION_DYNAMIC_MIDI,
{
_s("Improved music mixing"),
_s("Enables dynamic MIDI mixer, improving quality, but behaving less like mTropolis Player."),
"mtropolis_mod_dynamic_midi",
true,
0,
0
}
},
{
GAMEOPTION_AUTO_SAVE_AT_CHECKPOINTS,
{
_s("Autosave at progress points"),
_s("Automatically saves the game after completing puzzles and chapters."),
"mtropolis_mod_auto_save_at_checkpoints",
true,
0,
0
}
},
{
GAMEOPTION_ENABLE_SHORT_TRANSITIONS,
{
_s("Enable short transitions"),
_s("Enables transitions that are set to maximum rate instead of skipping them."),
"mtropolis_mod_minimum_transition_duration",
true,
0,
0
}
},
{
GAMEOPTION_SOUND_EFFECT_SUBTITLES,
{
_s("Enable subtitles for important sound effects"),
_s("Enables subtitles for important sound effects. This may reduce the difficulty of sound recognition puzzles and minigames."),
"mtropolis_mod_sound_gameplay_subtitles",
false,
0,
0
}
},
{
GAMEOPTION_LAUNCH_DEBUG,
{
_s("Start with debugger"),
_s("Starts with the debugger dashboard active."),
"mtropolis_debug_at_start",
false,
0,
0
}
},
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
uint32 MTropolisEngine::getGameID() const {
return _gameDescription->gameID;
}
@ -61,6 +131,10 @@ public:
return "mtropolis";
}
const ADExtraGuiOptionsMap *getAdvancedExtraGuiOptions() const override {
return MTropolis::optionsList;
}
bool hasFeature(MetaEngineFeature f) const override;
Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;