[Scummvm-cvs-logs] SF.net SVN: scummvm:[45850] scummvm/trunk/engines/draci

spalek at users.sourceforge.net spalek at users.sourceforge.net
Thu Nov 12 04:09:16 CET 2009


Revision: 45850
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45850&view=rev
Author:   spalek
Date:     2009-11-12 03:09:15 +0000 (Thu, 12 Nov 2009)

Log Message:
-----------
Fixed Script::icoStat()

Modified Paths:
--------------
    scummvm/trunk/engines/draci/draci.h
    scummvm/trunk/engines/draci/script.cpp

Modified: scummvm/trunk/engines/draci/draci.h
===================================================================
--- scummvm/trunk/engines/draci/draci.h	2009-11-12 00:57:38 UTC (rev 45849)
+++ scummvm/trunk/engines/draci/draci.h	2009-11-12 03:09:15 UTC (rev 45850)
@@ -42,7 +42,6 @@
 #include "draci/animation.h"
 #include "draci/sound.h"
 #include "draci/music.h"
-#include "draci/walking.h"
 
 namespace Draci {
 

Modified: scummvm/trunk/engines/draci/script.cpp
===================================================================
--- scummvm/trunk/engines/draci/script.cpp	2009-11-12 00:57:38 UTC (rev 45849)
+++ scummvm/trunk/engines/draci/script.cpp	2009-11-12 03:09:15 UTC (rev 45850)
@@ -270,9 +270,7 @@
 int Script::funcIsIcoAct(int itemID) const {
 	itemID -= 1;
 
-	const GameItem *item = _vm->_game->getCurrentItem();
-	const int currentID = item ? item->_absNum : -1;
-	return currentID == itemID;
+	return _vm->_game->getCurrentItem() == _vm->_game->getItem(itemID);
 }
 
 int Script::funcActIco(int itemID) const {
@@ -539,41 +537,26 @@
 
 	_vm->_game->setItemStatus(itemID, status == 1);
 
-	if (_vm->_game->getItemStatus(itemID) == 0) {
-		if (item) {
-			item->_anim->del();
-			item->_anim = NULL;
-		}
-
+	if (!_vm->_game->getItemStatus(itemID)) {
+		// Remove the item from the inventory and release its animations.
 		_vm->_game->removeItem(item);
+		item->_anim->del();
+		item->_anim = NULL;
 
+		// If the item was in the hand, remove it from the hands and,
+		// if the cursor was set to this item (as opposed to, say, an
+		// arrow leading outside a location), set it to standard.
 		if (_vm->_game->getCurrentItem() == item) {
 			_vm->_game->setCurrentItem(NULL);
-		}
-
-		if (_vm->_mouse->getCursorType() == kNormalCursor) {
-			// TODO: is this correct?
-			if (_vm->_game->getLoopStatus() == kStatusInventory) {
-				_vm->_mouse->cursorOff();
+			if (_vm->_mouse->getCursorType() >= kItemCursor) {
+				_vm->_mouse->setCursorType(kNormalCursor);
 			}
 		}
-	}
 
-	if (_vm->_game->getItemStatus(itemID) == 1) {
-		if (item) {
-			_vm->_game->loadItemAnimation(item);
-		}
-
+	} else {
+		_vm->_game->loadItemAnimation(item);
 		_vm->_game->setCurrentItem(item);
-
 		_vm->_mouse->loadItemCursor(item, false);
-
-		// TODO: This is probably not needed but I'm leaving it to be sure for now
-		// The original engine needed to turn off the mouse temporarily when changing
-		// the cursor image. I'm just setting it to the final state of that transition.
-		if (_vm->_game->getLoopStatus() == kStatusInventory) {
-			_vm->_mouse->cursorOn();
-		}
 	}
 }
 


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