aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/menu.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-06 14:10:09 +0000
committerMartin Kiewitz2010-07-06 14:10:09 +0000
commita7cd1534c6d3a325e36db42314e22ff3d8bdc8dd (patch)
tree7e1e60e9e5047e94c5af022c8541e1bcea3bc9e5 /engines/sci/graphics/menu.cpp
parentc89fe5f6d56b6d6e11b7d642e85633bc86098ce8 (diff)
downloadscummvm-rg350-a7cd1534c6d3a325e36db42314e22ff3d8bdc8dd.tar.gz
scummvm-rg350-a7cd1534c6d3a325e36db42314e22ff3d8bdc8dd.tar.bz2
scummvm-rg350-a7cd1534c6d3a325e36db42314e22ff3d8bdc8dd.zip
SCI: fix regression of r50721 - pausing/resuming only on actual menu usage
svn-id: r50724
Diffstat (limited to 'engines/sci/graphics/menu.cpp')
-rw-r--r--engines/sci/graphics/menu.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp
index d85d4456fc..f959ffb3a5 100644
--- a/engines/sci/graphics/menu.cpp
+++ b/engines/sci/graphics/menu.cpp
@@ -382,7 +382,7 @@ void GfxMenu::calculateMenuAndItemWidth() {
}
}
-reg_t GfxMenu::kernelSelect(reg_t eventObject) {
+reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) {
int16 eventType = readSelectorValue(_segMan, eventObject, SELECTOR(type));
int16 keyPress, keyModifier;
Common::Point mousePosition;
@@ -407,9 +407,9 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject) {
case 0:
break;
case SCI_KEY_ESC:
- interactiveShowMouse();
+ interactiveStart(pauseSound);
itemEntry = interactiveWithKeyboard();
- interactiveRestoreMouse();
+ interactiveEnd(pauseSound);
forceClaimed = true;
break;
default:
@@ -445,9 +445,9 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject) {
case SCI_EVENT_MOUSE_PRESS:
mousePosition = _cursor->getPosition();
if (mousePosition.y < 10) {
- interactiveShowMouse();
+ interactiveStart(pauseSound);
itemEntry = interactiveWithMouse();
- interactiveRestoreMouse();
+ interactiveEnd(pauseSound);
forceClaimed = true;
}
break;
@@ -632,12 +632,16 @@ void GfxMenu::invertMenuSelection(uint16 itemId) {
_paint16->bitsShow(itemRect);
}
-void GfxMenu::interactiveShowMouse() {
+void GfxMenu::interactiveStart(bool pauseSound) {
_mouseOldState = _cursor->isVisible();
_cursor->kernelShow();
+ if (pauseSound)
+ g_sci->_soundCmd->pauseAll(true);
}
-void GfxMenu::interactiveRestoreMouse() {
+void GfxMenu::interactiveEnd(bool pauseSound) {
+ if (pauseSound)
+ g_sci->_soundCmd->pauseAll(false);
if (!_mouseOldState)
_cursor->kernelHide();
}