aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/glk/detection.cpp48
-rw-r--r--engines/glk/detection.h74
2 files changed, 75 insertions, 47 deletions
diff --git a/engines/glk/detection.cpp b/engines/glk/detection.cpp
index 7a49989c89..93bffeb852 100644
--- a/engines/glk/detection.cpp
+++ b/engines/glk/detection.cpp
@@ -21,6 +21,7 @@
*/
#include "glk/glk.h"
+#include "glk/detection.h"
#include "glk/alan2/detection.h"
#include "glk/alan2/alan2.h"
#include "glk/frotz/detection.h"
@@ -39,58 +40,11 @@
#include "common/savefile.h"
#include "common/str-array.h"
#include "common/system.h"
-#include "engines/advancedDetector.h"
#include "graphics/colormasks.h"
#include "graphics/surface.h"
#include "common/config-manager.h"
#include "common/file.h"
-#define MAX_SAVES 99
-
-class GlkMetaEngine : public MetaEngine {
-private:
- Common::String findFileByGameId(const Common::String &gameId) const;
-public:
- GlkMetaEngine() : MetaEngine() {}
-
- virtual const char *getName() const {
- return "ScummGlk";
- }
-
- virtual const char *getOriginalCopyright() const {
- return "Infocom games (C) Infocom\nScott Adams games (C) Scott Adams";
- }
-
- virtual bool hasFeature(MetaEngineFeature f) const override;
- virtual Common::Error createInstance(OSystem *syst, Engine **engine) const override;
- virtual SaveStateList listSaves(const char *target) const;
- virtual int getMaximumSaveSlot() const;
- virtual void removeSaveState(const char *target, int slot) const;
- SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
-
- /**
- * Returns a list of games supported by this engine.
- */
- virtual PlainGameList getSupportedGames() const override;
-
- /**
- * Runs the engine's game detector on the given list of files, and returns a
- * (possibly empty) list of games supported by the engine which it was able
- * to detect amongst the given files.
- */
- virtual DetectedGames detectGames(const Common::FSList &fslist) const override;
-
- /**
- * Query the engine for a PlainGameDescriptor for the specified gameid, if any.
- */
- virtual PlainGameDescriptor findGame(const char *gameId) const override;
-
- /**
- * Calls each sub-engine in turn to ensure no game Id accidentally shares the same Id
- */
- void detectClashes() const;
-};
-
bool GlkMetaEngine::hasFeature(MetaEngineFeature f) const {
return
(f == kSupportsListSaves) ||
diff --git a/engines/glk/detection.h b/engines/glk/detection.h
new file mode 100644
index 0000000000..e54f744aa3
--- /dev/null
+++ b/engines/glk/detection.h
@@ -0,0 +1,74 @@
+/* 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 GLK_DETECTION_H
+#define GLK_DETECTION_H
+
+#include "engines/advancedDetector.h"
+
+#define MAX_SAVES 99
+
+class GlkMetaEngine : public MetaEngine {
+private:
+ Common::String findFileByGameId(const Common::String &gameId) const;
+public:
+ GlkMetaEngine() : MetaEngine() {}
+
+ virtual const char *getName() const {
+ return "ScummGlk";
+ }
+
+ virtual const char *getOriginalCopyright() const {
+ return "Infocom games (C) Infocom\nScott Adams games (C) Scott Adams";
+ }
+
+ virtual bool hasFeature(MetaEngineFeature f) const override;
+ virtual Common::Error createInstance(OSystem *syst, Engine **engine) const override;
+ virtual SaveStateList listSaves(const char *target) const;
+ virtual int getMaximumSaveSlot() const;
+ virtual void removeSaveState(const char *target, int slot) const;
+ SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
+
+ /**
+ * Returns a list of games supported by this engine.
+ */
+ virtual PlainGameList getSupportedGames() const override;
+
+ /**
+ * Runs the engine's game detector on the given list of files, and returns a
+ * (possibly empty) list of games supported by the engine which it was able
+ * to detect amongst the given files.
+ */
+ virtual DetectedGames detectGames(const Common::FSList &fslist) const override;
+
+ /**
+ * Query the engine for a PlainGameDescriptor for the specified gameid, if any.
+ */
+ virtual PlainGameDescriptor findGame(const char *gameId) const override;
+
+ /**
+ * Calls each sub-engine in turn to ensure no game Id accidentally shares the same Id
+ */
+ void detectClashes() const;
+};
+
+#endif