From 82ab3056fa52f78309ae3271114dbec28ceb9684 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 29 Feb 2012 16:48:25 +0100 Subject: ENGINES: Implement per-game options caching in AdvancedDetector via GUIO flags. --- engines/advancedDetector.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'engines/advancedDetector.h') diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 0cec039b5e..45a9f183e8 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -133,6 +133,24 @@ enum ADFlags { }; +/** + * Map entry for mapping GUIO_GAMEOPTIONS* to their ExtraGuiOption + * description. + */ +struct ADExtraGuiOptionsMap { + /** + * GUIO_GAMEOPTION* string. + */ + const char *guioFlag; + + /** + * The associated option. + */ + ExtraGuiOption option; +}; + +#define AD_EXTRA_GUI_OPTIONS_TERMINATOR { 0, { 0, 0, 0, 0 } } + /** * A MetaEngine implementation based around the advanced detector code. */ @@ -158,6 +176,11 @@ protected: */ const PlainGameDescriptor *_gameids; + /** + * A map containing all the extra game GUI options the engine supports. + */ + const ADExtraGuiOptionsMap * const _extraGuiOptions; + /** * The number of bytes to compute MD5 sum for. The AdvancedDetector * is primarily based on computing and matching MD5 checksums of files. @@ -211,7 +234,7 @@ protected: const char * const *_directoryGlobs; public: - AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameids); + AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameids, const ADExtraGuiOptionsMap *extraGuiOptions = 0); /** * Returns list of targets supported by the engine. @@ -225,6 +248,8 @@ public: virtual Common::Error createInstance(OSystem *syst, Engine **engine) const; + virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const; + protected: // To be implemented by subclasses virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const = 0; -- cgit v1.2.3