aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus/graphics.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-09-21 21:33:33 -0400
committerMatthew Hoops2011-09-21 21:33:33 -0400
commit802fb1a97b04a1b6613dd00b700fb0a42b3eaef7 (patch)
tree08076dc3579a5782f1241482d224695f40c9601b /engines/pegasus/graphics.cpp
parent0fd4a55492eb4c4cd77f2e3e160fd26b896f87c2 (diff)
downloadscummvm-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/pegasus/graphics.cpp')
-rw-r--r--engines/pegasus/graphics.cpp11
1 files changed, 9 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;