aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruruk2014-04-25 16:55:41 +0200
committeruruk2014-04-25 16:55:41 +0200
commit2141c99b59945401508628bd2701beb08aeb7cf5 (patch)
tree4697d98f1923d44463a64772bb9e871968de819c
parent1726f5731d882ad73a0c04ab19746245ee699d1d (diff)
downloadscummvm-rg350-2141c99b59945401508628bd2701beb08aeb7cf5.tar.gz
scummvm-rg350-2141c99b59945401508628bd2701beb08aeb7cf5.tar.bz2
scummvm-rg350-2141c99b59945401508628bd2701beb08aeb7cf5.zip
CGE2: Initial commit, implement detection.
-rw-r--r--engines/cge2/cge2.cpp60
-rw-r--r--engines/cge2/cge2.h47
-rw-r--r--engines/cge2/configure.engine3
-rw-r--r--engines/cge2/detection.cpp82
-rw-r--r--engines/cge2/module.mk13
5 files changed, 205 insertions, 0 deletions
diff --git a/engines/cge2/cge2.cpp b/engines/cge2/cge2.cpp
new file mode 100644
index 0000000000..488076f3f5
--- /dev/null
+++ b/engines/cge2/cge2.cpp
@@ -0,0 +1,60 @@
+/* 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.
+ *
+ */
+
+#include "cge2/cge2.h"
+
+namespace CGE2 {
+
+CGE2Engine::CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription)
+ : Engine(syst), _gameDescription(gameDescription) {
+}
+
+CGE2Engine::~CGE2Engine() {
+}
+
+bool CGE2Engine::hasFeature(EngineFeature f) const {
+ return false;
+}
+
+bool CGE2Engine::canLoadGameStateCurrently() {
+ return false;
+}
+bool CGE2Engine::canSaveGameStateCurrently() {
+ return false;
+}
+
+Common::Error CGE2Engine::loadGameState(int slot) {
+ warning("STUB: CGE2Engine::loadGameState()");
+ return Common::kNoError;
+}
+
+Common::Error CGE2Engine::saveGameState(int slot, const Common::String &desc) {
+ warning("STUB: CGE2Engine::saveGameState()");
+ return Common::kNoError;
+}
+
+Common::Error CGE2Engine::run() {
+ warning("STUB: CGE2Engine::run()");
+ return Common::kNoError;
+}
+
+} // End of namespace CGE2
diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h
new file mode 100644
index 0000000000..46aa4a3a21
--- /dev/null
+++ b/engines/cge2/cge2.h
@@ -0,0 +1,47 @@
+/* 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 CGE2_H
+#define CGE2_H
+
+#include "engines/engine.h"
+#include "engines/advancedDetector.h"
+
+namespace CGE2 {
+
+class CGE2Engine : public Engine {
+public:
+ CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription);
+ ~CGE2Engine();
+ virtual bool hasFeature(EngineFeature f) const;
+ virtual bool canLoadGameStateCurrently();
+ virtual bool canSaveGameStateCurrently();
+ virtual Common::Error loadGameState(int slot);
+ virtual Common::Error saveGameState(int slot, const Common::String &desc);
+ virtual Common::Error run();
+
+ const ADGameDescription *_gameDescription;
+};
+
+} // End of namespace CGE2
+
+#endif // CGE2_H
diff --git a/engines/cge2/configure.engine b/engines/cge2/configure.engine
new file mode 100644
index 0000000000..6ccbfee088
--- /dev/null
+++ b/engines/cge2/configure.engine
@@ -0,0 +1,3 @@
+# This file is included from the main "configure" script
+# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
+add_engine cge2 "CGE2" no
diff --git a/engines/cge2/detection.cpp b/engines/cge2/detection.cpp
new file mode 100644
index 0000000000..96ec1ed731
--- /dev/null
+++ b/engines/cge2/detection.cpp
@@ -0,0 +1,82 @@
+/* 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.
+*
+*/
+
+#include "cge2/cge2.h"
+#include "engines/advancedDetector.h"
+
+namespace CGE2 {
+
+static const PlainGameDescriptor CGE2Games[] = {
+ { "sfinx2", "Sfinx" }, // TODO: Remove Sfinx from CGE1 completely, so the two gameIDs won't collide.
+ { 0, 0 }
+};
+
+static const ADGameDescription gameDescriptions[] = { // TODO: Add ENG version too.
+ {
+ "sfinx", "Sfinx Freeware",
+ {
+ { "vol.cat", 0, "21197b287d397c53261b6616bf0dd880", 129024 },
+ { "vol.dat", 0, "de14291869a8eb7c2732ab783c7542ef", 34180844 },
+ AD_LISTEND
+ },
+ Common::PL_POL, Common::kPlatformDOS, ADGF_NO_FLAGS, GUIO0()
+ },
+
+ AD_TABLE_END_MARKER
+};
+
+class CGE2MetaEngine : public AdvancedMetaEngine {
+public:
+ CGE2MetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(ADGameDescription), CGE2Games) {
+ _singleid = "sfinx";
+ }
+
+ virtual const char *getName() const {
+ return "CGE2";
+ }
+
+ virtual const char *getOriginalCopyright() const {
+ return "Sfinx (c) 1997 L.K. Avalon";
+ }
+
+ virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
+ virtual bool hasFeature(MetaEngineFeature f) const;
+};
+
+bool CGE2MetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
+ if (desc) {
+ *engine = new CGE2::CGE2Engine(syst, desc);
+ }
+ return desc != 0;
+}
+
+bool CGE2MetaEngine::hasFeature(MetaEngineFeature f) const {
+ return false;
+}
+
+} // End of namespace CGE2
+
+#if PLUGIN_ENABLED_DYNAMIC(CGE2)
+ REGISTER_PLUGIN_DYNAMIC(CGE2, PLUGIN_TYPE_ENGINE, CGE2::CGE2MetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(CGE2, PLUGIN_TYPE_ENGINE, CGE2::CGE2MetaEngine);
+#endif
diff --git a/engines/cge2/module.mk b/engines/cge2/module.mk
new file mode 100644
index 0000000000..75f2743286
--- /dev/null
+++ b/engines/cge2/module.mk
@@ -0,0 +1,13 @@
+MODULE := engines/cge2
+
+MODULE_OBJS = \
+ cge2.o \
+ detection.o
+
+# This module can be built as a plugin
+ifeq ($(ENABLE_CGE2), DYNAMIC_PLUGIN)
+PLUGIN := 1
+endif
+
+# Include common rules
+include $(srcdir)/rules.mk