[Scummvm-cvs-logs] SF.net SVN: scummvm:[54720] scummvm/trunk/engines/mohawk/myst_stacks
bgk at users.sourceforge.net
bgk at users.sourceforge.net
Wed Dec 1 21:37:36 CET 2010
Revision: 54720
http://scummvm.svn.sourceforge.net/scummvm/?rev=54720&view=rev
Author: bgk
Date: 2010-12-01 20:37:36 +0000 (Wed, 01 Dec 2010)
Log Message:
-----------
MOHAWK: Implement maze runner backtrack button. Last part of Selenitic completed !
Modified Paths:
--------------
scummvm/trunk/engines/mohawk/myst_stacks/selenitic.cpp
scummvm/trunk/engines/mohawk/myst_stacks/selenitic.h
Modified: scummvm/trunk/engines/mohawk/myst_stacks/selenitic.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/selenitic.cpp 2010-12-01 20:36:19 UTC (rev 54719)
+++ scummvm/trunk/engines/mohawk/myst_stacks/selenitic.cpp 2010-12-01 20:37:36 UTC (rev 54720)
@@ -302,6 +302,9 @@
if (videoToNext) {
_mazeRunnerCompass->drawConditionalDataToScreen(8);
+ if (move == 3)
+ mazeRunnerBacktrack(oldPosition);
+
mazeRunnerPlayVideo(videoToNext, oldPosition);
mazeRunnerUpdateCompass();
@@ -310,6 +313,68 @@
}
}
+void MystScriptParser_Selenitic::mazeRunnerBacktrack(uint16 &oldPosition) {
+ if (oldPosition == 289)
+ _mazeRunnerDirection = 3;
+
+ uint16 targetDirection = _mazeRunnerPosition % 8;
+
+ if (_mazeRunnerPosition == 289) {
+ targetDirection = 3;
+ } else if (_mazeRunnerPosition == 288) {
+ targetDirection = 0;
+ } else if (_mazeRunnerPosition == 252) {
+ targetDirection = 6;
+ } else if (_mazeRunnerPosition == 212) {
+ targetDirection = 2;
+ } else if (_mazeRunnerPosition == 171) {
+ targetDirection = 7;
+ } else if (_mazeRunnerPosition == 150) {
+ targetDirection = 4;
+ } else if (_mazeRunnerPosition == 116) {
+ targetDirection = 2;
+ }
+
+ uint16 moves = 0;
+ if (targetDirection >= _mazeRunnerDirection) {
+ moves = targetDirection - _mazeRunnerDirection;
+ } else {
+ moves = targetDirection + 8 - _mazeRunnerDirection;
+ }
+
+ bool goLeft = false;
+ if (moves > 4)
+ goLeft = true;
+
+ while (targetDirection != _mazeRunnerDirection) {
+ _mazeRunnerCompass->drawConditionalDataToScreen(8);
+ if (goLeft) {
+ _mazeRunnerLeftButton->drawConditionalDataToScreen(2);
+
+ uint16 video = _mazeRunnerVideos[oldPosition][1];
+ oldPosition = _mazeRunnerMap[oldPosition][1];
+ _mazeRunnerDirection = (_mazeRunnerDirection + 7) % 8;
+
+ mazeRunnerPlayVideo(video, oldPosition);
+
+ _mazeRunnerLeftButton->drawConditionalDataToScreen(1);
+ } else {
+ _mazeRunnerRightButton->drawConditionalDataToScreen(2);
+
+ uint16 video = _mazeRunnerVideos[oldPosition][2];
+ oldPosition = _mazeRunnerMap[oldPosition][2];
+ _mazeRunnerDirection = (_mazeRunnerDirection + 1) % 8;
+
+ mazeRunnerPlayVideo(video, oldPosition);
+
+ _mazeRunnerRightButton->drawConditionalDataToScreen(1);
+ }
+ _mazeRunnerCompass->drawConditionalDataToScreen(_mazeRunnerDirection);
+ _vm->_system->delayMillis(150);
+ }
+
+}
+
void MystScriptParser_Selenitic::mazeRunnerPlayVideo(uint16 video, uint16 pos) {
Common::String file;
Modified: scummvm/trunk/engines/mohawk/myst_stacks/selenitic.h
===================================================================
--- scummvm/trunk/engines/mohawk/myst_stacks/selenitic.h 2010-12-01 20:36:19 UTC (rev 54719)
+++ scummvm/trunk/engines/mohawk/myst_stacks/selenitic.h 2010-12-01 20:37:36 UTC (rev 54720)
@@ -130,6 +130,7 @@
void mazeRunnerUpdateCompass();
void mazeRunnerPlaySoundHelp();
void mazeRunnerPlayVideo(uint16 video, uint16 pos);
+ void mazeRunnerBacktrack(uint16 &oldPosition);
};
}
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