diff options
author | Sven Hesse | 2010-08-08 00:39:03 +0000 |
---|---|---|
committer | Sven Hesse | 2010-08-08 00:39:03 +0000 |
commit | f7363fdb10675bf27c1a1d37d23a25590bdc344c (patch) | |
tree | f439caf375108dd25a9c2fe11a296ce225d8b4ca /engines | |
parent | 12c9e895b559d1ca2780b5b8f156b0451eb11f11 (diff) | |
download | scummvm-rg350-f7363fdb10675bf27c1a1d37d23a25590bdc344c.tar.gz scummvm-rg350-f7363fdb10675bf27c1a1d37d23a25590bdc344c.tar.bz2 scummvm-rg350-f7363fdb10675bf27c1a1d37d23a25590bdc344c.zip |
VIDEO/GOB: Add CoktelDecoder::getDirtyRects()
This allows for the client code to only update the parts of the
video frames that actually changed.
svn-id: r51859
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/demos/demoplayer.cpp | 2 | ||||
-rw-r--r-- | engines/gob/videoplayer.cpp | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/engines/gob/demos/demoplayer.cpp b/engines/gob/demos/demoplayer.cpp index 0782e84a84..cd3e97d7f0 100644 --- a/engines/gob/demos/demoplayer.cpp +++ b/engines/gob/demos/demoplayer.cpp @@ -226,6 +226,7 @@ void DemoPlayer::playVideoDoubled() { for (uint i = 0; i < _vm->_vidPlayer->getFrameCount(); i++) { // _vm->_vidPlayer->playFrame(i); + /* Graphics::CoktelDecoder::State state;// = _vm->_vidPlayer->getState(); int16 w = state.right - state.left + 1; @@ -237,6 +238,7 @@ void DemoPlayer::playVideoDoubled() { state.left, state.top, state.right, state.bottom, state.left, state.top, 0); _vm->_draw->dirtiedRect(_vm->_draw->_frontSurface, state.left * 2, state.top * 2, wD, hD); + */ _vm->_video->retrace(); _vm->_util->processInput(); diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp index d126d0e963..587f640f28 100644 --- a/engines/gob/videoplayer.cpp +++ b/engines/gob/videoplayer.cpp @@ -307,23 +307,23 @@ bool VideoPlayer::playFrame(int slot, Properties &properties) { } */ + const Common::List<Common::Rect> &dirtyRects = video->decoder->getDirtyRects(); + if (modifiedPal && (properties.palCmd == 8) && (properties.sprite == Draw::kBackSurface)) _vm->_video->setFullPalette(_vm->_global->_pPaletteDesc); if (properties.sprite == Draw::kBackSurface) { - _vm->_draw->invalidateRect(properties.x, properties.y, - properties.x + video->decoder->getWidth(), - properties.y + video->decoder->getHeight()); + for (Common::List<Common::Rect>::const_iterator rect = dirtyRects.begin(); rect != dirtyRects.end(); ++rect) + _vm->_draw->invalidateRect(rect->left, rect->top, rect->right - 1, rect->bottom - 1); _vm->_draw->blitInvalidated(); // if (!noRetrace) _vm->_video->retrace(); } else if (properties.sprite == Draw::kFrontSurface) { - _vm->_video->dirtyRectsAdd(properties.x, properties.y, - properties.x + video->decoder->getWidth(), - properties.y + video->decoder->getHeight()); + for (Common::List<Common::Rect>::const_iterator rect = dirtyRects.begin(); rect != dirtyRects.end(); ++rect) + _vm->_video->dirtyRectsAdd(rect->left, rect->top, rect->right - 1, rect->bottom - 1); // if (!noRetrace) _vm->_video->retrace(); |