[Scummvm-cvs-logs] SF.net SVN: scummvm:[54807] scummvm/trunk/engines/mohawk
mthreepwood at users.sourceforge.net
mthreepwood at users.sourceforge.net
Tue Dec 7 02:37:43 CET 2010
Revision: 54807
http://scummvm.svn.sourceforge.net/scummvm/?rev=54807&view=rev
Author: mthreepwood
Date: 2010-12-07 01:37:43 +0000 (Tue, 07 Dec 2010)
Log Message:
-----------
MOHAWK: Implement loading to different ages in Myst
Modified Paths:
--------------
scummvm/trunk/engines/mohawk/myst.cpp
scummvm/trunk/engines/mohawk/myst_stacks/intro.cpp
scummvm/trunk/engines/mohawk/myst_stacks/intro.h
Modified: scummvm/trunk/engines/mohawk/myst.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst.cpp 2010-12-07 01:12:48 UTC (rev 54806)
+++ scummvm/trunk/engines/mohawk/myst.cpp 2010-12-07 01:37:43 UTC (rev 54807)
@@ -388,6 +388,7 @@
switch (_curStack) {
case kChannelwoodStack:
+ _saveLoad->_v->globals.currentAge = 4;
_scriptParser = new MystScriptParser_Channelwood(this);
break;
case kCreditsStack:
@@ -397,6 +398,7 @@
_scriptParser = new MystScriptParser_Demo(this);
break;
case kDniStack:
+ _saveLoad->_v->globals.currentAge = 6;
_scriptParser = new MystScriptParser_Dni(this);
break;
case kIntroStack:
@@ -406,21 +408,25 @@
_scriptParser = new MystScriptParser_MakingOf(this);
break;
case kMechanicalStack:
+ _saveLoad->_v->globals.currentAge = 3;
_scriptParser = new MystScriptParser_Mechanical(this);
break;
case kMystStack:
+ _saveLoad->_v->globals.currentAge = 2;
_scriptParser = new MystScriptParser_Myst(this);
break;
case kDemoPreviewStack:
_scriptParser = new MystScriptParser_Preview(this);
break;
case kSeleniticStack:
+ _saveLoad->_v->globals.currentAge = 0;
_scriptParser = new MystScriptParser_Selenitic(this);
break;
case kDemoSlidesStack:
_scriptParser = new MystScriptParser_Slides(this);
break;
case kStoneshipStack:
+ _saveLoad->_v->globals.currentAge = 1;
_scriptParser = new MystScriptParser_Stoneship(this);
break;
default:
Modified: scummvm/trunk/engines/mohawk/myst_stacks/intro.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/intro.cpp 2010-12-07 01:12:48 UTC (rev 54806)
+++ scummvm/trunk/engines/mohawk/myst_stacks/intro.cpp 2010-12-07 01:37:43 UTC (rev 54807)
@@ -26,6 +26,7 @@
#include "mohawk/myst.h"
#include "mohawk/graphics.h"
#include "mohawk/myst_areas.h"
+#include "mohawk/myst_saveload.h"
#include "mohawk/sound.h"
#include "mohawk/video.h"
#include "mohawk/myst_stacks/intro.h"
@@ -63,6 +64,15 @@
void MystScriptParser_Intro::runPersistentScripts() {
}
+uint16 MystScriptParser_Intro::getVar(uint16 var) {
+ switch(var) {
+ case 0:
+ return _vm->_saveLoad->_v->globals.currentAge;
+ default:
+ return MystScriptParser::getVar(var);
+ }
+}
+
void MystScriptParser_Intro::o_useLinkBook(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
// Hard coded SoundId valid only for Intro Stack.
// Other stacks use Opcode 40, which takes SoundId values as arguments.
@@ -72,7 +82,7 @@
debugC(kDebugScript, "\tvar: %d", var);
// TODO: Merge with changeStack (Opcode 40) Implementation?
- if (_vm->_varStore->getVar(var) == 5 || _vm->_varStore->getVar(var) > 7) {
+ if (getVar(var) == 5 || getVar(var) > 7) {
// TODO: Dead Book i.e. Released Sirrus/Achenar
} else {
// Play Linking Sound, blocking...
@@ -84,7 +94,7 @@
// Play Flyby Entry Movie on Masterpiece Edition. The Macintosh version is currently hooked
// up to the Cinepak versions of the video (the 'c' suffix) until the SVQ1 decoder is completed.
if ((_vm->getFeatures() & GF_ME)) {
- switch (_stackMap[_vm->_varStore->getVar(var)]) {
+ switch (_stackMap[getVar(var)]) {
case kSeleniticStack:
if (_vm->getPlatform() == Common::kPlatformMacintosh)
_vm->_video->playMovieCentered(_vm->wrapMovieFilename("FLY_SEc", kMasterpieceOnly));
@@ -123,7 +133,7 @@
}
}
- uint16 varValue = _vm->_varStore->getVar(var);
+ uint16 varValue = getVar(var);
_vm->changeToStack(_stackMap[varValue]);
_vm->changeToCard(_startCard[varValue], true);
Modified: scummvm/trunk/engines/mohawk/myst_stacks/intro.h
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/intro.h 2010-12-07 01:12:48 UTC (rev 54806)
+++ scummvm/trunk/engines/mohawk/myst_stacks/intro.h 2010-12-07 01:37:43 UTC (rev 54807)
@@ -47,6 +47,7 @@
private:
void setupOpcodes();
+ uint16 getVar(uint16 var);
DECLARE_OPCODE(o_useLinkBook);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list