aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/game.cpp
diff options
context:
space:
mode:
authorRobert Špalek2009-11-08 21:26:04 +0000
committerRobert Špalek2009-11-08 21:26:04 +0000
commitabbb3dccd7fa909d1746b00a88eb55494514334f (patch)
tree09a8369306bf9ad3e8a0079fd94a74634579543b /engines/draci/game.cpp
parentd5bff15b228d229336b0822cd5b7d6b99213db92 (diff)
downloadscummvm-rg350-abbb3dccd7fa909d1746b00a88eb55494514334f.tar.gz
scummvm-rg350-abbb3dccd7fa909d1746b00a88eb55494514334f.tar.bz2
scummvm-rg350-abbb3dccd7fa909d1746b00a88eb55494514334f.zip
Items put into inventory are placed correctly.
Also, named correctly GPL2 parameter types. This fixes all FIXMEs svn-id: r45762
Diffstat (limited to 'engines/draci/game.cpp')
-rw-r--r--engines/draci/game.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index aa7964fb3b..efa7d8bf86 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -332,9 +332,14 @@ void Game::handleInventoryLoop() {
// Otherwise, if we are holding an item, try to place it inside the
// inventory
} else if (_currentItem != kNoItem) {
- // FIXME: This should place the item in the nearest inventory slot,
- // not the first one available
- putItem(_currentItem, 0);
+ const int column = scummvm_lround(
+ (_vm->_mouse->getPosX() - kInventoryX + kInventoryItemWidth / 2.) /
+ kInventoryItemWidth) - 1;
+ const int line = scummvm_lround(
+ (_vm->_mouse->getPosY() - kInventoryY + kInventoryItemHeight / 2.) /
+ kInventoryItemHeight) - 1;
+ const int index = line * kInventoryColumns + column;
+ putItem(_currentItem, index);
// Remove it from our hands
_currentItem = kNoItem;