aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-11-05 22:40:52 -0500
committerPaul Gilbert2014-12-12 22:23:19 -0500
commitb0653e1c924650c86edd220a37786c82faaeb11e (patch)
treeefee97823f64083a7778801c0ba0abf527affcba
parent6ceda069c7042bc081845d3a52f99e21a58c43d8 (diff)
downloadscummvm-rg350-b0653e1c924650c86edd220a37786c82faaeb11e.tar.gz
scummvm-rg350-b0653e1c924650c86edd220a37786c82faaeb11e.tar.bz2
scummvm-rg350-b0653e1c924650c86edd220a37786c82faaeb11e.zip
ACCESS: Fix redrawing during inventory item dragging
-rw-r--r--engines/access/inventory.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/engines/access/inventory.cpp b/engines/access/inventory.cpp
index f31379a2fa..86e73c1cec 100644
--- a/engines/access/inventory.cpp
+++ b/engines/access/inventory.cpp
@@ -394,7 +394,7 @@ void InventoryManager::combineItems() {
int invItem = _items[_boxNum];
events.pollEvents();
- // Item drag handling loop
+ // Item drag handling loop if left button is held down
while (!_vm->shouldQuit() && events._leftButton) {
// Poll for events
events.pollEvents();
@@ -408,9 +408,12 @@ void InventoryManager::combineItems() {
Common::Rect lastRect(lastBox.x, lastBox.y, lastBox.x + 46, lastBox.y + 35);
screen.copyBlock(&_vm->_buffer2, lastRect);
- int xp = MAX(events._mousePos.x - tempMouse.x + tempBox.x, 0);
- int yp = MAX(events._mousePos.y - tempMouse.y + tempBox.y, 0);
- screen.plotImage(sprites, invItem, Common::Point(xp, yp));
+ Common::Point newPt;
+ newPt.x = MAX(events._mousePos.x - tempMouse.x + tempBox.x, 0);
+ newPt.y = MAX(events._mousePos.y - tempMouse.y + tempBox.y, 0);
+
+ screen.plotImage(sprites, invItem, newPt);
+ lastBox = newPt;
}
int destBox = events.checkMouseBox1(_invCoords);