aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorBastien Bouclet2016-02-13 13:32:54 +0100
committerBastien Bouclet2016-02-13 13:52:37 +0100
commit9f1ac5d54caf8792a6856684da8068bc221eca33 (patch)
treef1957e4d25c71c71dbe90d4a0b53fb76143554ee /engines/mohawk
parentf47d7c73284362fc04aad2d32e5328a221788671 (diff)
downloadscummvm-rg350-9f1ac5d54caf8792a6856684da8068bc221eca33.tar.gz
scummvm-rg350-9f1ac5d54caf8792a6856684da8068bc221eca33.tar.bz2
scummvm-rg350-9f1ac5d54caf8792a6856684da8068bc221eca33.zip
MOHAWK: Allow movie areas to override the playback rate
Unfortunately our QuickTime player does not allow overriding the playback rate for videos with sound. The steel jaw trap in Channelwood is not played at 125% speed as it should.
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/myst_areas.cpp19
-rw-r--r--engines/mohawk/myst_areas.h2
2 files changed, 14 insertions, 7 deletions
diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp
index 82213fac2b..005ee2a6b6 100644
--- a/engines/mohawk/myst_areas.cpp
+++ b/engines/mohawk/myst_areas.cpp
@@ -199,7 +199,7 @@ MystAreaVideo::MystAreaVideo(MohawkEngine_Myst *vm, Common::SeekableReadStream *
_direction = rlstStream->readSint16LE();
_playBlocking = rlstStream->readUint16LE();
_loop = rlstStream->readUint16LE();
- _u3 = rlstStream->readUint16LE();
+ _playRate = rlstStream->readUint16LE();
// TODO: Out of bound values should clip the movie
if (_left < 0)
@@ -207,9 +207,6 @@ MystAreaVideo::MystAreaVideo(MohawkEngine_Myst *vm, Common::SeekableReadStream *
if (_top < 0)
_top = 0;
- if (_u3 != 0)
- warning("Type 6 _u3 != 0");
-
debugC(kDebugResource, "\tvideoFile: \"%s\"", _videoFile.c_str());
debugC(kDebugResource, "\tleft: %d", _left);
debugC(kDebugResource, "\ttop: %d", _top);
@@ -217,7 +214,7 @@ MystAreaVideo::MystAreaVideo(MohawkEngine_Myst *vm, Common::SeekableReadStream *
debugC(kDebugResource, "\tdirection: %d", _direction);
debugC(kDebugResource, "\tplayBlocking: %d", _playBlocking);
debugC(kDebugResource, "\tplayOnCardChange: %d", _playOnCardChange);
- debugC(kDebugResource, "\tu3: %d", _u3);
+ debugC(kDebugResource, "\tplayRate: %d", _playRate);
}
VideoHandle MystAreaVideo::playMovie() {
@@ -233,10 +230,19 @@ VideoHandle MystAreaVideo::playMovie() {
handle->moveTo(_left, _top);
handle->setLooping(_loop != 0);
+ Common::Rational rate;
+ if (_playRate != 0) {
+ rate = Common::Rational(_playRate, 100);
+ } else {
+ rate = 1;
+ }
+
if (_direction == -1) {
+ rate = -rate;
handle->seek(handle->getDuration());
- handle->setRate(-1);
}
+
+ handle->setRate(rate);
} else {
// Resume the video
handle->pause(false);
@@ -400,6 +406,7 @@ void MystAreaImageSwitch::drawDataToScreen() {
}
}
+//TODO: Merge with the method above?
void MystAreaImageSwitch::drawConditionalDataToScreen(uint16 state, bool update) {
bool drawSubImage = false;
int16 subImageId = 0;
diff --git a/engines/mohawk/myst_areas.h b/engines/mohawk/myst_areas.h
index 63357e5718..09ec6a2742 100644
--- a/engines/mohawk/myst_areas.h
+++ b/engines/mohawk/myst_areas.h
@@ -124,7 +124,7 @@ protected:
int16 _direction; // 1 => forward, -1 => backwards
uint16 _playBlocking;
uint16 _playOnCardChange;
- uint16 _u3;
+ uint16 _playRate; // percents
};
class MystAreaActionSwitch : public MystArea {