diff options
author | Paul Gilbert | 2014-02-02 20:28:24 -0500 |
---|---|---|
committer | Paul Gilbert | 2014-02-02 20:28:24 -0500 |
commit | f88985dc649b81e13490d7f3f949838a9b6680c9 (patch) | |
tree | c4af9cb8f0e55f19ad8c1e9dc66e2e8751735750 /engines/voyeur/events.cpp | |
parent | ff68d8f89a8d992e51f52549673d4943e0fb998e (diff) | |
download | scummvm-rg350-f88985dc649b81e13490d7f3f949838a9b6680c9.tar.gz scummvm-rg350-f88985dc649b81e13490d7f3f949838a9b6680c9.tar.bz2 scummvm-rg350-f88985dc649b81e13490d7f3f949838a9b6680c9.zip |
VOYEUR: Added debugger command to show mouse position
Diffstat (limited to 'engines/voyeur/events.cpp')
-rw-r--r-- | engines/voyeur/events.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp index 4734b1efa3..ded81f7992 100644 --- a/engines/voyeur/events.cpp +++ b/engines/voyeur/events.cpp @@ -25,6 +25,8 @@ #include "voyeur/staticres.h" #include "common/events.h" #include "graphics/cursorman.h" +#include "graphics/font.h" +#include "graphics/fontman.h" #include "graphics/palette.h" namespace Voyeur { @@ -158,6 +160,10 @@ void EventsManager::checkForNextFrameCounter() { // Give time to the debugger _vm->_debugger.onFrame(); + // If mouse position display is on, display the position + if (_vm->_debugger._showMousePosition) + showMousePosition(); + // Display the frame g_system->copyRectToScreen((byte *)_vm->_graphicsManager._screenSurface.getPixels(), SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); @@ -168,6 +174,23 @@ void EventsManager::checkForNextFrameCounter() { } } +void EventsManager::showMousePosition() { + const Graphics::Font &font(*FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont)); + Common::String mousePos = Common::String::format("(%d,%d)", _mousePos.x, _mousePos.y); + if (_vm->_voyeurArea == AREA_INTERFACE) { + Common::Point pt = _mousePos + _vm->_mansionViewPos - Common::Point(40, 27); + if (pt.x < 0) pt.x = 0; + if (pt.y < 0) pt.y = 0; + + mousePos += Common::String::format(" - (%d,%d)", pt.x, pt.y); + } + + _vm->_graphicsManager._screenSurface.fillRect( + Common::Rect(0, 0, 110, font.getFontHeight()), 0); + font.drawString(&_vm->_graphicsManager._screenSurface, mousePos, + 0, 0, 110, 63); +} + void EventsManager::voyeurTimer() { _gameData.field22 += _gameData.field24; _gameData.field1A += _gameData.field1E; |