[Scummvm-cvs-logs] SF.net SVN: scummvm:[52384] scummvm/trunk/engines
sev at users.sourceforge.net
sev at users.sourceforge.net
Wed Aug 25 13:51:06 CEST 2010
Revision: 52384
http://scummvm.svn.sourceforge.net/scummvm/?rev=52384&view=rev
Author: sev
Date: 2010-08-25 11:51:06 +0000 (Wed, 25 Aug 2010)
Log Message:
-----------
AD: Implement AGDF_PIRATED flag.
Modified Paths:
--------------
scummvm/trunk/engines/advancedDetector.cpp
scummvm/trunk/engines/advancedDetector.h
Modified: scummvm/trunk/engines/advancedDetector.cpp
===================================================================
--- scummvm/trunk/engines/advancedDetector.cpp 2010-08-25 11:50:23 UTC (rev 52383)
+++ scummvm/trunk/engines/advancedDetector.cpp 2010-08-25 11:51:06 UTC (rev 52384)
@@ -214,10 +214,34 @@
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 @@
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) {
Modified: scummvm/trunk/engines/advancedDetector.h
===================================================================
--- scummvm/trunk/engines/advancedDetector.h 2010-08-25 11:50:23 UTC (rev 52383)
+++ scummvm/trunk/engines/advancedDetector.h 2010-08-25 11:51:06 UTC (rev 52384)
@@ -45,6 +45,7 @@
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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list