aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/gob/inter_v6.cpp8
-rw-r--r--engines/gob/videoplayer.cpp18
-rw-r--r--engines/gob/videoplayer.h5
3 files changed, 12 insertions, 19 deletions
diff --git a/engines/gob/inter_v6.cpp b/engines/gob/inter_v6.cpp
index 01301ebe0a..77affee141 100644
--- a/engines/gob/inter_v6.cpp
+++ b/engines/gob/inter_v6.cpp
@@ -167,11 +167,11 @@ void Inter_v6::o6_playVmdOrMusic() {
if (props.startFrame == -2) {
props.startFrame = 0;
- props.lastFrame = -1;
- props.flags &= ~0x1000;
+ props.lastFrame = -1;
+ props.noBlock = true;
}
- _vm->_vidPlayer->evaluateFlags(props, true);
+ _vm->_vidPlayer->evaluateFlags(props);
int slot = 0;
if ((fileName[0] != 0) && ((slot = _vm->_vidPlayer->openVideo(true, fileName, props)) < 0)) {
@@ -182,7 +182,7 @@ void Inter_v6::o6_playVmdOrMusic() {
if (props.startFrame >= 0)
_vm->_vidPlayer->play(slot, props);
- if (close && !(props.flags & VideoPlayer::kFlagNonBlocking)) {
+ if (close && !props.noBlock) {
if ((props.flags & VideoPlayer::kFlagNoVideo) && (!props.canceled))
_vm->_util->longDelay(500);
diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp
index 63d751b13e..f1876f5294 100644
--- a/engines/gob/videoplayer.cpp
+++ b/engines/gob/videoplayer.cpp
@@ -40,7 +40,7 @@ VideoPlayer::Properties::Properties() : type(kVideoTypeTry), sprite(Draw::kFront
x(-1), y(-1), width(-1), height(-1), flags(kFlagFrontSurface), switchColorMode(false),
startFrame(-1), lastFrame(-1), endFrame(-1), forceSeek(false),
breakKey(kShortKeyEscape), palCmd(8), palStart(0), palEnd(255), palFrame(-1),
- loop(false), fade(false), waitEndFrame(true), canceled(false) {
+ noBlock(false), loop(false), fade(false), waitEndFrame(true), canceled(false) {
}
@@ -74,7 +74,7 @@ VideoPlayer::~VideoPlayer() {
_videoSlots[i].close();
}
-void VideoPlayer::evaluateFlags(Properties &properties, bool allowNonBlock) {
+void VideoPlayer::evaluateFlags(Properties &properties) {
if (properties.flags & kFlagFrontSurface) {
properties.sprite = Draw::kFrontSurface;
} else if (properties.flags & kFlagOtherSurface) {
@@ -87,14 +87,6 @@ void VideoPlayer::evaluateFlags(Properties &properties, bool allowNonBlock) {
} 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) {
@@ -255,7 +247,7 @@ bool VideoPlayer::play(int slot, Properties &properties) {
properties.canceled = false;
- if (primary && (properties.flags & kFlagNonBlocking)) {
+ if (primary && properties.noBlock) {
video->live = true;
properties.waitEndFrame = false;
_liveProperties = properties;
@@ -263,9 +255,9 @@ bool VideoPlayer::play(int slot, Properties &properties) {
return true;
}
- if (_vm->getGameType() != kGameTypeUrban)
+ if ((_vm->getGameType() != kGameTypeUrban) && (_vm->getGameType() != kGameTypeBambou))
// NOTE: For testing (and comfort?) purposes, we enable aborting of all videos.
- // Except for Urban Runner, where it leads to glitches
+ // Except for Urban Runner and Bambou, where it leads to glitches
properties.breakKey = kShortKeyEscape;
while ((properties.startFrame != properties.lastFrame) &&
diff --git a/engines/gob/videoplayer.h b/engines/gob/videoplayer.h
index 2235840c3f..bf473180a4 100644
--- a/engines/gob/videoplayer.h
+++ b/engines/gob/videoplayer.h
@@ -50,7 +50,6 @@ public:
kFlagFrontSurface = 0x000080, ///< Draw directly into the front surface.
kFlagNoVideo = 0x000100, ///< Only sound.
kFlagOtherSurface = 0x000800, ///< Draw into a specific sprite.
- kFlagNonBlocking = 0x001000, ///< "Live" video playing while scripts continue.
kFlagScreenSurface = 0x400000 ///< Draw into a newly created sprite of screen dimensions.
};
@@ -90,6 +89,8 @@ public:
int16 palEnd; ///< Palette entry to end at.
int32 palFrame; ///< Frame to apply the palette command at.
+ bool noBlock; ///< Non-blocking "live" video?
+
bool loop; ///< Loop the video?
bool fade; ///< Fade in?
@@ -103,7 +104,7 @@ public:
VideoPlayer(GobEngine *vm);
~VideoPlayer();
- void evaluateFlags(Properties &properties, bool allowNonBlock = false);
+ void evaluateFlags(Properties &properties);
int openVideo(bool primary, const Common::String &file, Properties &properties);
bool closeVideo(int slot = 0);