aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2010-08-25 11:51:06 +0000
committerEugene Sandulenko2010-08-25 11:51:06 +0000
commit78278db7ed5d6ab992d4344c385bd1ae072c447a (patch)
tree432fc0c6121f34f8524680c89879c60055a07eb5 /engines
parent1d7566f371c804c894417b74b14e4bab43a1038e (diff)
downloadscummvm-rg350-78278db7ed5d6ab992d4344c385bd1ae072c447a.tar.gz
scummvm-rg350-78278db7ed5d6ab992d4344c385bd1ae072c447a.tar.bz2
scummvm-rg350-78278db7ed5d6ab992d4344c385bd1ae072c447a.zip
AD: Implement AGDF_PIRATED flag.
svn-id: r52384
Diffstat (limited to 'engines')
-rw-r--r--engines/advancedDetector.cpp27
-rw-r--r--engines/advancedDetector.h1
2 files changed, 28 insertions, 0 deletions
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index 20d0132bb9..70d08d1035 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -214,10 +214,34 @@ static void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *
desc.appendGUIOptions(getGameGUIOptionsDescriptionLanguage(Common::EN_ANY));
}
+bool cleanupPirated(ADGameDescList &matched) {
+ // OKay, now let's sense presense of pirated games
+ if (!matched.empty()) {
+ for (uint j = 0; j < matched.size();) {
+ if (matched[j]->flags & ADGF_PIRATED)
+ matched.remove_at(j);
+ }
+
+ // We ruled out all variants and now have nothing
+ if (matched.empty()) {
+
+ warning("Illegitimate copy of the game detected. We give no support in such cases %d", matched.size());
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const {
ADGameDescList matches = detectGame(fslist, params, Common::UNK_LANG, Common::kPlatformUnknown, "");
GameList detectedGames;
+ if (cleanupPirated(matches))
+ return detectedGames;
+
// Use fallback detector if there were no matches by other means
if (matches.empty()) {
const ADGameDescription *fallbackDesc = fallbackDetect(fslist);
@@ -282,6 +306,9 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
ADGameDescList matches = detectGame(files, params, language, platform, extra);
+ if (cleanupPirated(matches))
+ return Common::kNoGameDataFoundError;
+
if (params.singleid == NULL) {
for (uint i = 0; i < matches.size(); i++) {
if (matches[i]->gameid == gameid) {
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index 0072bdafb2..0ebb264f74 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -45,6 +45,7 @@ struct ADGameFileDescription {
enum ADGameFlags {
ADGF_NO_FLAGS = 0,
+ ADGF_PIRATED = (1 << 23), // flag to designate well known pirated versions with cracks
ADGF_ADDENGLISH = (1 << 24), // always add English as language option
ADGF_MACRESFORK = (1 << 25), // the md5 for this entry will be calculated from the resource fork
ADGF_USEEXTRAASTITLE = (1 << 26), // Extra field value will be used as main game title, not gameid