diff options
author | Matthew Hoops | 2010-06-01 17:01:22 +0000 |
---|---|---|
committer | Matthew Hoops | 2010-06-01 17:01:22 +0000 |
commit | 42b22d16f6f4f8defc3bc276343b3066c8603877 (patch) | |
tree | 201d096c06afe423efd1784544519daeb75fd49d /engines/mohawk/video.cpp | |
parent | 65f3cfcbd816fe05437298cd46621d9f058aaea3 (diff) | |
download | scummvm-rg350-42b22d16f6f4f8defc3bc276343b3066c8603877.tar.gz scummvm-rg350-42b22d16f6f4f8defc3bc276343b3066c8603877.tar.bz2 scummvm-rg350-42b22d16f6f4f8defc3bc276343b3066c8603877.zip |
Fix videos in Riven activated from a different card from which they are played; minor cleanup.
svn-id: r49377
Diffstat (limited to 'engines/mohawk/video.cpp')
-rw-r--r-- | engines/mohawk/video.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp index deeb5daabf..ed1fc6b2c6 100644 --- a/engines/mohawk/video.cpp +++ b/engines/mohawk/video.cpp @@ -35,7 +35,6 @@ VideoManager::VideoManager(MohawkEngine* vm) : _vm(vm) { } VideoManager::~VideoManager() { - _mlstRecords.clear(); stopVideos(); } @@ -125,7 +124,7 @@ void VideoManager::waitUntilMovieEnds(VideoHandle videoHandle) { delete _videoStreams[videoHandle].video; _videoStreams[videoHandle].video = 0; _videoStreams[videoHandle].id = 0; - _videoStreams[videoHandle].filename = ""; + _videoStreams[videoHandle].filename.clear(); } void VideoManager::playBackgroundMovie(Common::String filename, int16 x, int16 y, bool loop) { @@ -158,7 +157,7 @@ bool VideoManager::updateBackgroundMovies() { delete _videoStreams[i].video; _videoStreams[i].video = 0; _videoStreams[i].id = 0; - _videoStreams[i].filename = ""; + _videoStreams[i].filename.clear(); continue; } } @@ -245,7 +244,15 @@ void VideoManager::activateMLST(uint16 mlstId, uint16 card) { if (mlstRecord.u1 != 1) warning("mlstRecord.u1 not 1"); + // We've found a match, add it if (mlstRecord.index == mlstId) { + // Make sure we don't have a duplicate + for (uint32 j = 0; j < _mlstRecords.size(); j++) + if (_mlstRecords[j].index == mlstId) { + _mlstRecords.remove_at(j); + break; + } + _mlstRecords.push_back(mlstRecord); break; } @@ -254,6 +261,10 @@ void VideoManager::activateMLST(uint16 mlstId, uint16 card) { delete mlstStream; } +void VideoManager::clearMLST() { + _mlstRecords.clear(); +} + void VideoManager::playMovie(uint16 id) { for (uint16 i = 0; i < _mlstRecords.size(); i++) if (_mlstRecords[i].code == id) { |