From c0a172bc71adeaed22fa53c539c5e3743fb87191 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 14 Jan 2014 19:18:15 -0500 Subject: GROOVIE: Fix various roq glitches They should now all decode correctly --- engines/groovie/roq.cpp | 17 ++++++++++++++--- engines/groovie/roq.h | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 118b77edce..c7c8831c34 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -46,7 +46,8 @@ namespace Groovie { ROQPlayer::ROQPlayer(GroovieEngine *vm) : VideoPlayer(vm), _codingTypeCount(0), - _bg(&_vm->_graphicsMan->_background) { + _bg(&_vm->_graphicsMan->_background), + _firstFrame(true) { // Create the work surfaces _currBuf = new Graphics::Surface(); @@ -83,6 +84,9 @@ uint16 ROQPlayer::loadInternal() { _num2blocks = 0; _num4blocks = 0; + // Reset the first frame flag + _firstFrame = true; + if ((blockHeader.size == 0) && (blockHeader.param == 0)) { // Set the offset scaling to 2 _offScale = 2; @@ -117,6 +121,12 @@ void ROQPlayer::buildShowBuf() { } } + // On the first frame, copy from the current buffer to the prev buffer + if (_firstFrame) { + _prevBuf->copyFrom(*_currBuf); + _firstFrame = false; + } + // Swap buffers SWAP(_prevBuf, _currBuf); } @@ -237,6 +247,9 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) { return false; } + // Reset the first frame flag + _firstFrame = true; + // Save the alpha channel size _alpha = blockHeader.param; @@ -412,8 +425,6 @@ void ROQPlayer::processBlockQuadVectorBlockSub(int baseX, int baseY, int8 Mx, in bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) { debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing still (JPEG) block"); - warning("Groovie::ROQ: JPEG frame (unfinished)"); - Image::JPEGDecoder jpg; uint32 startPos = _file->pos(); diff --git a/engines/groovie/roq.h b/engines/groovie/roq.h index af68d6c14a..7e7d38580e 100644 --- a/engines/groovie/roq.h +++ b/engines/groovie/roq.h @@ -82,7 +82,7 @@ private: byte _offScale; bool _dirty; byte _alpha; - + bool _firstFrame; }; } // End of Groovie namespace -- cgit v1.2.3