[Scummvm-cvs-logs] SF.net SVN: scummvm: [25301] scummvm/trunk/engines/lure

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Wed Jan 31 03:33:21 CET 2007


Revision: 25301
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25301&view=rev
Author:   dreammaster
Date:     2007-01-30 18:33:20 -0800 (Tue, 30 Jan 2007)

Log Message:
-----------
Added animation handler for the player exiting the sewer, and some bugfixes to allow Ratpouch to correctly open up the dungeon exit

Modified Paths:
--------------
    scummvm/trunk/engines/lure/hotspots.cpp
    scummvm/trunk/engines/lure/hotspots.h

Modified: scummvm/trunk/engines/lure/hotspots.cpp
===================================================================
--- scummvm/trunk/engines/lure/hotspots.cpp	2007-01-31 02:28:51 UTC (rev 25300)
+++ scummvm/trunk/engines/lure/hotspots.cpp	2007-01-31 02:33:20 UTC (rev 25301)
@@ -512,8 +512,10 @@
 // Sets or clears the hotspot as occupying an area in its room's pathfinding data
 
 void Hotspot::setOccupied(bool occupiedFlag) {
-	if (occupiedFlag == coveredFlag()) return;
-	setCoveredFlag(occupiedFlag);
+	if ((coveredFlag() != VB_INITIAL) &&
+		(occupiedFlag == (coveredFlag() == VB_TRUE)))
+		return;
+	setCoveredFlag(occupiedFlag ? VB_TRUE : VB_FALSE);
 
 	int xp = x() >> 3;
 	int yp = (y() - 8 + heightCopy() - 4) >> 3;
@@ -595,7 +597,7 @@
 			resetPosition();
 		} else {
 			// Make sure the cell occupied by character is covered
-			_data->coveredFlag = true;
+			_data->coveredFlag = VB_TRUE;
 			setOccupied(true);
 		}
 	}
@@ -1922,6 +1924,8 @@
 		return skorlAnimHandler;
 	case 0x7F69:
 		return droppingTorchAnimHandler;
+	case 0x7FA1:
+		return playerSewerExitAnimHandler;
 	case 0x8009:
 		return fireAnimHandler;
 	case 0x81B3:
@@ -2553,7 +2557,7 @@
 	if ((fields.getField(37) == 0) && h.currentActions().isEmpty()) {
 		
 		if (h.roomNumber() == h.currentActions().top().roomNumber()) {
-			// In room - et a random destination
+			// In room - set a random destination
 			h.setRandomDest();
 
 		} else {
@@ -2617,6 +2621,33 @@
  	}
 }
 
+void HotspotTickHandlers::playerSewerExitAnimHandler(Hotspot &h) {
+	if (h.frameCtr() > 0)
+	{
+		h.decrFrameCtr();
+	}
+	else if (h.executeScript())
+	{
+		Resources &res = Resources::getReference();
+
+		// Deactive the dropping animation
+		h.setLayer(0);
+		res.deactivateHotspot(h.hotspotId());
+
+		// Position the player
+		Hotspot *playerHotspot = res.getActiveHotspot(PLAYER_ID);
+		playerHotspot->setPosition(FULL_SCREEN_WIDTH / 2, (FULL_SCREEN_HEIGHT - MENUBAR_Y_SIZE) / 2);
+		playerHotspot->setDirection(DOWN);
+		playerHotspot->setCharacterMode(CHARMODE_NONE);
+
+		// Setup Ratpouch
+		Hotspot *ratpouchHotspot = res.getActiveHotspot(RATPOUCH_ID);
+		ratpouchHotspot->setCharacterMode(CHARMODE_NONE);
+		ratpouchHotspot->setDelayCtr(0);
+		ratpouchHotspot->setActions(0x821C00);
+	}
+}
+
 void HotspotTickHandlers::fireAnimHandler(Hotspot &h) {
 	standardAnimHandler(h);
 	h.setOccupied(true);
@@ -2867,6 +2898,7 @@
 	uint16 frameNumber = 0;
 
 	if (character->y() < 79) {
+		// TODO: 
 		//character = res.getActiveHotspot(RATPOUCH_ID);
 		frameNumber = 1;
 	} else {

Modified: scummvm/trunk/engines/lure/hotspots.h
===================================================================
--- scummvm/trunk/engines/lure/hotspots.h	2007-01-31 02:28:51 UTC (rev 25300)
+++ scummvm/trunk/engines/lure/hotspots.h	2007-01-31 02:33:20 UTC (rev 25301)
@@ -65,6 +65,7 @@
 	static void followerAnimHandler(Hotspot &h);
 	static void skorlAnimHandler(Hotspot &h);
 	static void droppingTorchAnimHandler(Hotspot &h);
+	static void playerSewerExitAnimHandler(Hotspot &h);
 	static void fireAnimHandler(Hotspot &h);
 	static void prisonerAnimHandler(Hotspot &h);
 	static void talkAnimHandler(Hotspot &h);
@@ -406,11 +407,11 @@
 		assert(_data);
 		_data->pauseCtr = value;
 	}
-	bool coveredFlag() { 
+	VariantBool coveredFlag() { 
 		assert(_data);
 		return _data->coveredFlag;
 	}
-	void setCoveredFlag(bool value) { 
+	void setCoveredFlag(VariantBool value) { 
 		assert(_data);
 		_data->coveredFlag = value;
 	}


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