From 9f1ac5d54caf8792a6856684da8068bc221eca33 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 13 Feb 2016 13:32:54 +0100 Subject: 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. --- engines/mohawk/myst_areas.cpp | 19 +++++++++++++------ engines/mohawk/myst_areas.h | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'engines/mohawk') 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 { -- cgit v1.2.3