[Scummvm-cvs-logs] SF.net SVN: scummvm:[33877] scummvm/trunk/engines/cine
buddha_ at users.sourceforge.net
buddha_ at users.sourceforge.net
Fri Aug 15 00:01:57 CEST 2008
Revision: 33877
http://scummvm.svn.sourceforge.net/scummvm/?rev=33877&view=rev
Author: buddha_
Date: 2008-08-14 22:01:56 +0000 (Thu, 14 Aug 2008)
Log Message:
-----------
Moved showing of the collision page from Alt-key to F11-key because Alt conflicted with taking screenshots using Alt-s. Great. Hopefully F11 doesn't conflict with anything useful.
Modified Paths:
--------------
scummvm/trunk/engines/cine/gfx.cpp
scummvm/trunk/engines/cine/gfx.h
scummvm/trunk/engines/cine/main_loop.cpp
Modified: scummvm/trunk/engines/cine/gfx.cpp
===================================================================
--- scummvm/trunk/engines/cine/gfx.cpp 2008-08-14 21:39:53 UTC (rev 33876)
+++ scummvm/trunk/engines/cine/gfx.cpp 2008-08-14 22:01:56 UTC (rev 33877)
@@ -92,7 +92,7 @@
*/
FWRenderer::FWRenderer() : _background(NULL), _palette(NULL), _cmd(""),
_cmdY(0), _messageBg(0), _backBuffer(new byte[_screenSize]),
- _activeLowPal(NULL), _changePal(0) {
+ _activeLowPal(NULL), _changePal(0), _showCollisionPage(false) {
assert(_backBuffer);
@@ -126,6 +126,7 @@
_cmdY = 0;
_messageBg = 0;
_changePal = 0;
+ _showCollisionPage = false;
}
/*! \brief Draw 1bpp sprite using selected color
@@ -512,16 +513,22 @@
blit();
}
+/*!
+ * \brief Turn on or off the showing of the collision page.
+ * If turned on the blitting routine shows the collision page instead of the back buffer.
+ * \note Useful for debugging collision page related problems.
+ */
+void FWRenderer::showCollisionPage(bool state) {
+ _showCollisionPage = state;
+}
+
/*! \brief Update screen
*/
void FWRenderer::blit() {
- if (g_system->getEventManager()->getModifierState() & Common::KBD_ALT) {
- // Show collision page if the Alt key is being pressed
- g_system->copyRectToScreen(collisionPage, 320, 0, 0, 320, 200);
- } else {
- // Normally show the back buffer
- g_system->copyRectToScreen(_backBuffer, 320, 0, 0, 320, 200);
- }
+ // Show the back buffer or the collision page. Normally the back
+ // buffer but showing the collision page is useful for debugging.
+ byte *source = (_showCollisionPage ? collisionPage : _backBuffer);
+ g_system->copyRectToScreen(source, 320, 0, 0, 320, 200);
}
/*! \brief Set player command string
Modified: scummvm/trunk/engines/cine/gfx.h
===================================================================
--- scummvm/trunk/engines/cine/gfx.h 2008-08-14 21:39:53 UTC (rev 33876)
+++ scummvm/trunk/engines/cine/gfx.h 2008-08-14 22:01:56 UTC (rev 33877)
@@ -62,6 +62,7 @@
byte *_backBuffer; ///< Screen backbuffer
uint16 *_activeLowPal; ///< Active 16 color palette
int _changePal; ///< Load active palette to video backend on next frame
+ bool _showCollisionPage; ///< Should we show the collision page instead of the back buffer? Used for debugging.
void fillSprite(const objectStruct &obj, uint8 color = 0);
void drawMaskedSprite(const objectStruct &obj, const byte *mask);
@@ -124,6 +125,7 @@
void drawInputBox(const char *info, const char *input, int cursor, int x, int y, int width);
virtual void fadeToBlack();
+ void showCollisionPage(bool state);
};
/*! \brief Operation Stealth renderer
Modified: scummvm/trunk/engines/cine/main_loop.cpp
===================================================================
--- scummvm/trunk/engines/cine/main_loop.cpp 2008-08-14 21:39:53 UTC (rev 33876)
+++ scummvm/trunk/engines/cine/main_loop.cpp 2008-08-14 22:01:56 UTC (rev 33877)
@@ -125,6 +125,9 @@
g_cine->makeSystemMenu();
}
break;
+ case Common::KEYCODE_F11:
+ renderer->showCollisionPage(true);
+ break;
case Common::KEYCODE_MINUS:
case Common::KEYCODE_KP_MINUS:
g_cine->modifyGameSpeed(-1); // Slower
@@ -168,6 +171,9 @@
break;
case Common::EVENT_KEYUP:
switch (event.kbd.keycode) {
+ case Common::KEYCODE_F11:
+ renderer->showCollisionPage(false);
+ break;
case Common::KEYCODE_KP5: // Emulated left mouse button click
case Common::KEYCODE_LEFT: // Left
case Common::KEYCODE_KP4: // Left
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