diff options
author | Paul Gilbert | 2014-12-14 10:17:47 -0500 |
---|---|---|
committer | Paul Gilbert | 2014-12-14 10:17:47 -0500 |
commit | 2cdd05306c4c4c405a7405f1d0e5d491ec886c1d (patch) | |
tree | ec8378ea039cd2ab7366870f467f4da957c1170e | |
parent | 310853a285d5d648f1695cc3a40a165223b2928a (diff) | |
download | scummvm-rg350-2cdd05306c4c4c405a7405f1d0e5d491ec886c1d.tar.gz scummvm-rg350-2cdd05306c4c4c405a7405f1d0e5d491ec886c1d.tar.bz2 scummvm-rg350-2cdd05306c4c4c405a7405f1d0e5d491ec886c1d.zip |
ACCESS: Dirty rect handling for conversation videos
-rw-r--r-- | engines/access/screen.cpp | 3 | ||||
-rw-r--r-- | engines/access/video.cpp | 10 | ||||
-rw-r--r-- | engines/access/video.h | 1 |
3 files changed, 12 insertions, 2 deletions
diff --git a/engines/access/screen.cpp b/engines/access/screen.cpp index 14ead2e266..2276fcc963 100644 --- a/engines/access/screen.cpp +++ b/engines/access/screen.cpp @@ -251,7 +251,8 @@ void Screen::copyBlock(ASurface *src, const Common::Rect &bounds) { } void Screen::restoreBlock() { - addDirtyRect(_savedBounds); + if (!_savedBounds.isEmpty()) + addDirtyRect(_savedBounds); ASurface::restoreBlock(); } diff --git a/engines/access/video.cpp b/engines/access/video.cpp index abe833ce42..eb50083de5 100644 --- a/engines/access/video.cpp +++ b/engines/access/video.cpp @@ -60,6 +60,7 @@ void VideoPlayer::setVideo(ASurface *vidSurface, const Common::Point &pt, const _xCount = _header._width; _scanCount = _header._height; _videoFrame = 0; + _videoBounds = Common::Rect(pt.x, pt.y, pt.x + _header._width, pt.y + _header._height); getFrame(); @@ -133,6 +134,10 @@ void VideoPlayer::playVideo() { } } + // If the video is playing on the screen surface, add a dirty rect + if (_vidSurface == _vm->_screen) + _vm->_screen->addDirtyRect(_videoBounds); + getFrame(); if (++_videoFrame == _frameCount) { closeVideo(); @@ -142,14 +147,16 @@ void VideoPlayer::playVideo() { void VideoPlayer::copyVideo() { _vm->_player->calcPlayer(); + + // Figure out the dirty rect area for the video frame Common::Rect r = Common::Rect(_vm->_vidX - _vm->_screen->_bufferStart.x, _vm->_vidY - _vm->_screen->_bufferStart.y, _vm->_vidX - _vm->_screen->_bufferStart.x + _header._width, _vm->_vidY - _vm->_screen->_bufferStart.y + _header._height); if (!_vm->_screen->clip(r)) return; - _vm->_newRects.push_back(r); + int vh = _header._height; int vw = _header._width; int destIdx = _vm->_vidX - _vm->_screen->_bufferStart.x; @@ -165,4 +172,5 @@ void VideoPlayer::copyVideo() { destP += _vm->_buffer2.pitch; } } + } // End of namespace Access diff --git a/engines/access/video.h b/engines/access/video.h index f4be76de31..65d6ad61a7 100644 --- a/engines/access/video.h +++ b/engines/access/video.h @@ -48,6 +48,7 @@ private: int _xCount; int _scanCount; int _frameSize; + Common::Rect _videoBounds; void getFrame(); public: |