aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst_stacks
diff options
context:
space:
mode:
authorDavid Fioramonti2018-06-24 15:54:04 -0700
committerBastien Bouclet2018-07-15 07:59:44 +0200
commitbd21a5c0f362f93946ce2febeb45176fa5d496dc (patch)
treec8c5011a9ed8658f9fbd5c1ba9a888ea85743740 /engines/mohawk/myst_stacks
parentb1aec443c42e29b156f460f6a77f2356cb38176f (diff)
downloadscummvm-rg350-bd21a5c0f362f93946ce2febeb45176fa5d496dc.tar.gz
scummvm-rg350-bd21a5c0f362f93946ce2febeb45176fa5d496dc.tar.bz2
scummvm-rg350-bd21a5c0f362f93946ce2febeb45176fa5d496dc.zip
MOHAWK: MYST: Have Mech fortress west direction persists after returning
Fixes Trac#10575. When stepping away or pressing the buttom for the mechanical age fortress rotator after setting it west it would be south. This is because some variables used for a workaround were being reset everytime the rotator puzzle was being reinitalized (in o_fortressRotation_int). Which happens when the player steps back up to the rotator controls. This change simply removes the variables being reset so they retain the variables they had before. Those variables are already initalized in the Mechanical constructor.
Diffstat (limited to 'engines/mohawk/myst_stacks')
-rw-r--r--engines/mohawk/myst_stacks/mechanical.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp
index c05ed1b6a2..1177be6771 100644
--- a/engines/mohawk/myst_stacks/mechanical.cpp
+++ b/engines/mohawk/myst_stacks/mechanical.cpp
@@ -815,15 +815,6 @@ void Mechanical::o_fortressRotation_init(uint16 var, const ArgumentsArray &args)
VideoEntryPtr gears = _fortressRotationGears->playMovie();
gears->setLooping(true);
- gears->seek(Audio::Timestamp(0, 1800 * _fortressDirection, 600));
- gears->setRate(0);
-
- _fortressRotationSounds[0] = args[0];
- _fortressRotationSounds[1] = args[1];
- _fortressRotationSounds[2] = args[2];
- _fortressRotationSounds[3] = args[3];
-
- _fortressRotationBrake = 0;
// WORKAROUND for the tower rotation bug in Myst ME.
// The original engine only allowed to visit two out of the three small islands,
@@ -835,12 +826,25 @@ void Mechanical::o_fortressRotation_init(uint16 var, const ArgumentsArray &args)
// looped and adding that time to the current movie position.
// Hence allowing the fortress position to be properly computed.
uint32 movieDuration = gears->getDuration().convertToFramerate(600).totalNumberOfFrames();
- if (movieDuration == 3680) {
- _fortressRotationShortMovieWorkaround = true;
- _fortressRotationShortMovieCount = 0;
- _fortressRotationShortMovieLast = 0;
+ _fortressRotationShortMovieWorkaround = movieDuration == 3680;
+
+ if (!_fortressRotationShortMovieWorkaround) {
+ gears->seek(Audio::Timestamp(0, 1800 * _fortressDirection, 600));
+ } else {
+ _fortressRotationShortMovieLast = 1800 * (_fortressDirection % 2);
+ _fortressRotationShortMovieCount = _fortressDirection >= 2 ? 1 : 0;
+ gears->seek(Audio::Timestamp(0, _fortressRotationShortMovieLast, 600));
}
+ gears->setRate(0);
+
+ _fortressRotationSounds[0] = args[0];
+ _fortressRotationSounds[1] = args[1];
+ _fortressRotationSounds[2] = args[2];
+ _fortressRotationSounds[3] = args[3];
+
+ _fortressRotationBrake = 0;
+
_fortressRotationRunning = true;
_gearsWereRunning = false;
}