From 9d5eea2d2c3f79147b15fb7920cd6d5de8e15d44 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Wed, 7 May 2008 03:49:53 +0000 Subject: Sound in object videos works now, too svn-id: r31916 --- engines/gob/mult_v2.cpp | 5 +++++ engines/gob/videoplayer.cpp | 12 +++++++++++- engines/gob/videoplayer.h | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/engines/gob/mult_v2.cpp b/engines/gob/mult_v2.cpp index 9045089632..5ff0612497 100644 --- a/engines/gob/mult_v2.cpp +++ b/engines/gob/mult_v2.cpp @@ -686,6 +686,11 @@ void Mult_v2::newCycleAnim(Mult_Object &animObj) { return; animLayer = _vm->_scenery->getAnimLayer(nAnim, nLayer); + } else { + if (animObj.videoSlot > 0) { + _vm->_video->retrace(); + _vm->_vidPlayer->slotWaitEndFrame(animObj.videoSlot - 1, true); + } } if (animData.animType == 4) { diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp index e088646498..6b21c18676 100644 --- a/engines/gob/videoplayer.cpp +++ b/engines/gob/videoplayer.cpp @@ -334,7 +334,7 @@ int VideoPlayer::slotOpen(const char *videoFile, Type which) { } video->getVideo()->setVideoMemory(); - video->getVideo()->disableSound(); + video->getVideo()->enableSound(*_vm->_mixer); _videoSlots.push_back(video); @@ -388,6 +388,16 @@ void VideoPlayer::slotCopyPalette(int slot, int16 palStart, int16 palEnd) { copyPalette(*(_videoSlots[slot]->getVideo()), palStart, palEnd); } +void VideoPlayer::slotWaitEndFrame(int slot, bool onlySound) { + if ((slot < 0) || (((uint) slot) >= _videoSlots.size())) + return; + + CoktelVideo &video = *(_videoSlots[slot]->getVideo()); + + if (!onlySound || (video.getFeatures() & CoktelVideo::kFeaturesSound)) + video.waitEndFrame(); +} + bool VideoPlayer::slotIsOpen(int slot) const { if ((slot >= 0) && (((uint) slot) < _videoSlots.size())) return true; diff --git a/engines/gob/videoplayer.h b/engines/gob/videoplayer.h index fd3c68aa1a..a04a0dbc9d 100644 --- a/engines/gob/videoplayer.h +++ b/engines/gob/videoplayer.h @@ -68,6 +68,7 @@ public: uint16 left, uint16 top, uint16 width, uint16 height, uint16 x, uint16 y, uint16 pitch, int16 transp = -1); void slotCopyPalette(int slot, int16 palStart = -1, int16 palEnd = -1); + void slotWaitEndFrame(int slot, bool onlySound = false); bool slotIsOpen(int slot) const; -- cgit v1.2.3