From eef6b444df766b90d1323941c7ff9bd8355c111b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 22 Jun 2012 23:47:39 +1000 Subject: TONY: Created a debugger command 'dirty_rects' to show dirty rect areas on-screen --- engines/tony/window.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'engines/tony/window.cpp') 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 dirtyRects = bigBuf.getDirtyRects(); Common::List::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) { -- cgit v1.2.3