[Scummvm-cvs-logs] SF.net SVN: scummvm:[44735] scummvm/trunk/engines/sci
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Wed Oct 7 17:53:35 CEST 2009
Revision: 44735
http://scummvm.svn.sourceforge.net/scummvm/?rev=44735&view=rev
Author: m_kiewitz
Date: 2009-10-07 15:53:34 +0000 (Wed, 07 Oct 2009)
Log Message:
-----------
SCI/newgui: implemented debug command show_map
Modified Paths:
--------------
scummvm/trunk/engines/sci/console.cpp
scummvm/trunk/engines/sci/gui/gui.cpp
scummvm/trunk/engines/sci/gui/gui.h
scummvm/trunk/engines/sci/gui/gui_screen.cpp
scummvm/trunk/engines/sci/gui/gui_screen.h
scummvm/trunk/engines/sci/gui32/gui32.cpp
scummvm/trunk/engines/sci/gui32/gui32.h
Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp 2009-10-07 14:53:15 UTC (rev 44734)
+++ scummvm/trunk/engines/sci/console.cpp 2009-10-07 15:53:34 UTC (rev 44735)
@@ -1487,36 +1487,24 @@
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;
}
Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp 2009-10-07 14:53:15 UTC (rev 44734)
+++ scummvm/trunk/engines/sci/gui/gui.cpp 2009-10-07 15:53:34 UTC (rev 44735)
@@ -497,4 +497,9 @@
// FIXME!
}
+bool SciGui::debugShowMap(int mapNo) {
+ _screen->debugShowMap(mapNo);
+ return false;
+}
+
} // End of namespace Sci
Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h 2009-10-07 14:53:15 UTC (rev 44734)
+++ scummvm/trunk/engines/sci/gui/gui.h 2009-10-07 15:53:34 UTC (rev 44735)
@@ -90,6 +90,8 @@
virtual void setCursorPos(Common::Point pos);
virtual void moveCursor(Common::Point pos);
+ virtual bool debugShowMap(int mapNo);
+
private:
EngineState *_s;
SciGuiScreen *_screen;
Modified: scummvm/trunk/engines/sci/gui/gui_screen.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_screen.cpp 2009-10-07 14:53:15 UTC (rev 44734)
+++ scummvm/trunk/engines/sci/gui/gui_screen.cpp 2009-10-07 15:53:34 UTC (rev 44735)
@@ -51,6 +51,9 @@
_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 @@
}
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::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
Modified: scummvm/trunk/engines/sci/gui/gui_screen.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_screen.h 2009-10-07 14:53:15 UTC (rev 44734)
+++ scummvm/trunk/engines/sci/gui/gui_screen.h 2009-10-07 15:53:34 UTC (rev 44735)
@@ -63,6 +63,8 @@
void dither();
+ void debugShowMap(int mapNo);
+
uint16 _width;
uint16 _height;
uint _pixels;
@@ -89,6 +91,9 @@
// 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
Modified: scummvm/trunk/engines/sci/gui32/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.cpp 2009-10-07 14:53:15 UTC (rev 44734)
+++ scummvm/trunk/engines/sci/gui32/gui32.cpp 2009-10-07 15:53:34 UTC (rev 44735)
@@ -2048,4 +2048,28 @@
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
Modified: scummvm/trunk/engines/sci/gui32/gui32.h
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.h 2009-10-07 14:53:15 UTC (rev 44734)
+++ scummvm/trunk/engines/sci/gui32/gui32.h 2009-10-07 15:53:34 UTC (rev 44735)
@@ -83,6 +83,8 @@
void setCursorPos(Common::Point pos);
void moveCursor(Common::Point pos);
+ bool debugShowMap(int mapNo);
+
private:
EngineState *s;
bool _usesOldGfxFunctions;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list