diff options
Diffstat (limited to 'engines/mohawk/myst_areas.cpp')
-rw-r--r-- | engines/mohawk/myst_areas.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp index 12a2c7f44c..7a9596d8e0 100644 --- a/engines/mohawk/myst_areas.cpp +++ b/engines/mohawk/myst_areas.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -223,20 +223,26 @@ VideoHandle MystResourceType6::playMovie() { VideoHandle handle = _vm->_video->findVideoHandle(_videoFile); // If the video is not running, play it - if (handle == NULL_VID_HANDLE || _vm->_video->endOfVideo(handle)) { - handle = _vm->_video->playMovie(_videoFile, _left, _top, _loop); + if (!handle || handle->endOfVideo()) { + handle = _vm->_video->playMovie(_videoFile); + if (!handle) + error("Failed to open '%s'", _videoFile.c_str()); + + handle->moveTo(_left, _top); + handle->setLooping(_loop != 0); + if (_direction == -1) { - _vm->_video->seekToTime(handle, _vm->_video->getDuration(handle)); - _vm->_video->setVideoRate(handle, -1); + handle->seek(handle->getDuration()); + handle->setRate(-1); } } else { // Resume the video - _vm->_video->pauseMovie(handle, false); + handle->pause(false); } if (_playBlocking) { _vm->_video->waitUntilMovieEnds(handle); - handle = NULL_VID_HANDLE; + return VideoHandle(); } return handle; @@ -249,13 +255,13 @@ void MystResourceType6::handleCardChange() { bool MystResourceType6::isPlaying() { VideoHandle handle = _vm->_video->findVideoHandle(_videoFile); - return handle != NULL_VID_HANDLE && !_vm->_video->endOfVideo(handle); + return handle && !handle->endOfVideo(); } void MystResourceType6::pauseMovie(bool pause) { VideoHandle handle = _vm->_video->findVideoHandle(_videoFile); - if (handle != NULL_VID_HANDLE && !_vm->_video->endOfVideo(handle)) - _vm->_video->pauseMovie(handle, pause); + if (handle && !handle->endOfVideo()) + handle->pause(pause); } MystResourceType7::MystResourceType7(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResource(vm, rlstStream, parent) { |