aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2011-07-15 19:38:58 +1000
committerPaul Gilbert2011-07-15 19:38:58 +1000
commitc3bed46ba06046c8ba76c12c42d016f63beb6331 (patch)
tree30a729b0884d1108b08dc15c25f74332f9531e27
parentf0d10b62b37b7d3e35ebcd989745a2d0a9570a21 (diff)
downloadscummvm-rg350-c3bed46ba06046c8ba76c12c42d016f63beb6331.tar.gz
scummvm-rg350-c3bed46ba06046c8ba76c12c42d016f63beb6331.tar.bz2
scummvm-rg350-c3bed46ba06046c8ba76c12c42d016f63beb6331.zip
CGE: Fix for all the game objects being draggable
-rw-r--r--engines/cge/events.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/engines/cge/events.cpp b/engines/cge/events.cpp
index 9c1741189f..73018aa2ea 100644
--- a/engines/cge/events.cpp
+++ b/engines/cge/events.cpp
@@ -296,8 +296,11 @@ void EventManager::handleEvents() {
_mouse->_hold = e._ptr;
if (_mouse->_hold) {
_mouse->_hold->_flags._hold = true;
- _mouse->_hx = e._x - _mouse->_hold->_x;
- _mouse->_hy = e._y - _mouse->_hold->_y;
+
+ if (_mouse->_hold->_flags._drag) {
+ _mouse->_hx = e._x - _mouse->_hold->_x;
+ _mouse->_hy = e._y - _mouse->_hold->_y;
+ }
}
}
@@ -315,8 +318,10 @@ void EventManager::handleEvents() {
}
EvtTail = (EvtTail + 1) % EVT_MAX;
}
- if (_mouse->_hold)
- _mouse->_hold->gotoxy(_mouse->_x - _mouse->_hx, _mouse->_y - _mouse->_hy);
+ if (_mouse->_hold) {
+ if (_mouse->_hold->_flags._drag)
+ _mouse->_hold->gotoxy(_mouse->_x - _mouse->_hx, _mouse->_y - _mouse->_hy);
+ }
}
void EventManager::clrEvt(Sprite *spr) {