aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst_areas.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2011-01-11 19:52:58 +0000
committerBastien Bouclet2011-01-11 19:52:58 +0000
commitb1de27ed8f54b7321eaee165f69c90ac73d262f7 (patch)
tree028c2051a41960f7c9996002325e05a8059508fd /engines/mohawk/myst_areas.cpp
parentf6b7979277cc83e29ac9c6a7dc28a1e1e0dccfbf (diff)
downloadscummvm-rg350-b1de27ed8f54b7321eaee165f69c90ac73d262f7.tar.gz
scummvm-rg350-b1de27ed8f54b7321eaee165f69c90ac73d262f7.tar.bz2
scummvm-rg350-b1de27ed8f54b7321eaee165f69c90ac73d262f7.zip
MOHAWK: Implement Myst imager videos seeking / looping
svn-id: r55208
Diffstat (limited to 'engines/mohawk/myst_areas.cpp')
-rw-r--r--engines/mohawk/myst_areas.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp
index 9cbf79ddaf..c69fd47633 100644
--- a/engines/mohawk/myst_areas.cpp
+++ b/engines/mohawk/myst_areas.cpp
@@ -197,19 +197,23 @@ MystResourceType6::MystResourceType6(MohawkEngine_Myst *vm, Common::SeekableRead
debugC(kDebugResource, "\tplayBlocking: %d", _playBlocking);
debugC(kDebugResource, "\tplayOnCardChange: %d", _playOnCardChange);
debugC(kDebugResource, "\tu3: %d", _u3);
-
- _videoRunning = false;
}
-void MystResourceType6::playMovie() {
- if (!_videoRunning) {
- if (_playBlocking)
- _vm->_video->playMovie(_videoFile, _left, _top);
- else
- _vm->_video->playBackgroundMovie(_videoFile, _left, _top, _loop);
+VideoHandle MystResourceType6::playMovie() {
+ // Check if the video is already running
+ VideoHandle handle = _vm->_video->findVideoHandle(_videoFile);
- _videoRunning = true;
+ // If the video is not running, play it
+ if (handle == NULL_VID_HANDLE || _vm->_video->endOfVideo(handle)) {
+ if (_playBlocking) {
+ _vm->_video->playMovie(_videoFile, _left, _top);
+ handle = NULL_VID_HANDLE;
+ } else {
+ handle = _vm->_video->playBackgroundMovie(_videoFile, _left, _top, _loop);
+ }
}
+
+ return handle;
}
void MystResourceType6::handleCardChange() {
@@ -218,12 +222,8 @@ void MystResourceType6::handleCardChange() {
}
bool MystResourceType6::isPlaying() {
- if (_videoRunning) {
- VideoHandle handle = _vm->_video->findVideoHandle(_videoFile);
- return handle != NULL_VID_HANDLE && !_vm->_video->endOfVideo(handle);
- }
-
- return false;
+ VideoHandle handle = _vm->_video->findVideoHandle(_videoFile);
+ return handle != NULL_VID_HANDLE && !_vm->_video->endOfVideo(handle);
}
MystResourceType7::MystResourceType7(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResource(vm, rlstStream, parent) {