aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/gargoyle/gargoyle.cpp3
-rw-r--r--engines/gargoyle/gargoyle.h3
-rw-r--r--engines/gargoyle/glk.h5
-rw-r--r--engines/gargoyle/interpreter.h16
-rw-r--r--engines/gargoyle/scott/scott.h9
5 files changed, 22 insertions, 14 deletions
diff --git a/engines/gargoyle/gargoyle.cpp b/engines/gargoyle/gargoyle.cpp
index e55e4c57fb..731e38d4a7 100644
--- a/engines/gargoyle/gargoyle.cpp
+++ b/engines/gargoyle/gargoyle.cpp
@@ -32,8 +32,7 @@
namespace Gargoyle {
GargoyleEngine::GargoyleEngine(OSystem *syst, const GargoyleGameDescription *gameDesc) :
- _gameDescription(gameDesc), Engine(syst), _glk(&_screen),
- _scott(_glk) {
+ _gameDescription(gameDesc), Engine(syst), _interpreter(nullptr) {
}
GargoyleEngine::~GargoyleEngine() {
diff --git a/engines/gargoyle/gargoyle.h b/engines/gargoyle/gargoyle.h
index 5e014b5b83..c43b5fe6c5 100644
--- a/engines/gargoyle/gargoyle.h
+++ b/engines/gargoyle/gargoyle.h
@@ -66,8 +66,7 @@ private:
int _loadSaveSlot;
Graphics::Screen _screen;
Events _events;
- Glk _glk;
- Scott::Scott _scott;
+ Interpreter *_interpreter;
// Engine APIs
virtual Common::Error run();
diff --git a/engines/gargoyle/glk.h b/engines/gargoyle/glk.h
index 86c2353bbd..4aade7a0e7 100644
--- a/engines/gargoyle/glk.h
+++ b/engines/gargoyle/glk.h
@@ -24,20 +24,21 @@
#define GARGOYLE_GLK_H
#include "graphics/managed_surface.h"
+#include "gargoyle/interpreter.h"
namespace Gargoyle {
/**
* Implements the GLK interface
*/
-class Glk {
+class Glk : public Interpreter {
private:
Graphics::ManagedSurface *_surface;
public:
/**
* Constructor
*/
- Glk(Graphics::ManagedSurface *surface) : _surface(surface) {}
+ Glk() {}
};
} // End of namespace Gargoyle
diff --git a/engines/gargoyle/interpreter.h b/engines/gargoyle/interpreter.h
index 002b46ce2e..df9172d9e1 100644
--- a/engines/gargoyle/interpreter.h
+++ b/engines/gargoyle/interpreter.h
@@ -23,21 +23,27 @@
#ifndef GARGOYLE_INTERPRETER_H
#define GARGOYLE_INTERPRETER_H
-#include "gargoyle/glk.h"
-
namespace Gargoyle {
/**
* Base class for specific interpreters
*/
class Interpreter {
-protected:
- Glk &_glk;
public:
/**
* Constructor
*/
- Interpreter(Glk &glk) : _glk(glk) {}
+ Interpreter() {}
+
+ /**
+ * Destructor
+ */
+ virtual ~Interpreter() {}
+
+ /**
+ * Main execution method
+ */
+ virtual void execute() = 0;
};
} // End of namespace Gargoyle
diff --git a/engines/gargoyle/scott/scott.h b/engines/gargoyle/scott/scott.h
index a5d734f40d..bf13cf8c53 100644
--- a/engines/gargoyle/scott/scott.h
+++ b/engines/gargoyle/scott/scott.h
@@ -28,7 +28,7 @@
*/
#include "common/scummsys.h"
-#include "gargoyle/interpreter.h"
+#include "gargoyle/glk.h"
namespace Gargoyle {
namespace Scott {
@@ -84,12 +84,15 @@ struct Tail {
int Unknown;
};
-class Scott : public Interpreter {
+/**
+ * Scott Adams game interpreter
+ */
+class Scott : public Glk {
public:
/**
* Constructor
*/
- Scott(Glk &glk) : Interpreter(glk) {}
+ Scott() : Glk() {}
};
} // End of namespace Scott