GROOVIE: Fix various roq glitches

They should now all decode correctly
This commit is contained in:
Matthew Hoops 2014-01-14 19:18:15 -05:00
parent 3638f1191c
commit c0a172bc71
2 changed files with 15 additions and 4 deletions

View File

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

View File

@ -82,7 +82,7 @@ private:
byte _offScale;
bool _dirty;
byte _alpha;
bool _firstFrame;
};
} // End of Groovie namespace