[Scummvm-cvs-logs] scummvm master -> 9f7ff8351bf8fae46f4b06321a6fd9bdfdaa7bd7

m-kiewitz m_kiewitz at users.sourceforge.net
Thu Feb 4 21:22:11 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
9f7ff8351b AGI: Fix mouse code for transitions


Commit: 9f7ff8351bf8fae46f4b06321a6fd9bdfdaa7bd7
    https://github.com/scummvm/scummvm/commit/9f7ff8351bf8fae46f4b06321a6fd9bdfdaa7bd7
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2016-02-04T21:21:52+01:00

Commit Message:
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.

Changed paths:
    engines/agi/graphics.cpp
    engines/agi/op_cmd.cpp



diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp
index fbcb9d1..ae4ad81 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 cf1c19a..7d4b759 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];






More information about the Scummvm-git-logs mailing list