aboutsummaryrefslogtreecommitdiff
path: root/engines/obsolete.h
diff options
context:
space:
mode:
authorMax Horn2011-06-14 15:25:33 +0200
committerMax Horn2011-06-14 18:52:07 +0200
commit593b929047434eefa9b6dfb73730f7d502c4ff10 (patch)
tree84fcfdd28ec336bf00f2969ff545e5a686ebd98d /engines/obsolete.h
parent6412d091268d299f7f4d31382b0e4e9e4e352ad9 (diff)
downloadscummvm-rg350-593b929047434eefa9b6dfb73730f7d502c4ff10.tar.gz
scummvm-rg350-593b929047434eefa9b6dfb73730f7d502c4ff10.tar.bz2
scummvm-rg350-593b929047434eefa9b6dfb73730f7d502c4ff10.zip
DETECTOR: Separate code for handling obsolete gameids from advanced detector
This includes a renaming of ADObsoleteGameID to Engine::ObsoleteGameID, and AdvancedDetector::findGameID now is Engines::findGameID. Doxygen comments were added or improved
Diffstat (limited to 'engines/obsolete.h')
-rw-r--r--engines/obsolete.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/engines/obsolete.h b/engines/obsolete.h
new file mode 100644
index 0000000000..97bc7524a6
--- /dev/null
+++ b/engines/obsolete.h
@@ -0,0 +1,78 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef ENGINES_OBSOLETE_H
+#define ENGINES_OBSOLETE_H
+
+#include "engines/game.h"
+
+namespace Engines {
+
+/**
+ * Structure for autoupgrading targets using an obsolete gameid
+ * to the correct new gameid.
+ */
+struct ObsoleteGameID {
+
+ /** Name of the obsolete gameid. */
+ const char *from;
+
+ /** Name of the corresponding new gameid. */
+ const char *to;
+
+ /**
+ * If platform is set to a value different from Common::kPlatformUnknown,
+ * then upgradeTargetIfNecessary() will use this value to set the platform
+ * attribute of any target it updates using this ObsoleteGameID record.
+ * This is useful when the old gameid encoded the target platform (e.g.
+ * "zakTowns" for FM-TOWNS) while the new gameid does not (e.g. "zak").
+ */
+ Common::Platform platform;
+};
+
+/**
+ * Check if the currently active game target has an obsolete gameid;
+ * if so, replace it by the correct new gameid.
+ * This function is typically invoked by a MetaEngine::createInstance
+ * implementation.
+ */
+void upgradeTargetIfNecessary(const ObsoleteGameID *obsoleteList);
+
+
+/**
+ * Scan through the given list of plain game descriptors specified and search
+ * for 'gameid' in there. If a match is found, returns a GameDescriptor
+ * with gameid and description set.
+ *
+ * Optionally can take a list of obsolete game ids into account in order
+ * to support obsolete gameids.
+ */
+GameDescriptor findGameID(
+ const char *gameid,
+ const PlainGameDescriptor *gameids,
+ const ObsoleteGameID *obsoleteList = 0
+ );
+
+
+} // End of namespace Engines
+
+#endif