diff options
author | Matthew Hoops | 2011-09-21 21:33:33 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-09-21 21:33:33 -0400 |
commit | 802fb1a97b04a1b6613dd00b700fb0a42b3eaef7 (patch) | |
tree | 08076dc3579a5782f1241482d224695f40c9601b /engines | |
parent | 0fd4a55492eb4c4cd77f2e3e160fd26b896f87c2 (diff) | |
download | scummvm-rg350-802fb1a97b04a1b6613dd00b700fb0a42b3eaef7.tar.gz scummvm-rg350-802fb1a97b04a1b6613dd00b700fb0a42b3eaef7.tar.bz2 scummvm-rg350-802fb1a97b04a1b6613dd00b700fb0a42b3eaef7.zip |
PEGASUS: Add very simple mouse movement update checking
Diffstat (limited to 'engines')
-rw-r--r-- | engines/pegasus/graphics.cpp | 11 | ||||
-rw-r--r-- | engines/pegasus/graphics.h | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/engines/pegasus/graphics.cpp b/engines/pegasus/graphics.cpp index 2891f216d5..a25dd673ef 100644 --- a/engines/pegasus/graphics.cpp +++ b/engines/pegasus/graphics.cpp @@ -23,6 +23,7 @@ * */ +#include "common/events.h" #include "common/file.h" #include "common/textconsole.h" #include "engines/util.h" @@ -49,6 +50,7 @@ GraphicsManager::GraphicsManager(PegasusEngine *vm) : _vm(vm) { _frontLayer = kMaxAvailableOrder; _firstDisplayElement = _lastDisplayElement = 0; _workArea.create(640, 480, _vm->_system->getScreenFormat()); + _lastMousePosition = Common::Point(-1, -1); } GraphicsManager::~GraphicsManager() { @@ -282,10 +284,15 @@ void GraphicsManager::removeDisplayElement(DisplayElement *oldElement) { } void GraphicsManager::updateDisplay() { - // TODO: Check for cursor move/change - bool screenDirty = false; + // TODO: Check for cursor change + Common::Point mousePos = g_system->getEventManager()->getMousePos(); + if (_lastMousePosition != mousePos) { + screenDirty = true; + _lastMousePosition = mousePos; + } + if (!_dirtyRect.isEmpty()) { for (DisplayElement *runner = _firstDisplayElement; runner != 0; runner = runner->_nextElement) { Common::Rect bounds; diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index d4f9628fa1..b72137bf1e 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -83,6 +83,7 @@ private: tDisplayOrder _backLayer, _frontLayer; DisplayElement *_firstDisplayElement, *_lastDisplayElement; Graphics::Surface _workArea; + Common::Point _lastMousePosition; }; } // End of namespace Pegasus |