aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins/graphics.cpp
diff options
context:
space:
mode:
authorsylvaintv2013-05-13 00:04:55 +0200
committersylvaintv2013-05-13 00:04:55 +0200
commitd6d3c6a13c2c830029872040a76783d84166c238 (patch)
tree1a9f499c90439239895f97369060f62f341546fe /engines/hopkins/graphics.cpp
parent1f509f13b238789499a869e5a0946b26f53c630b (diff)
downloadscummvm-rg350-d6d3c6a13c2c830029872040a76783d84166c238.tar.gz
scummvm-rg350-d6d3c6a13c2c830029872040a76783d84166c238.tar.bz2
scummvm-rg350-d6d3c6a13c2c830029872040a76783d84166c238.zip
HOPKINS : Added a lines debugger command
Diffstat (limited to 'engines/hopkins/graphics.cpp')
-rw-r--r--engines/hopkins/graphics.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index 636bdb40ce..ebc5cfa8da 100644
--- a/engines/hopkins/graphics.cpp
+++ b/engines/hopkins/graphics.cpp
@@ -74,6 +74,7 @@ GraphicsManager::GraphicsManager(HopkinsEngine *vm) {
_width = 0;
_specialWidth = 0;
_showZones = false;
+ _showLines = false;
Common::fill(&_paletteBuffer[0], &_paletteBuffer[PALETTE_SIZE * 2], 0);
Common::fill(&_colorTable[0], &_colorTable[PALETTE_EXT_BLOCK_SIZE], 0);
@@ -672,6 +673,9 @@ void GraphicsManager::updateScreen() {
if (_showZones)
displayZones();
+ if (_showLines)
+ displayLines();
+
// Update the screen
g_system->updateScreen();
}
@@ -1192,6 +1196,31 @@ void GraphicsManager::displayZones() {
g_system->unlockScreen();
}
+/**
+ * Display any zones for the current room
+ */
+void GraphicsManager::displayLines() {
+ Graphics::Surface *screenSurface = g_system->lockScreen();
+
+ uint16* pixels = (uint16*)screenSurface->pixels;
+
+ for (int lineIndex = 0; lineIndex < _vm->_linesMan->_linesNumb; lineIndex++) {
+ int i = 0;
+ do {
+ int x = _vm->_linesMan->_lineItem[lineIndex]._lineData[i] - _scrollPosX;
+ int y = _vm->_linesMan->_lineItem[lineIndex]._lineData[i+1];
+ if (x >= 0 && x < SCREEN_WIDTH && y >= 0 && y < SCREEN_HEIGHT) {
+ pixels[ y * screenSurface->w + x ] = 0xffff;
+ }
+ i += 2;
+ }
+ while(_vm->_linesMan->_lineItem[lineIndex]._lineData[i] != -1);
+ }
+
+ g_system->unlockScreen();
+}
+
+
void GraphicsManager::displayDebugRect(Graphics::Surface *surface, const Common::Rect &srcRect, uint32 color) {
Common::Rect r = srcRect;