aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/zvision.cpp16
-rw-r--r--engines/zvision/zvision.h5
2 files changed, 15 insertions, 6 deletions
diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp
index 2009ccde44..33b2a80bd4 100644
--- a/engines/zvision/zvision.cpp
+++ b/engines/zvision/zvision.cpp
@@ -60,19 +60,23 @@ ZVision::ZVision(OSystem *syst, const ZVisionGameDescription *gameDesc) : Engine
//DebugMan.addDebugChannel(kZVisionDebugExample, "example", "this is just an example for a engine specific debug channel");
//DebugMan.addDebugChannel(kZVisionDebugExample2, "example2", "also an example");
- // Don't forget to register your random source
+ // Register random source
_rnd = new Common::RandomSource("zvision");
+ // Create managers
+ _scriptManager = new ScriptManager();
+
debug("ZVision::ZVision");
}
ZVision::~ZVision() {
debug("ZVision::~ZVision");
- // Dispose your resources here
+ // Dispose of resources
+ delete _scriptManager;
delete _rnd;
- // Remove all of our debug levels here
+ // Remove all of our debug levels
DebugMan.clearAllDebugChannels();
}
@@ -93,7 +97,7 @@ void ZVision::initialize() {
Graphics::PixelFormat format = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); // RGB555
initGraphics(640, 480, true, &format);
- _scriptManager.initialize();
+ _scriptManager->initialize();
// Create debugger console. It requires GFX to be initialized
_console = new Console(this);
@@ -134,4 +138,8 @@ Common::Error ZVision::run() {
return Common::kNoError;
}
+ScriptManager *ZVision::getScriptManager() const {
+ return _scriptManager;
+}
+
} // End of namespace ZVision
diff --git a/engines/zvision/zvision.h b/engines/zvision/zvision.h
index b57ce20e25..b0cd1aec5a 100644
--- a/engines/zvision/zvision.h
+++ b/engines/zvision/zvision.h
@@ -58,7 +58,7 @@ private:
// We need random numbers
Common::RandomSource *_rnd;
- ScriptManager _scriptManager;
+ ScriptManager *_scriptManager;
// To prevent allocation every time we process events
Common::Event _event;
@@ -69,7 +69,8 @@ public:
uint32 getFeatures() const;
Common::Language getLanguage() const;
virtual Common::Error run();
-
+ ScriptManager *getScriptManager() const;
+
private:
void initialize();