aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-07 15:53:34 +0000
committerMartin Kiewitz2009-10-07 15:53:34 +0000
commitcb31d302b9600123e0748ddb655090899095a23b (patch)
treeec8e2b538a7606f1234e47489cd4d0f0654863d1 /engines/sci
parent1dfe7578cba4894630bd6fa093cfa1607fbdad6e (diff)
downloadscummvm-rg350-cb31d302b9600123e0748ddb655090899095a23b.tar.gz
scummvm-rg350-cb31d302b9600123e0748ddb655090899095a23b.tar.bz2
scummvm-rg350-cb31d302b9600123e0748ddb655090899095a23b.zip
SCI/newgui: implemented debug command show_map
svn-id: r44735
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/console.cpp18
-rw-r--r--engines/sci/gui/gui.cpp5
-rw-r--r--engines/sci/gui/gui.h2
-rw-r--r--engines/sci/gui/gui_screen.cpp22
-rw-r--r--engines/sci/gui/gui_screen.h5
-rw-r--r--engines/sci/gui32/gui32.cpp24
-rw-r--r--engines/sci/gui32/gui32.h2
7 files changed, 62 insertions, 16 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index f937cf9f6f..7f6043d1f9 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -1487,36 +1487,24 @@ bool Console::cmdShowMap(int argc, const char **argv) {
DebugPrintf("- 0: visual map (back buffer)\n");
DebugPrintf("- 1: priority map (back buffer)\n");
DebugPrintf("- 2: control map (static buffer)\n");
+ DebugPrintf("- 3: display screen (newgui only)\n");
return true;
}
- gfxop_set_clip_zone(_vm->_gamestate->gfx_state, gfx_rect_fullscreen);
-
int map = atoi(argv[1]);
switch (map) {
case 0:
- _vm->_gamestate->visual->add_dirty_abs((GfxContainer *)_vm->_gamestate->visual, gfx_rect(0, 0, 320, 200), 0);
- _vm->_gamestate->visual->draw(Common::Point(0, 0));
- break;
-
case 1:
- gfx_xlate_pixmap(_vm->_gamestate->gfx_state->pic->priority_map, _vm->_gamestate->gfx_state->driver->getMode());
- gfxop_draw_pixmap(_vm->_gamestate->gfx_state, _vm->_gamestate->gfx_state->pic->priority_map, gfx_rect(0, 0, 320, 200), Common::Point(0, 0));
- break;
-
case 2:
- gfx_xlate_pixmap(_vm->_gamestate->gfx_state->control_map, _vm->_gamestate->gfx_state->driver->getMode());
- gfxop_draw_pixmap(_vm->_gamestate->gfx_state, _vm->_gamestate->gfx_state->control_map, gfx_rect(0, 0, 320, 200), Common::Point(0, 0));
+ case 3:
+ return _vm->_gamestate->gui->debugShowMap(map);
break;
default:
DebugPrintf("Map %d is not available.\n", map);
return true;
}
-
- gfxop_update(_vm->_gamestate->gfx_state);
-
return false;
}
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index 25c61ae7fb..f04956cb48 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -497,4 +497,9 @@ void SciGui::moveCursor(Common::Point pos) {
// FIXME!
}
+bool SciGui::debugShowMap(int mapNo) {
+ _screen->debugShowMap(mapNo);
+ return false;
+}
+
} // End of namespace Sci
diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h
index fafc6a8a10..ba3f1fd9f4 100644
--- a/engines/sci/gui/gui.h
+++ b/engines/sci/gui/gui.h
@@ -90,6 +90,8 @@ public:
virtual void setCursorPos(Common::Point pos);
virtual void moveCursor(Common::Point pos);
+ virtual bool debugShowMap(int mapNo);
+
private:
EngineState *_s;
SciGuiScreen *_screen;
diff --git a/engines/sci/gui/gui_screen.cpp b/engines/sci/gui/gui_screen.cpp
index 1079b4c3f9..6f1b278739 100644
--- a/engines/sci/gui/gui_screen.cpp
+++ b/engines/sci/gui/gui_screen.cpp
@@ -51,6 +51,9 @@ SciGuiScreen::SciGuiScreen(int16 width, int16 height, int16 scaleFactor) :
_controlScreen = initScreen(_pixels);
_displayScreen = initScreen(_displayPixels);
+ // Sets display screen to be actually displayed
+ _activeScreen = _displayScreen;
+
for (i = 0; i < _height; i++) {
_baseTable[i] = base; _baseDisplayTable[i] = base;
base += _width;
@@ -73,7 +76,7 @@ byte *SciGuiScreen::initScreen(uint16 pixelCount) {
}
void SciGuiScreen::copyToScreen() {
- g_system->copyRectToScreen(_displayScreen, _displayWidth, 0, 0, _displayWidth, _displayHeight);
+ g_system->copyRectToScreen(_activeScreen, _displayWidth, 0, 0, _displayWidth, _displayHeight);
}
byte SciGuiScreen::getDrawingMask(byte color, byte prio, byte control) {
@@ -237,4 +240,21 @@ void SciGuiScreen::dither() {
}
}
+void SciGuiScreen::debugShowMap(int mapNo) {
+ switch (mapNo) {
+ case 0:
+ _activeScreen = _visualScreen;
+ break;
+ case 1:
+ _activeScreen = _priorityScreen;
+ break;
+ case 2:
+ _activeScreen = _controlScreen;
+ break;
+ case 3:
+ _activeScreen = _displayScreen;
+ break;
+ }
+}
+
} // End of namespace Sci
diff --git a/engines/sci/gui/gui_screen.h b/engines/sci/gui/gui_screen.h
index c3f2be95b8..0ce0f0f13c 100644
--- a/engines/sci/gui/gui_screen.h
+++ b/engines/sci/gui/gui_screen.h
@@ -63,6 +63,8 @@ public:
void dither();
+ void debugShowMap(int mapNo);
+
uint16 _width;
uint16 _height;
uint _pixels;
@@ -89,6 +91,9 @@ public: // HACK. TODO: make private
// this screen is the one that is actually displayed to the user. It may be 640x480 for japanese SCI1 games
// SCI0 games may be undithered in here. Only read from this buffer for Save/ShowBits usage.
byte *_displayScreen;
+
+ // this is a pointer to the currently active screen (changing it only required for debug purposes)
+ byte *_activeScreen;
};
} // End of namespace Sci
diff --git a/engines/sci/gui32/gui32.cpp b/engines/sci/gui32/gui32.cpp
index 4fdffe3267..af0ddebd2c 100644
--- a/engines/sci/gui32/gui32.cpp
+++ b/engines/sci/gui32/gui32.cpp
@@ -2048,4 +2048,28 @@ void SciGui32::moveCursor(Common::Point pos) {
gfxop_get_event(s->gfx_state, SCI_EVT_PEEK);
}
+bool SciGui32::debugShowMap(int mapNo) {
+ gfxop_set_clip_zone(s->gfx_state, gfx_rect_fullscreen);
+
+ switch (mapNo) {
+ case 0:
+ s->visual->add_dirty_abs((GfxContainer *)s->visual, gfx_rect(0, 0, 320, 200), 0);
+ s->visual->draw(Common::Point(0, 0));
+ break;
+
+ case 1:
+ gfx_xlate_pixmap(s->gfx_state->pic->priority_map, s->gfx_state->driver->getMode());
+ gfxop_draw_pixmap(s->gfx_state, s->gfx_state->pic->priority_map, gfx_rect(0, 0, 320, 200), Common::Point(0, 0));
+ break;
+
+ case 2:
+ gfx_xlate_pixmap(s->gfx_state->control_map, s->gfx_state->driver->getMode());
+ gfxop_draw_pixmap(s->gfx_state, s->gfx_state->control_map, gfx_rect(0, 0, 320, 200), Common::Point(0, 0));
+ break;
+ }
+
+ gfxop_update(s->gfx_state);
+ return false;
+}
+
} // End of namespace Sci
diff --git a/engines/sci/gui32/gui32.h b/engines/sci/gui32/gui32.h
index d9d5909b98..c2fa45da8a 100644
--- a/engines/sci/gui32/gui32.h
+++ b/engines/sci/gui32/gui32.h
@@ -83,6 +83,8 @@ public:
void setCursorPos(Common::Point pos);
void moveCursor(Common::Point pos);
+ bool debugShowMap(int mapNo);
+
private:
EngineState *s;
bool _usesOldGfxFunctions;