diff options
author | Paul Gilbert | 2012-06-22 23:47:39 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-06-22 23:47:39 +1000 |
commit | eef6b444df766b90d1323941c7ff9bd8355c111b (patch) | |
tree | 3e39c97bc44c48c0ccd162d10e327c552d55d4bf /engines/tony/window.cpp | |
parent | 17289089e6232d464d9eef15f510d66542fbbec5 (diff) | |
download | scummvm-rg350-eef6b444df766b90d1323941c7ff9bd8355c111b.tar.gz scummvm-rg350-eef6b444df766b90d1323941c7ff9bd8355c111b.tar.bz2 scummvm-rg350-eef6b444df766b90d1323941c7ff9bd8355c111b.zip |
TONY: Created a debugger command 'dirty_rects' to show dirty rect areas on-screen
Diffstat (limited to 'engines/tony/window.cpp')
-rw-r--r-- | engines/tony/window.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/engines/tony/window.cpp b/engines/tony/window.cpp index bf0094ff2a..a35e765b6c 100644 --- a/engines/tony/window.cpp +++ b/engines/tony/window.cpp @@ -27,6 +27,7 @@ */ #include "common/scummsys.h" +#include "graphics/surface.h" #include "util.h" #include "tony/window.h" #include "tony/game.h" @@ -40,6 +41,7 @@ namespace Tony { \****************************************************************************/ RMWindow::RMWindow() { + _showDirtyRects = false; } RMWindow::~RMWindow() { @@ -126,11 +128,25 @@ void RMWindow::getNewFrame(RMGfxTargetBuffer &bigBuf, Common::Rect *rcBoundEllip Common::List<Common::Rect> dirtyRects = bigBuf.getDirtyRects(); Common::List<Common::Rect>::iterator i; + // If showing dirty rects, copy the entire screen background and set up a surface pointer + Graphics::Surface *s = NULL; + if (_showDirtyRects) { + g_system->copyRectToScreen(lpBuf, RM_SX * 2, 0, 0, RM_SX, RM_SY); + s = g_system->lockScreen(); + } + 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 (_showDirtyRects) + // Frame the copied area with a rectangle + s->frameRect(r, 0xffffff); } + + if (_showDirtyRects) + g_system->unlockScreen(); } if (_bGrabThumbnail) { |