diff options
author | Johannes Schickel | 2008-03-09 09:58:05 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-03-09 09:58:05 +0000 |
commit | 3a83cf654eb42e60837a34b16b3628e0464976d9 (patch) | |
tree | d4d5537cb27356e48eee4ecd4c23e849212a20f5 | |
parent | 353e5a78967e2ab1afdeb3ce9b482e0b455b3880 (diff) | |
download | scummvm-rg350-3a83cf654eb42e60837a34b16b3628e0464976d9.tar.gz scummvm-rg350-3a83cf654eb42e60837a34b16b3628e0464976d9.tar.bz2 scummvm-rg350-3a83cf654eb42e60837a34b16b3628e0464976d9.zip |
Fixed access of inventory in HoF while cursor is not visible.
svn-id: r31081
-rw-r--r-- | engines/kyra/gui_v2.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/screen.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/screen.h | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp index 43d480b142..08b5a8038e 100644 --- a/engines/kyra/gui_v2.cpp +++ b/engines/kyra/gui_v2.cpp @@ -572,7 +572,9 @@ int KyraEngine_v2::processButtonList(Button *buttonList, uint16 inputFlag) { } int KyraEngine_v2::buttonInventory(Button *button) { - //XXX test if cursor is shown + if (!_screen->isMouseShown()) + return 0; + int inventorySlot = button->index - 6; uint16 item = _mainCharacter.inventory[inventorySlot]; diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index d323eb21ca..da40d62cb6 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -2300,6 +2300,10 @@ void Screen::showMouse() { _mouseLockCount--; } +bool Screen::isMouseShown() const { + return (_mouseLockCount == 0); +} + void Screen::setShapePages(int page1, int page2) { debugC(9, kDebugLevelScreen, "Screen::setShapePages(%d, %d)", page1, page2); _shapePages[0] = _pagePtrs[page1]; diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index 152ba91a21..29969cb44d 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -182,6 +182,7 @@ public: void hideMouse(); void showMouse(); void setMouseCursor(int x, int y, byte *shape); + bool isMouseShown() const; // rect handling virtual int getRectSize(int w, int h); |