aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mohawk/myst.cpp')
-rw-r--r--engines/mohawk/myst.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index b4ec087b61..1a237db916 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -30,6 +30,9 @@
#include "mohawk/cursors.h"
#include "mohawk/graphics.h"
#include "mohawk/myst.h"
+#include "mohawk/myst_scripts.h"
+#include "mohawk/myst_scripts_myst.h"
+#include "mohawk/myst_scripts_selenitic.h"
#include "mohawk/myst_saveload.h"
#include "mohawk/dialogs.h"
#include "mohawk/resource.h"
@@ -82,8 +85,6 @@ MohawkEngine_Myst::MohawkEngine_Myst(OSystem *syst, const MohawkGameDescription
_view.scriptResCount = 0;
_view.scriptResources = NULL;
- _scriptParser->disableInitOpcodes();
-
if ((getFeatures() & GF_ME) && getPlatform() == Common::kPlatformMacintosh) {
const Common::FSNode gameDataDir(ConfMan.get("path"));
SearchMan.addSubDirectoryMatching(gameDataDir, "CD Data");
@@ -235,7 +236,6 @@ Common::Error MohawkEngine_Myst::run() {
_console = new MystConsole(this);
_varStore = new MystVar(this);
_saveLoad = new MystSaveLoad(this, _saveFileMan);
- _scriptParser = new MystScriptParser(this);
_loadDialog = new GUI::SaveLoadChooser(_("Load game:"), _("Load"));
_loadDialog->setSaveMode(false);
_optionsDialog = new MystOptionsDialog(this);
@@ -354,6 +354,17 @@ void MohawkEngine_Myst::changeToStack(uint16 stack) {
_curStack = stack;
+ delete _scriptParser;
+
+ switch (_curStack) {
+ case kSeleniticStack:
+ _scriptParser = new MystScriptParser_Selenitic(this);
+ break;
+ default:
+ _scriptParser = new MystScriptParser_Myst(this);
+ break;
+ }
+
// If the array is empty, add a new one. Otherwise, delete the first
// entry which is the stack file (the second, if there, is the help file).
if (_mhk.empty())