diff options
author | Paul Gilbert | 2012-06-16 10:57:35 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-06-16 10:57:35 +1000 |
commit | cdbc4aa28b5c47392369879b209f9635ff431195 (patch) | |
tree | 8d0dd62dc57a33073ec660ab4bdb42e4cf658c0c /engines/tony/window.cpp | |
parent | 42a322d671a27406a9dd993f82675dda0ee4780b (diff) | |
download | scummvm-rg350-cdbc4aa28b5c47392369879b209f9635ff431195.tar.gz scummvm-rg350-cdbc4aa28b5c47392369879b209f9635ff431195.tar.bz2 scummvm-rg350-cdbc4aa28b5c47392369879b209f9635ff431195.zip |
TONY: Initial commit of in progress dirty rect handling
Diffstat (limited to 'engines/tony/window.cpp')
-rw-r--r-- | engines/tony/window.cpp | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/engines/tony/window.cpp b/engines/tony/window.cpp index db21be0ded..bf0094ff2a 100644 --- a/engines/tony/window.cpp +++ b/engines/tony/window.cpp @@ -40,7 +40,6 @@ namespace Tony { \****************************************************************************/ RMWindow::RMWindow() { - } RMWindow::~RMWindow() { @@ -61,6 +60,7 @@ void RMWindow::init() { _bGrabScreenshot = false; _bGrabThumbnail = false; _bGrabMovie = false; + _wiping = false; } /** @@ -108,13 +108,29 @@ void RMWindow::wipeEffect(Common::Rect &rcBoundEllipse) { } } -void RMWindow::getNewFrame(byte *lpBuf, Common::Rect *rcBoundEllipse) { +void RMWindow::getNewFrame(RMGfxTargetBuffer &bigBuf, Common::Rect *rcBoundEllipse) { + // Get a pointer to the bytes of the source buffer + byte *lpBuf = bigBuf; + if (rcBoundEllipse != NULL) { // Circular wipe effect getNewFrameWipe(lpBuf, *rcBoundEllipse); - } else { - // Standard screen copy + _wiping = true; + } else if (_wiping) { + // Just finished a wiping effect, so copy the full screen g_system->copyRectToScreen(lpBuf, RM_SX * 2, 0, 0, RM_SX, RM_SY); + _wiping = false; + + } else { + // Standard screen copy - iterate through the dirty rects + Common::List<Common::Rect> dirtyRects = bigBuf.getDirtyRects(); + Common::List<Common::Rect>::iterator i; + + for (i = dirtyRects.begin(); i != dirtyRects.end(); ++i) { + Common::Rect &r = *i; + const byte *lpSrc = lpBuf + (RM_SX * 2) * r.top + (r.left * 2); + g_system->copyRectToScreen(lpSrc, RM_SX * 2, r.left, r.top, r.width(), r.height()); + } } if (_bGrabThumbnail) { @@ -124,6 +140,9 @@ void RMWindow::getNewFrame(byte *lpBuf, Common::Rect *rcBoundEllipse) { s.grabScreenshot(lpBuf, 4, _wThumbBuf); _bGrabThumbnail = false; } + + // Clear the dirty rect list + bigBuf.clearDirtyRects(); } /** @@ -214,10 +233,7 @@ void RMSnapshot::grabScreenshot(byte *lpBuf, int dezoom, uint16 *lpDestBuf) { int dimx = RM_SX / dezoom; int dimy = RM_SY / dezoom; - int u, v, curv; - uint32 k = 0; - int sommar, sommab, sommag; uint16 *cursrc; if (lpDestBuf == NULL) @@ -247,10 +263,11 @@ void RMSnapshot::grabScreenshot(byte *lpBuf, int dezoom, uint16 *lpDestBuf) { for (int y = 0; y < dimy; y++) { for (int x = 0; x < dimx; x++) { cursrc = &src[RM_SKIPX + x * dezoom]; + int sommar, sommab, sommag, curv; sommar = sommab = sommag = 0; - for (v = 0; v < dezoom; v++) { - for (u = 0; u < dezoom; u++) { + for (int v = 0; v < dezoom; v++) { + for (int u = 0; u < dezoom; u++) { if (lpDestBuf == NULL) curv = -v; else |