[Scummvm-git-logs] scummvm quux -> af541ed6de4a02a41f377b1640a84d9c2c2732de

sev- sev at scummvm.org
Fri Apr 16 23:56:26 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
af541ed6de QUUX: Added current version from the Wiki


Commit: af541ed6de4a02a41f377b1640a84d9c2c2732de
    https://github.com/scummvm/scummvm/commit/af541ed6de4a02a41f377b1640a84d9c2c2732de
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-04-17T01:56:10+02:00

Commit Message:
QUUX: Added current version from the Wiki

Changed paths:
  A engines/quux/configure.engine
  A engines/quux/detection.cpp
  A engines/quux/metaengine.cpp
  A engines/quux/module.mk
  A engines/quux/quux.cpp
  A engines/quux/quux.h


diff --git a/engines/quux/configure.engine b/engines/quux/configure.engine
new file mode 100644
index 0000000000..b367c30178
--- /dev/null
+++ b/engines/quux/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 quux "Quux" no
diff --git a/engines/quux/detection.cpp b/engines/quux/detection.cpp
new file mode 100644
index 0000000000..42ff1596e2
--- /dev/null
+++ b/engines/quux/detection.cpp
@@ -0,0 +1,66 @@
+/* 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 "base/plugins.h"
+#include "engines/advancedDetector.h"
+
+namespace Quux {
+static const PlainGameDescriptor quuxGames[] = {
+	{ "quux", "Quux the Example Module" },
+	{ "quuxcd", "Quux the Example Module (CD version)" },
+	{ 0, 0 }
+};
+
+
+static const ADGameDescription gameDescriptions[] = {
+	{
+		"quux",
+		0,
+		AD_ENTRY1s("quux.txt", 0, 0),
+		Common::EN_ANY,
+		Common::kPlatformDOS,
+		ADGF_NO_FLAGS,
+		GUIO1(GUIO_NOMIDI)
+	},
+	AD_TABLE_END_MARKER
+};
+} // End of namespace Quux
+
+class QuuxMetaEngineDetection : public AdvancedMetaEngineDetection {
+public:
+	QuuxMetaEngineDetection() : AdvancedMetaEngineDetection(Quux::gameDescriptions, sizeof(ADGameDescription), Quux::quuxGames) {
+	}
+
+	const char *getEngineId() const override {
+		return "quux";
+	}
+
+	const char *getName() const override {
+		return "Quux";
+	}
+
+	const char *getOriginalCopyright() const override {
+		return "Copyright (C) Quux Entertainment Ltd.";
+	}
+};
+
+REGISTER_PLUGIN_STATIC(QUUX_DETECTION, PLUGIN_TYPE_ENGINE_DETECTION, QuuxMetaEngineDetection);
diff --git a/engines/quux/metaengine.cpp b/engines/quux/metaengine.cpp
new file mode 100644
index 0000000000..0aa0109599
--- /dev/null
+++ b/engines/quux/metaengine.cpp
@@ -0,0 +1,44 @@
+/* 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 "quux/quux.h"
+#include "engines/advancedDetector.h"
+
+class QuuxMetaEngine : public AdvancedMetaEngine {
+public:
+	const char *getName() const override {
+		return "quux";
+	}
+
+	Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;
+};
+
+Common::Error QuuxMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
+	*engine = new Quux::QuuxEngine(syst);
+	return Common::kNoError;
+}
+
+#if PLUGIN_ENABLED_DYNAMIC(QUUX)
+REGISTER_PLUGIN_DYNAMIC(QUUX, PLUGIN_TYPE_ENGINE, QuuxMetaEngine);
+#else
+REGISTER_PLUGIN_STATIC(QUUX, PLUGIN_TYPE_ENGINE, QuuxMetaEngine);
+#endif
diff --git a/engines/quux/module.mk b/engines/quux/module.mk
new file mode 100644
index 0000000000..d5e28f96d5
--- /dev/null
+++ b/engines/quux/module.mk
@@ -0,0 +1,19 @@
+MODULE := engines/quux
+
+MODULE_OBJS := \
+	metaengine.o \
+	quux.o
+
+MODULE_DIRS += \
+	engines/quux
+
+# This module can be built as a plugin
+ifeq ($(ENABLE_QUUX), DYNAMIC_PLUGIN)
+PLUGIN := 1
+endif
+
+# Include common rules
+include $(srcdir)/rules.mk
+
+# Detection objects
+DETECT_OBJS += $(MODULE)/detection.o
diff --git a/engines/quux/quux.cpp b/engines/quux/quux.cpp
new file mode 100644
index 0000000000..6803c46b2f
--- /dev/null
+++ b/engines/quux/quux.cpp
@@ -0,0 +1,143 @@
+/* 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 "common/scummsys.h"
+
+#include "common/config-manager.h"
+#include "common/debug.h"
+#include "common/debug-channels.h"
+#include "common/error.h"
+#include "common/events.h"
+#include "common/file.h"
+#include "common/fs.h"
+#include "common/system.h"
+
+#include "engines/util.h"
+
+#include "quux/quux.h"
+
+namespace Quux {
+
+QuuxEngine::QuuxEngine(OSystem *syst)
+	: Engine(syst) {
+	// Put your engine in a sane state, but do nothing big yet;
+	// in particular, do not load data from files; rather, if you
+	// need to do such things, do them from run().
+
+	// Do not initialize graphics here
+	// Do not initialize audio devices here
+
+	// However this is the place to specify all default directories
+	const Common::FSNode gameDataDir(ConfMan.get("path"));
+	SearchMan.addSubDirectoryMatching(gameDataDir, "sound");
+
+	// Here is the right place to set up the engine specific debug channels
+	DebugMan.addDebugChannel(kQuuxDebugExample, "example", "this is just an example for a engine specific debug channel");
+	DebugMan.addDebugChannel(kQuuxDebugExample2, "example2", "also an example");
+
+	// Don't forget to register your random source
+	_rnd = new Common::RandomSource("quux");
+
+	debug("QuuxEngine::QuuxEngine");
+}
+
+QuuxEngine::~QuuxEngine() {
+	debug("QuuxEngine::~QuuxEngine");
+
+	// Dispose your resources here
+	delete _rnd;
+
+	// Remove all of our debug levels here
+	DebugMan.clearAllDebugChannels();
+}
+
+Common::Error QuuxEngine::run() {
+	// Initialize graphics using following:
+	initGraphics(320, 200);
+
+	// You could use backend transactions directly as an alternative,
+	// but it isn't recommended, until you want to handle the error values
+	// from OSystem::endGFXTransaction yourself.
+	// This is just an example template:
+	//_system->beginGFXTransaction();
+	//	// This setup the graphics mode according to users seetings
+	//	initCommonGFX(false);
+	//
+	//	// Specify dimensions of game graphics window.
+	//	// In this example: 320x200
+	//	_system->initSize(320, 200);
+	//FIXME: You really want to handle
+	//OSystem::kTransactionSizeChangeFailed here
+	//_system->endGFXTransaction();
+
+	// Create debugger console. It requires GFX to be initialized
+	Console *console = new Console(this);
+	setDebugger(console);
+
+	// Additional setup.
+	debug("QuuxEngine::init");
+
+	// Your main even loop should be (invoked from) here.
+	debug("QuuxEngine::go: Hello, World!");
+
+	// This test will show up if -d1 and --debugflags=example are specified on the commandline
+	debugC(1, kQuuxDebugExample, "Example debug call");
+
+	// This test will show up if --debugflags=example or --debugflags=example2 or both of them and -d3 are specified on the commandline
+	debugC(3, kQuuxDebugExample | kQuuxDebugExample2, "Example debug call two");
+
+	// Simple main event loop
+	Common::Event evt;
+	while (!shouldQuit()) {
+		g_system->getEventManager()->pollEvent(evt);
+		g_system->delayMillis(10);
+	}
+
+	return Common::kNoError;
+}
+
+bool QuuxEngine::hasFeature(EngineFeature f) const {
+	return
+		(f == kSupportsReturnToLauncher) ||
+		(f == kSupportsLoadingDuringRuntime) ||
+		(f == kSupportsSavingDuringRuntime);
+}
+
+Common::Error QuuxEngine::loadGameStream(Common::SeekableReadStream *stream) {
+	Common::Serializer s(stream, nullptr);
+	syncGameStream(s);
+	return Common::kNoError;
+}
+
+Common::Error QuuxEngine::saveGameStream(Common::WriteStream *stream, bool isAutosave) {
+	Common::Serializer s(nullptr, stream);
+	syncGameStream(s);
+	return Common::kNoError;
+}
+
+void QuuxEngine::syncGameStream(Common::Serializer &s) {
+	// Use methods of Serializer to save/load fields
+	int dummy = 0;
+	s.syncAsUint16LE(dummy);
+}
+
+} // End of namespace Quux
diff --git a/engines/quux/quux.h b/engines/quux/quux.h
new file mode 100644
index 0000000000..b4eb7ddc55
--- /dev/null
+++ b/engines/quux/quux.h
@@ -0,0 +1,71 @@
+/* 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 QUUX_H
+#define QUUX_H
+
+#include "common/random.h"
+#include "common/serializer.h"
+#include "engines/engine.h"
+#include "gui/debugger.h"
+
+namespace Quux {
+
+class Console;
+
+// our engine debug channels
+enum {
+	kQuuxDebugExample = 1 << 0,
+	kQuuxDebugExample2 = 1 << 1
+	// next new channel must be 1 << 2 (4)
+	// the current limitation is 32 debug channels (1 << 31 is the last one)
+};
+
+class QuuxEngine : public Engine {
+private:
+	// We need random numbers
+	Common::RandomSource *_rnd;
+public:
+	QuuxEngine(OSystem *syst);
+	~QuuxEngine();
+
+	Common::Error run() override;
+	bool hasFeature(EngineFeature f) const override;
+	bool canLoadGameStateCurrently() override { return true; }
+	bool canSaveGameStateCurrently() override { return true; }
+	Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
+	Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
+	void syncGameStream(Common::Serializer &s);
+};
+
+// Example console class
+class Console : public GUI::Debugger {
+public:
+	Console(QuuxEngine *vm) {
+	}
+	virtual ~Console(void) {
+	}
+};
+
+} // End of namespace Quux
+
+#endif




More information about the Scummvm-git-logs mailing list