CHEWY: Move the engine options into the MetaEngine subclass

This commit is contained in:
Cameron Cawley 2022-11-03 19:27:59 +00:00 committed by Eugene Sandulenko
parent 66b2483fd5
commit d8c06f9869
4 changed files with 24 additions and 19 deletions

1
engines/chewy/POTFILES Normal file
View File

@ -0,0 +1 @@
engines/chewy/metaengine.cpp

View File

@ -24,8 +24,6 @@
#include "chewy/detection.h"
#include "common/translation.h"
static const PlainGameDescriptor chewyGames[] = {
{"chewy", "Chewy: Esc from F5"},
{nullptr, nullptr}
@ -33,8 +31,6 @@ static const PlainGameDescriptor chewyGames[] = {
namespace Chewy {
#define GAMEOPTION_ORIGINAL_SAVELOAD GUIO_GAMEOPTIONS1
static const ChewyGameDescription gameDescriptions[] = {
{
@ -106,25 +102,11 @@ static const ChewyGameDescription gameDescriptions[] = {
{ AD_TABLE_END_MARKER }
};
static const ADExtraGuiOptionsMap optionsList[] = {
{
GAMEOPTION_ORIGINAL_SAVELOAD,
{
_s("Use original save/load screens"),
_s("Use the original save/load screens instead of the ScummVM ones"),
"original_menus",
false,
0,
0
}
},
AD_EXTRA_GUI_OPTIONS_TERMINATOR};
} // namespace Chewy
class ChewyMetaEngineDetection : public AdvancedMetaEngineDetection {
public:
ChewyMetaEngineDetection() : AdvancedMetaEngineDetection(Chewy::gameDescriptions, sizeof(Chewy::ChewyGameDescription), chewyGames, Chewy::optionsList) {
ChewyMetaEngineDetection() : AdvancedMetaEngineDetection(Chewy::gameDescriptions, sizeof(Chewy::ChewyGameDescription), chewyGames) {
_maxScanDepth = 2;
_flags = kADFlagMatchFullPaths;
}

View File

@ -28,6 +28,8 @@ struct ChewyGameDescription {
ADGameDescription desc;
};
#define GAMEOPTION_ORIGINAL_SAVELOAD GUIO_GAMEOPTIONS1
} // End of namespace Chewy
#endif

View File

@ -21,6 +21,7 @@
#include "common/savefile.h"
#include "common/system.h"
#include "common/translation.h"
#include "base/plugins.h"
#include "engines/advancedDetector.h"
#include "chewy/chewy.h"
@ -28,6 +29,21 @@
namespace Chewy {
static const ADExtraGuiOptionsMap optionsList[] = {
{
GAMEOPTION_ORIGINAL_SAVELOAD,
{
_s("Use original save/load screens"),
_s("Use the original save/load screens instead of the ScummVM ones"),
"original_menus",
false,
0,
0
}
},
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
uint32 ChewyEngine::getFeatures() const {
return _gameDescription->desc.flags;
}
@ -44,6 +60,10 @@ public:
return "chewy";
}
const ADExtraGuiOptionsMap *getAdvancedExtraGuiOptions() const override {
return Chewy::optionsList;
}
bool hasFeature(MetaEngineFeature f) const override;
Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;