aboutsummaryrefslogtreecommitdiff
path: root/engines/engine.h
diff options
context:
space:
mode:
authorTorbjörn Andersson2014-12-30 10:47:51 +0100
committerTorbjörn Andersson2014-12-30 10:47:51 +0100
commitcc916625d9025ffaa898854c4de19da5dc2e2925 (patch)
tree8986dbcee3db5b8850680f42e9b2117c13822e25 /engines/engine.h
parentf74ba29753de23bad9a07f531fc4c03ea3375594 (diff)
downloadscummvm-rg350-cc916625d9025ffaa898854c4de19da5dc2e2925.tar.gz
scummvm-rg350-cc916625d9025ffaa898854c4de19da5dc2e2925.tar.bz2
scummvm-rg350-cc916625d9025ffaa898854c4de19da5dc2e2925.zip
SCUMM: Add a "chained games manager"
This replaces the somewhat ugly use of the config manager to store the chained games.
Diffstat (limited to 'engines/engine.h')
-rw-r--r--engines/engine.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/engines/engine.h b/engines/engine.h
index e325cc1ba2..d3415d584c 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -27,6 +27,8 @@
#include "common/str.h"
#include "common/language.h"
#include "common/platform.h"
+#include "common/queue.h"
+#include "common/singleton.h"
class OSystem;
@@ -334,6 +336,32 @@ protected:
};
+// Chained games
+
+/**
+ * Singleton class which manages chained games. A chained game is one that
+ * starts automatically, optionally loading a saved game, instead of returning
+ * to the launcher.
+ */
+class ChainedGamesManager : public Common::Singleton<ChainedGamesManager> {
+private:
+ struct Game {
+ Common::String target;
+ int slot;
+ };
+
+ Common::Queue<Game> _chainedGames;
+
+public:
+ ChainedGamesManager();
+ void clear();
+ void push(const Common::String target, const int slot = -1);
+ bool pop(Common::String &target, int &slot);
+};
+
+/** Convenience shortcut for accessing the chained games manager. */
+#define ChainedGamesMan ChainedGamesManager::instance()
+
// FIXME: HACK for MidiEmu & error()
extern Engine *g_engine;