From adf8820aee35ce2fa38b5420aab50461653f705f Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Thu, 20 Jan 2011 15:29:32 +0000 Subject: GOB: Make blocking videos default svn-id: r55354 --- engines/gob/inter_v6.cpp | 7 +------ engines/gob/videoplayer.cpp | 10 +++++++++- engines/gob/videoplayer.h | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/engines/gob/inter_v6.cpp b/engines/gob/inter_v6.cpp index c04f34d894..5f93f9af26 100644 --- a/engines/gob/inter_v6.cpp +++ b/engines/gob/inter_v6.cpp @@ -169,7 +169,7 @@ void Inter_v6::o6_playVmdOrMusic() { close = false; } - _vm->_vidPlayer->evaluateFlags(props); + _vm->_vidPlayer->evaluateFlags(props, true); int slot = 0; if ((fileName[0] != 0) && ((slot = _vm->_vidPlayer->openVideo(true, fileName, props)) < 0)) { @@ -177,11 +177,6 @@ void Inter_v6::o6_playVmdOrMusic() { return; } - if(!(props.flags & 0x1000) && !(props.flags & VideoPlayer::kFlagNoVideo)) - props.flags |= VideoPlayer::kFlagNonBlocking; - else - props.flags &= ~0x1000; - if (props.startFrame >= 0) _vm->_vidPlayer->play(slot, props); diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp index c9dae63fa5..2c779b512d 100644 --- a/engines/gob/videoplayer.cpp +++ b/engines/gob/videoplayer.cpp @@ -74,7 +74,7 @@ VideoPlayer::~VideoPlayer() { _videoSlots[i].close(); } -void VideoPlayer::evaluateFlags(Properties &properties) { +void VideoPlayer::evaluateFlags(Properties &properties, bool allowNonBlock) { if (properties.flags & kFlagFrontSurface) { properties.sprite = Draw::kFrontSurface; } else if (properties.flags & kFlagOtherSurface) { @@ -87,6 +87,14 @@ void VideoPlayer::evaluateFlags(Properties &properties) { } else { properties.sprite = Draw::kBackSurface; } + + if (allowNonBlock) { + if(!(properties.flags & 0x1000) && !(properties.flags & kFlagNoVideo)) + properties.flags |= kFlagNonBlocking; + else + properties.flags &= ~0x1000; + } else + properties.flags &= ~0x1000; } int VideoPlayer::openVideo(bool primary, const Common::String &file, Properties &properties) { diff --git a/engines/gob/videoplayer.h b/engines/gob/videoplayer.h index 35ad5545e6..e1f6e01403 100644 --- a/engines/gob/videoplayer.h +++ b/engines/gob/videoplayer.h @@ -102,7 +102,7 @@ public: VideoPlayer(GobEngine *vm); ~VideoPlayer(); - void evaluateFlags(Properties &properties); + void evaluateFlags(Properties &properties, bool allowNonBlock = false); int openVideo(bool primary, const Common::String &file, Properties &properties); bool closeVideo(int slot = 0); -- cgit v1.2.3