diff options
author | Paul Gilbert | 2015-04-02 08:44:07 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-04-02 08:44:07 -0400 |
commit | 8ee021434236b454faf52995fb102322f2e7bd8f (patch) | |
tree | 3b6597aad6f167d4f3c625579c9d4bb1f641af43 | |
parent | 2c36889ec5312b15a7deba8a19003d9500425cb3 (diff) | |
download | scummvm-rg350-8ee021434236b454faf52995fb102322f2e7bd8f.tar.gz scummvm-rg350-8ee021434236b454faf52995fb102322f2e7bd8f.tar.bz2 scummvm-rg350-8ee021434236b454faf52995fb102322f2e7bd8f.zip |
SHERLOCK: Implemented Inventory::highlight
-rw-r--r-- | engines/sherlock/inventory.cpp | 15 | ||||
-rw-r--r-- | engines/sherlock/inventory.h | 2 | ||||
-rw-r--r-- | engines/sherlock/user_interface.cpp | 4 |
3 files changed, 16 insertions, 5 deletions
diff --git a/engines/sherlock/inventory.cpp b/engines/sherlock/inventory.cpp index ac37e7c587..f7706c9d64 100644 --- a/engines/sherlock/inventory.cpp +++ b/engines/sherlock/inventory.cpp @@ -329,8 +329,19 @@ void Inventory::invCommands(bool slamIt) { } } -void Inventory::doInvLite(int index, byte color) { - // TODO +/** + * Set the highlighting color of a given inventory item + */ +void Inventory::highlight(int index, byte color) { + Screen &screen = *_vm->_screen; + Surface &bb = *screen._backBuffer; + int slot = index - _invIndex; + Graphics::Surface &img = (*_invShapes[slot])[0]._frame; + + bb.fillRect(Common::Rect(8 + slot * 52, 165, (slot + 1) * 52, 194), color); + bb.transBlitFrom(img, Common::Point(6 + slot * 52 + ((47 - img.w) / 2), + 163 + ((33 - img.h) / 2))); + screen.slamArea(8 + slot * 52, 165, 44, 30); } void Inventory::doInvJF() { diff --git a/engines/sherlock/inventory.h b/engines/sherlock/inventory.h index 3c01dc38da..55abc4c960 100644 --- a/engines/sherlock/inventory.h +++ b/engines/sherlock/inventory.h @@ -87,7 +87,7 @@ public: void invCommands(bool slamIt); - void doInvLite(int index, byte color); + void highlight(int index, byte color); void doInvJF(); }; diff --git a/engines/sherlock/user_interface.cpp b/engines/sherlock/user_interface.cpp index 74142ab80e..6f60049e31 100644 --- a/engines/sherlock/user_interface.cpp +++ b/engines/sherlock/user_interface.cpp @@ -789,11 +789,11 @@ void UserInterface::doInvControl() { if (_oldSelector != -1) { // Un-highlight if (_oldSelector >= inv._invIndex && _oldSelector < (inv._invIndex + 6)) - inv.doInvLite(_oldSelector, BUTTON_MIDDLE); + inv.highlight(_oldSelector, BUTTON_MIDDLE); } if (_selector != -1) - inv.doInvLite(_selector, 235); + inv.highlight(_selector, 235); _oldSelector = _selector; } |