From a612b0a173eefc80d635a2711cd9f20e4601839d Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 9 May 2014 23:16:02 +0300 Subject: [PATCH] GRAPHICS: Restore layout debugging capabilities --- gui/ThemeEngine.cpp | 9 ++++++++- gui/ThemeLayout.cpp | 2 +- gui/ThemeLayout.h | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index aec5c79dabb..90cb612e19e 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -1265,8 +1265,15 @@ void ThemeEngine::updateScreen(bool render) { _screenQueue.clear(); } - if (render) + if (render) { +#ifdef LAYOUT_DEBUG_DIALOG + _vectorRenderer->fillSurface(); + _themeEval->debugDraw(&_screen, _font); + _vectorRenderer->copyWholeFrame(_system); +#else renderDirtyScreen(); +#endif + } } void ThemeEngine::addDirtyRect(Common::Rect r) { diff --git a/gui/ThemeLayout.cpp b/gui/ThemeLayout.cpp index 6a6fd9e3433..71e4b2c9fdf 100644 --- a/gui/ThemeLayout.cpp +++ b/gui/ThemeLayout.cpp @@ -123,7 +123,7 @@ int16 ThemeLayoutStacked::getParentHeight() { #ifdef LAYOUT_DEBUG_DIALOG void ThemeLayout::debugDraw(Graphics::Surface *screen, const Graphics::Font *font) { - uint16 color = 0xFFFF; + uint32 color = 0xFFFFFFFF; font->drawString(screen, getName(), _x, _y, _w, color, Graphics::kTextAlignRight, 0, true); screen->hLine(_x, _y, _x + _w, color); screen->hLine(_x, _y + _h, _x + _w , color); diff --git a/gui/ThemeLayout.h b/gui/ThemeLayout.h index ba28fae1aca..c4d7e672ddc 100644 --- a/gui/ThemeLayout.h +++ b/gui/ThemeLayout.h @@ -29,7 +29,7 @@ #ifdef LAYOUT_DEBUG_DIALOG namespace Graphics { -class Surface; +struct Surface; } #endif