From 4f077f2b5a747dc2794060bf486c79b6d7eb0030 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 18 Oct 2018 23:40:35 +0100 Subject: HOPKINS: Add Graphics Screen Update Debugging Code. This is mainly to aid investigation of bug Trac #6310. --- engines/hopkins/graphics.cpp | 5 +++++ engines/hopkins/hopkins.cpp | 1 + engines/hopkins/hopkins.h | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'engines/hopkins') diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index 3cdf6add8f..86a25c5ea4 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -676,6 +676,7 @@ void GraphicsManager::updateScreen() { // Update the screen g_system->updateScreen(); + debugC(1, kDebugGraphics, "updateScreen()"); } void GraphicsManager::copyWinscanVbe3(const byte *srcData, byte *destSurface) { @@ -1141,10 +1142,12 @@ void GraphicsManager::displayDirtyRects() { } void GraphicsManager::displayRefreshRects() { + debugC(1, kDebugGraphics, "displayRefreshRects() start"); Graphics::Surface *screenSurface = NULL; if (_showDirtyRects) { screenSurface = g_system->lockScreen(); g_system->copyRectToScreen(_screenBuffer, _screenLineSize, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); + debugC(1, kDebugGraphics, "\tcopyRectToScreen(_screenBuffer, %d, %d, %d, %d, %d) - Full Blit", _screenLineSize, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); } // Loop through copying over any specified rects to the screen @@ -1153,6 +1156,7 @@ void GraphicsManager::displayRefreshRects() { byte *srcP = _screenBuffer + _screenLineSize * r.top + (r.left * 2); g_system->copyRectToScreen(srcP, _screenLineSize, r.left, r.top, r.width(), r.height()); + debugC(1, kDebugGraphics, "\tcopyRectToScreen(_screenBuffer[%d][%d], %d, %d, %d, %d, %d) - Rect Blit", (r.left * 2), (_screenLineSize * r.top), _screenLineSize, r.left, r.top, r.width(), r.height()); if (_showDirtyRects) screenSurface->frameRect(r, 0xffffff); @@ -1162,6 +1166,7 @@ void GraphicsManager::displayRefreshRects() { g_system->unlockScreen(); resetRefreshRects(); + debugC(1, kDebugGraphics, "displayRefreshRects() end"); } /** diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index dd64c0cc71..8f301fdc0f 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -38,6 +38,7 @@ namespace Hopkins { HopkinsEngine::HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc), _randomSource("Hopkins") { DebugMan.addDebugChannel(kDebugPath, "Path", "Pathfinding debug level"); + DebugMan.addDebugChannel(kDebugGraphics, "Graphics", "Graphics debug level"); _animMan = new AnimationManager(this); _computer = new ComputerManager(this); _dialog = new DialogsManager(this); diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h index 3528a98d58..ee2592e405 100644 --- a/engines/hopkins/hopkins.h +++ b/engines/hopkins/hopkins.h @@ -63,7 +63,8 @@ namespace Hopkins { #define SCREEN_HEIGHT 480 enum HopkinsDebugChannels { - kDebugPath = 1 << 0 + kDebugPath = 1 << 0, + kDebugGraphics = 1 << 1 }; /** -- cgit v1.2.3