diff options
author | D G Turner | 2012-10-12 17:03:32 +0100 |
---|---|---|
committer | D G Turner | 2012-10-12 17:03:32 +0100 |
commit | 151b7beb47ec4b964862d6779bd48e3a33482bbd (patch) | |
tree | 867717c5266d0908d95edd82560599be20a4ede9 /engines/advancedDetector.h | |
parent | 80af0e239473f85c49cc2da3c848dfcde41d4a37 (diff) | |
parent | 2b55837650c4229dc3d75b660cecfc7a3292e5e0 (diff) | |
download | scummvm-rg350-151b7beb47ec4b964862d6779bd48e3a33482bbd.tar.gz scummvm-rg350-151b7beb47ec4b964862d6779bd48e3a33482bbd.tar.bz2 scummvm-rg350-151b7beb47ec4b964862d6779bd48e3a33482bbd.zip |
Merge branch 'master' into teenagentRefactor
Conflicts:
engines/teenagent/callbacks.cpp
Diffstat (limited to 'engines/advancedDetector.h')
-rw-r--r-- | engines/advancedDetector.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 45a9f183e8..3eec33abe5 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -26,6 +26,8 @@ #include "engines/metaengine.h" #include "engines/engine.h" +#include "common/hash-str.h" + #include "common/gui_options.h" // FIXME: Temporary hack? namespace Common { @@ -46,6 +48,20 @@ struct ADGameFileDescription { }; /** + * A record describing the properties of a file. Used on the existing + * files while detecting a game. + */ +struct ADFileProperties { + int32 size; + Common::String md5; +}; + +/** + * A map of all relevant existing files in a game directory while detecting. + */ +typedef Common::HashMap<Common::String, ADFileProperties, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> ADFilePropertiesMap; + +/** * A shortcut to produce an empty ADGameFileDescription record. Used to mark * the end of a list of these. */ @@ -178,7 +194,7 @@ protected: /** * A map containing all the extra game GUI options the engine supports. - */ + */ const ADExtraGuiOptionsMap * const _extraGuiOptions; /** @@ -196,7 +212,7 @@ protected: * * Used to override gameid. * This is a recommended setting to prevent global gameid pollution. - * With this option set, the gameid effectively turns into engineid. + * With this option set, the gameid effectively turns into engineid. * * FIXME: This field actually removes a feature (gameid) in order to * address a more generic problem. We should find a better way to @@ -286,9 +302,17 @@ protected: * In case of a tie, the entry coming first in the list is chosen. * * @param allFiles a map describing all present files + * @param fslist a list of nodes for all present files * @param fileBasedFallback a list of ADFileBasedFallback records, zero-terminated + * @param filesProps if not 0, return a map of properties for all detected files here + */ + const ADGameDescription *detectGameFilebased(const FileMap &allFiles, const Common::FSList &fslist, const ADFileBasedFallback *fileBasedFallback, ADFilePropertiesMap *filesProps = 0) const; + + /** + * Log and print a report that we found an unknown game variant, together with the file + * names, sizes and MD5 sums. */ - const ADGameDescription *detectGameFilebased(const FileMap &allFiles, const ADFileBasedFallback *fileBasedFallback) const; + void reportUnknown(const Common::FSNode &path, const ADFilePropertiesMap &filesProps) const; // TODO void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) const; @@ -298,6 +322,9 @@ protected: * Includes nifty stuff like removing trailing dots and ignoring case. */ void composeFileHashMap(FileMap &allFiles, const Common::FSList &fslist, int depth) const; + + /** Get the properties (size and MD5) of this file. */ + bool getFileProperties(const Common::FSNode &parent, const FileMap &allFiles, const ADGameDescription &game, const Common::String fname, ADFileProperties &fileProps) const; }; #endif |