diff options
author | Paul Gilbert | 2014-11-06 22:33:56 -0500 |
---|---|---|
committer | Paul Gilbert | 2014-12-12 22:23:40 -0500 |
commit | 0a8b8d9e94bea66834c102edeeb8b6c5374423ed (patch) | |
tree | 4eb28d1e3b577398f12baab872d7767bff79d23c /engines | |
parent | b5ad2b9db52e4184829c02830a9d2b22b6f85dde (diff) | |
download | scummvm-rg350-0a8b8d9e94bea66834c102edeeb8b6c5374423ed.tar.gz scummvm-rg350-0a8b8d9e94bea66834c102edeeb8b6c5374423ed.tar.bz2 scummvm-rg350-0a8b8d9e94bea66834c102edeeb8b6c5374423ed.zip |
ACCESS: Fix inventory item combining zoom logic
Diffstat (limited to 'engines')
-rw-r--r-- | engines/access/inventory.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/engines/access/inventory.cpp b/engines/access/inventory.cpp index 2dc73a2864..1b81b6badf 100644 --- a/engines/access/inventory.cpp +++ b/engines/access/inventory.cpp @@ -432,16 +432,19 @@ void InventoryManager::combineItems() { _items[_boxNum] = -1; _items[destBox] = combinedItem; _tempLOff[destBox] = _inv[combinedItem]._name; - - // Zoom out the old two items and zoom in the new combined item events.hideCursor(); + + // Shrink down the first item on top of the second item zoomIcon(itemA, itemB, destBox, true); + + // Shrink down the second item Common::Rect destRect(_invCoords[destBox].left, _invCoords[destBox].top, _invCoords[destBox].left + 46, _invCoords[destBox].top + 35); _vm->_buffer2.copyBlock(&_vm->_buffer1, destRect); - screen._screenYOff = 0; - + screen._screenYOff = 0; zoomIcon(itemB, -1, destBox, true); + + // Exand up the new combined item from nothing to full size zoomIcon(combinedItem, -1, destBox, false); _boxNum = destBox; @@ -459,12 +462,13 @@ void InventoryManager::zoomIcon(int zoomItem, int backItem, int zoomBox, bool sh screen._screenYOff = 0; SpriteResource *sprites = _vm->_objectsTable[99]; - int8 zoomScale = shrink ? -1 : 1; - int8 zoomInc = shrink ? -1 : 1; + int oldScale = _vm->_scale; + int zoomScale = shrink ? 255 : 1; + int zoomInc = shrink ? -1 : 1; Common::Rect boxRect(_invCoords[zoomBox].left, _invCoords[zoomBox].top, _invCoords[zoomBox].left + 46, _invCoords[zoomBox].top + 35); - while (!_vm->shouldQuit() && zoomScale != 0) { + while (!_vm->shouldQuit() && zoomScale != 0 && zoomScale != 256) { _vm->_events->pollEvents(); g_system->delayMillis(5); @@ -494,6 +498,17 @@ void InventoryManager::zoomIcon(int zoomItem, int backItem, int zoomBox, bool sh zoomScale += zoomInc; } + + if (!shrink) { + // Handle the final full-size version + _vm->_buffer2.copyBlock(&_vm->_buffer1, boxRect); + _vm->_buffer2.plotImage(sprites, zoomItem, + Common::Point(boxRect.left, boxRect.top)); + screen.copyBlock(&_vm->_buffer2, boxRect); + } + + _vm->_scale = oldScale; + screen.setScaleTable(oldScale); } void InventoryManager::synchronize(Common::Serializer &s) { |