diff options
author | Martin Kiewitz | 2016-02-04 21:21:52 +0100 |
---|---|---|
committer | Martin Kiewitz | 2016-02-04 21:21:52 +0100 |
commit | 9f7ff8351bf8fae46f4b06321a6fd9bdfdaa7bd7 (patch) | |
tree | b910a87b9073fbef2d5aff1cdf5d46cd2778715b | |
parent | 26791ec7d9dfb9a97c133e96e835f9387c8d8139 (diff) | |
download | scummvm-rg350-9f7ff8351bf8fae46f4b06321a6fd9bdfdaa7bd7.tar.gz scummvm-rg350-9f7ff8351bf8fae46f4b06321a6fd9bdfdaa7bd7.tar.bz2 scummvm-rg350-9f7ff8351bf8fae46f4b06321a6fd9bdfdaa7bd7.zip |
AGI: Fix mouse code for transitions
Do not show mouse cursor after transition, when it's currently
switched to hidden. Do the same for hide/show.mouse opcodes.
-rw-r--r-- | engines/agi/graphics.cpp | 8 | ||||
-rw-r--r-- | engines/agi/op_cmd.cpp | 20 |
2 files changed, 16 insertions, 12 deletions
diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index fbcb9d1b95..ae4ad813aa 100644 --- a/engines/agi/graphics.cpp +++ b/engines/agi/graphics.cpp @@ -351,7 +351,7 @@ void GfxMgr::transition_Amiga() { int16 stepCount = 0; // disable mouse while transition is taking place - if (_vm->_game.mouseEnabled) { + if ((_vm->_game.mouseEnabled) && (!_vm->_game.mouseHidden)) { CursorMan.showMouse(false); } @@ -388,7 +388,7 @@ void GfxMgr::transition_Amiga() { } while (screenPos != 1); // Enable mouse again - if (_vm->_game.mouseEnabled) { + if ((_vm->_game.mouseEnabled) && (!_vm->_game.mouseHidden)) { CursorMan.showMouse(true); } @@ -404,7 +404,7 @@ void GfxMgr::transition_AtariSt() { int16 stepCount = 0; // disable mouse while transition is taking place - if (_vm->_game.mouseEnabled) { + if ((_vm->_game.mouseEnabled) && (!_vm->_game.mouseHidden)) { CursorMan.showMouse(false); } @@ -442,7 +442,7 @@ void GfxMgr::transition_AtariSt() { } while (screenPos != 1); // Enable mouse again - if (_vm->_game.mouseEnabled) { + if ((_vm->_game.mouseEnabled) && (!_vm->_game.mouseHidden)) { CursorMan.showMouse(true); } diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index cf1c19a1df..7d4b7591d9 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -946,6 +946,14 @@ void cmdDiscardSound(AgiGame *state, AgiEngine *vm, uint8 *parameter) { } } +void cmdShowMouse(AgiGame *state, AgiEngine *vm, uint8 *parameter) { + if (state->mouseEnabled) { + state->mouseHidden = false; + + g_system->showMouse(true); + } +} + void cmdHideMouse(AgiGame *state, AgiEngine *vm, uint8 *parameter) { // WORKAROUND: Turns off current movement that's being caused with the mouse. // This fixes problems with too many popup boxes appearing in the Amiga @@ -955,9 +963,11 @@ void cmdHideMouse(AgiGame *state, AgiEngine *vm, uint8 *parameter) { // FIXME: Write a proper implementation using disassembly and // apply it to other games as well if applicable. //state->screenObjTable[SCREENOBJECTS_EGO_ENTRY].flags &= ~fAdjEgoXY; - state->_vm->_game.mouseHidden = true; + if (state->mouseEnabled) { + state->mouseHidden = true; - g_system->showMouse(false); + g_system->showMouse(false); + } } void cmdAllowMenu(AgiGame *state, AgiEngine *vm, uint8 *parameter) { @@ -972,12 +982,6 @@ void cmdAllowMenu(AgiGame *state, AgiEngine *vm, uint8 *parameter) { } } -void cmdShowMouse(AgiGame *state, AgiEngine *vm, uint8 *parameter) { - state->_vm->_game.mouseHidden = false; - - g_system->showMouse(true); -} - void cmdFenceMouse(AgiGame *state, AgiEngine *vm, uint8 *parameter) { uint16 varNr1 = parameter[0]; uint16 varNr2 = parameter[1]; |