HDB: Move the engine options into the MetaEngine subclass

This commit is contained in:
Cameron Cawley 2022-11-03 20:51:29 +00:00 committed by Eugene Sandulenko
parent ea9722bcea
commit 8c46a377ec
4 changed files with 23 additions and 21 deletions

View File

@ -1,2 +1 @@
engines/hdb/detection.cpp
engines/hdb/metaengine.cpp

View File

@ -20,7 +20,6 @@
*/
#include "base/plugins.h"
#include "common/translation.h"
#include "engines/advancedDetector.h"
#include "hdb/detection.h"
@ -30,8 +29,6 @@ static const PlainGameDescriptor hdbGames[] = {
{nullptr, nullptr}
};
#define GAMEOPTION_CHEATMODE GUIO_GAMEOPTIONS1
namespace HDB {
static const ADGameDescription gameDescriptions[] = {
@ -116,25 +113,9 @@ static const ADGameDescription gameDescriptions[] = {
} // End of namespace HDB
static const ADExtraGuiOptionsMap optionsList[] = {
{
GAMEOPTION_CHEATMODE,
{
_s("Enable cheat mode"),
_s("Debug info and level selection becomes available"),
"hypercheat",
false,
0,
0
}
},
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
class HDBMetaEngineDetection : public AdvancedMetaEngineDetection {
public:
HDBMetaEngineDetection() : AdvancedMetaEngineDetection(HDB::gameDescriptions, sizeof(ADGameDescription), hdbGames, optionsList) {
HDBMetaEngineDetection() : AdvancedMetaEngineDetection(HDB::gameDescriptions, sizeof(ADGameDescription), hdbGames) {
}
const char *getName() const override {

View File

@ -28,6 +28,8 @@ enum HDBGameFeatures {
GF_HANDANGO = (1 << 0)
};
#define GAMEOPTION_CHEATMODE GUIO_GAMEOPTIONS1
} // End of namespace HDB
#endif // HDB_DETECTION_H

View File

@ -37,6 +37,22 @@
namespace HDB {
static const ADExtraGuiOptionsMap optionsList[] = {
{
GAMEOPTION_CHEATMODE,
{
_s("Enable cheat mode"),
_s("Debug info and level selection becomes available"),
"hypercheat",
false,
0,
0
}
},
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
const char *HDBGame::getGameId() const { return _gameDescription->gameId; }
Common::Platform HDBGame::getPlatform() const { return _gameDescription->platform; }
@ -68,6 +84,10 @@ public:
return "hdb";
}
const ADExtraGuiOptionsMap *getAdvancedExtraGuiOptions() const override {
return HDB::optionsList;
}
bool hasFeature(MetaEngineFeature f) const override;
int getMaximumSaveSlot() const override;