GOB: Actually, startFrame == -2 seems to be the only live video flag

svn-id: r55418
This commit is contained in:
Sven Hesse 2011-01-22 11:39:03 +00:00
parent 86b90fe8a6
commit 6e254c4f01
3 changed files with 12 additions and 19 deletions

View File

@ -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);

View File

@ -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) &&

View File

@ -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);