diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/scenery.cpp | 27 | ||||
-rw-r--r-- | engines/gob/videoplayer.cpp | 22 |
2 files changed, 23 insertions, 26 deletions
diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp index 02a2f39ca0..7facfe01bf 100644 --- a/engines/gob/scenery.cpp +++ b/engines/gob/scenery.cpp @@ -619,23 +619,19 @@ void Scenery::updateAnim(int16 layer, int16 frame, int16 animation, int16 flags, if (frame >= (int32)_vm->_vidPlayer->getFrameCount(obj.videoSlot - 1)) frame = _vm->_vidPlayer->getFrameCount(obj.videoSlot - 1) - 1; - // Seek to frame - if (_vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1) < 255) { + if (frame != (int32)_vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1)) { + // Seek to frame + VideoPlayer::Properties props; + props.forceSeek = true; props.waitEndFrame = false; props.lastFrame = frame; - _vm->_vidPlayer->play(obj.videoSlot - 1, props); - - } else { - int16 curFrame = _vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1) + 1; - uint8 frameWrap = curFrame / 256; - frame = (frame + 1) % 256; - VideoPlayer::Properties props; - - props.waitEndFrame = false; - props.lastFrame = frameWrap * 256 + frame; + if ((int32)_vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1) < frame) + props.startFrame = _vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1) + 1; + else + props.startFrame = 0; _vm->_vidPlayer->play(obj.videoSlot - 1, props); } @@ -736,13 +732,12 @@ void Scenery::updateAnim(int16 layer, int16 frame, int16 animation, int16 flags, _vm->_draw->invalidateRect(_vm->_draw->_destSpriteX, _vm->_draw->_destSpriteY, _vm->_draw->_destSpriteX + _vm->_draw->_spriteRight - 1, _vm->_draw->_destSpriteY + _vm->_draw->_spriteBottom - 1); - } if (!(flags & 4)) { - _animLeft = _toRedrawLeft = left; - _animTop = _toRedrawTop = top; - _animRight = _toRedrawRight = right; + _animLeft = _toRedrawLeft = left; + _animTop = _toRedrawTop = top; + _animRight = _toRedrawRight = right; _animBottom = _toRedrawBottom = bottom; } diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp index db82c9b965..d0d2f4309f 100644 --- a/engines/gob/videoplayer.cpp +++ b/engines/gob/videoplayer.cpp @@ -521,10 +521,10 @@ void VideoPlayer::writeVideoInfo(const Common::String &file, int16 varX, int16 v int16 x = -1, y = -1, width = -1, height = -1; - x = video.decoder->getDefaultX(); - y = video.decoder->getDefaultY(); - width = video.decoder->getWidth(); - width = video.decoder->getHeight(); + x = video.decoder->getDefaultX(); + y = video.decoder->getDefaultY(); + width = video.decoder->getWidth(); + height = video.decoder->getHeight(); if (VAR_OFFSET(varX) == 0xFFFFFFFF) video.decoder->getFrameCoords(1, x, y, width, height); @@ -535,6 +535,8 @@ void VideoPlayer::writeVideoInfo(const Common::String &file, int16 varX, int16 v WRITE_VAR_OFFSET(varWidth , width); WRITE_VAR_OFFSET(varHeight, height); + closeVideo(slot); + } else { WRITE_VAR_OFFSET(varX , (uint32) -1); WRITE_VAR_OFFSET(varY , (uint32) -1); @@ -560,7 +562,7 @@ bool VideoPlayer::copyFrame(int slot, byte *dest, int32 h = MIN<int32>(height, surface->h); const byte *src = (byte*)surface->pixels + (top * surface->pitch) + left; - byte *dst = dest + (y * pitch) + x; + byte *dst = dest + (y * pitch) + x; if (transp < 0) { // No transparency @@ -578,10 +580,10 @@ bool VideoPlayer::copyFrame(int slot, byte *dest, const byte *srcRow = src; byte *dstRow = dst; - memcpy(dst, src, w); + memcpy(dstRow, srcRow, w); - srcRow += surface->pitch; - dstRow += pitch; + src += surface->pitch; + dst += pitch; } return true; @@ -597,8 +599,8 @@ bool VideoPlayer::copyFrame(int slot, byte *dest, if (*srcRow != transp) *dstRow = *srcRow; - srcRow += surface->pitch; - dstRow += pitch; + src += surface->pitch; + dst += pitch; } return true; |