[Scummvm-cvs-logs] SF.net SVN: scummvm: [31976] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sat May 10 19:41:35 CEST 2008


Revision: 31976
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31976&view=rev
Author:   lordhoto
Date:     2008-05-10 10:41:34 -0700 (Sat, 10 May 2008)

Log Message:
-----------
Simplification in updateItemAnimations in KyraEngine_HoF and KyraEngine_MR.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/animator_hof.cpp
    scummvm/trunk/engines/kyra/animator_mr.cpp
    scummvm/trunk/engines/kyra/kyra_hof.cpp
    scummvm/trunk/engines/kyra/kyra_mr.cpp
    scummvm/trunk/engines/kyra/kyra_v2.h

Modified: scummvm/trunk/engines/kyra/animator_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/animator_hof.cpp	2008-05-10 15:31:11 UTC (rev 31975)
+++ scummvm/trunk/engines/kyra/animator_hof.cpp	2008-05-10 17:41:34 UTC (rev 31976)
@@ -139,7 +139,7 @@
 		return;
 
 	uint16 shpIdx = s->frames[a->currentFrame].index + 64;
-	if ((s->itemIndex == _handItemSet || s->itemIndex == _itemInHand) && (!_mouseState && _screen->isMouseVisible())) {
+	if (s->itemIndex == _handItemSet && s->itemIndex == _itemInHand && _screen->isMouseVisible()) {
 		nextFrame = true;
 		_screen->setMouseCursor(8, 15, getShapePtr(shpIdx));
 	}

Modified: scummvm/trunk/engines/kyra/animator_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/animator_mr.cpp	2008-05-10 15:31:11 UTC (rev 31975)
+++ scummvm/trunk/engines/kyra/animator_mr.cpp	2008-05-10 17:41:34 UTC (rev 31976)
@@ -197,6 +197,7 @@
 }
 
 void KyraEngine_MR::updateItemAnimations() {
+	debugC(9, kDebugLevelAnimator, "KyraEngine_MR::updateItemAnimations()");
 	bool nextFrame = false;
 
 	if (_itemAnimData[0].itemIndex == -1)
@@ -215,7 +216,7 @@
 		return;
 
 	uint16 shpIdx = s->frames[a->currentFrame].index + 248;
-	if ((/*s->itemIndex == _handItemSet || */s->itemIndex == _itemInHand) && (!_mouseState && _screen->isMouseVisible())) {
+	if (s->itemIndex == _handItemSet && s->itemIndex == _itemInHand && _screen->isMouseVisible()) {
 		nextFrame = true;
 		_screen->setMouseCursor(12, 19, getShapePtr(shpIdx));
 	}
@@ -240,7 +241,7 @@
 		if (animObject->shapeIndex2 == s->itemIndex + 248) {
 			animObject->shapePtr = getShapePtr(shpIdx);
 			animObject->shapeIndex1 = shpIdx;
-			animObject->needRefresh = 1;
+			animObject->needRefresh = true;
 			nextFrame = true;
 		}
 	}

Modified: scummvm/trunk/engines/kyra/kyra_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_hof.cpp	2008-05-10 15:31:11 UTC (rev 31975)
+++ scummvm/trunk/engines/kyra/kyra_hof.cpp	2008-05-10 17:41:34 UTC (rev 31976)
@@ -724,7 +724,7 @@
 	}
 
 	if (type != 0 && _handItemSet != type && _screen->isMouseVisible()) {
-		_mouseState = _handItemSet = type;
+		_handItemSet = type;
 		_screen->hideMouse();
 		_screen->setMouseCursor(xOffset, yOffset, getShapePtr(shapeIndex));
 		_screen->showMouse();
@@ -732,7 +732,6 @@
 
 	if (type == 0 && _handItemSet != _itemInHand && _screen->isMouseVisible()) {
 		if ((mouse.y > 145) || (mouse.x > 6 && mouse.x < 312 && mouse.y > 6 && mouse.y < 135)) {
-			_mouseState = 0;
 			_handItemSet = _itemInHand;
 			_screen->hideMouse();
 			if (_itemInHand == -1)

Modified: scummvm/trunk/engines/kyra/kyra_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_mr.cpp	2008-05-10 15:31:11 UTC (rev 31975)
+++ scummvm/trunk/engines/kyra/kyra_mr.cpp	2008-05-10 17:41:34 UTC (rev 31976)
@@ -1267,11 +1267,9 @@
 	}
 
 	if (type != 0 && type != _handItemSet && !hasItemCollision) {
-		_mouseState = _handItemSet = type;
 		_handItemSet = type;
 		_screen->setMouseCursor(offsetX, offsetY, _gameShapes[shape]);
 	} else if (type == 0 && _handItemSet != _itemInHand && mouse.x > 8 && mouse.x < 311 && mouse.y < 171 && mouse.y > 8) {
-		_mouseState = 0;
 		setItemMouseCursor();
 	} else if (mouse.y > 187 && _handItemSet > -4 && type == 0 && !_inventoryState) {
 		showInventory();

Modified: scummvm/trunk/engines/kyra/kyra_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.h	2008-05-10 15:31:11 UTC (rev 31975)
+++ scummvm/trunk/engines/kyra/kyra_v2.h	2008-05-10 17:41:34 UTC (rev 31976)
@@ -101,7 +101,6 @@
 	void removeInputTop();
 
 	int _mouseX, _mouseY;
-	int _mouseState;
 
 	struct Event {
 		Common::Event event;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list