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

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sat Nov 10 23:47:11 CET 2007


Revision: 29471
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29471&view=rev
Author:   dreammaster
Date:     2007-11-10 14:47:11 -0800 (Sat, 10 Nov 2007)

Log Message:
-----------
Expanded talk routines so that characters now properly stand still only when they're meant to

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

Modified: scummvm/trunk/engines/lure/hotspots.cpp
===================================================================
--- scummvm/trunk/engines/lure/hotspots.cpp	2007-11-10 19:51:06 UTC (rev 29470)
+++ scummvm/trunk/engines/lure/hotspots.cpp	2007-11-10 22:47:11 UTC (rev 29471)
@@ -736,7 +736,8 @@
 	setDirection(direction());
 }
 
-void Hotspot::converse(uint16 destCharacterId, uint16 messageId, bool standStill) {
+void Hotspot::converse(uint16 destCharacterId, uint16 messageId, bool srcStandStill, 
+					   bool destStandStill) {
 	assert(_data);
 	_data->talkDestCharacterId = destCharacterId;
 	_data->talkMessageId = messageId;
@@ -748,12 +749,13 @@
 		HotspotData *hotspot = Resources::getReference().getHotspot(destCharacterId);
 		_data->talkCountdown += hotspot->talkCountdown;
 
-		if (hotspot->talkCountdown == 0)
-			hotspot->talkerId = _hotspotId ;
-		hotspot->talkGate = 0;
+		if (destStandStill) {
+			hotspot->talkerId = _hotspotId;
+			hotspot->talkGate = 0;
+		}
 	}
 
-	if (standStill) {
+	if (srcStandStill) {
 		setDelayCtr(_data->talkCountdown);
 		_data->characterMode = CHARMODE_CONVERSING;
 	}
@@ -862,7 +864,7 @@
 			// Talking is finish - stop talking and free voice animation
 			debugC(ERROR_DETAILED, kLureDebugAnimations, "Talk dialog close");
 			room.setTalkDialog(0, 0, 0, 0);
-
+/*
 			if ((_data->talkDestCharacterId != 0) && (_data->talkDestCharacterId != NOONE_ID)) {
 				HotspotData *destChar = res.getHotspot(_data->talkDestCharacterId);
 				destChar->talkerId = 0;
@@ -870,6 +872,7 @@
 
 			_data->talkerId = 0;
 			_data->talkGate = 0;
+*/
 		}
 	}
 
@@ -882,7 +885,7 @@
 
 	if ((_data->talkDestCharacterId != 0) && (_data->talkDestCharacterId != NOONE_ID)) {
 		HotspotData *hotspot = Resources::getReference().getHotspot(_data->talkDestCharacterId);
-		hotspot->talkerId = _hotspotId;
+//		hotspot->talkerId = _hotspotId;
 	}
 
 	if (room.roomNumber() != roomNumber()) return;
@@ -960,7 +963,7 @@
 			}
 
 			hotspot->talkGate = GENERAL_MAGIC_ID;
-			hotspot->talkDestCharacterId = _hotspotId;
+			hotspot->talkerId = _hotspotId;
 			return PC_WAIT;
 		} 
 	}
@@ -970,7 +973,7 @@
 	if (hotspot->hotspotId < FIRST_NONCHARACTER_ID) {
 		hotspot->characterMode = CHARMODE_INTERACTING;
 		hotspot->delayCtr = 30;
-		hotspot->actionHotspotId = hotspot->hotspotId;
+		hotspot->actionHotspotId = _hotspotId;
 	}
 	return PC_EXECUTE;
 }
@@ -1560,7 +1563,7 @@
 		return;
 	}
 
-	converse(hotspot->hotspotId, 0x7C, true);
+	converse(hotspot->hotspotId, 0x7C, true, false);
 
 	uint16 sequenceOffset = res.getHotspotAction(hotspot->actionsOffset, TELL);
 	if (sequenceOffset >= 0x8000) {
@@ -2122,8 +2125,9 @@
 	setTickProc(TALK_TICK_PROC_ID);    
 	
 	// Signal the character that they're being talked to
+	charHotspot->talkerId = _hotspotId;
+	charHotspot->talkGate = 0;
 	charHotspot->talkDestCharacterId = _hotspotId;
-	charHotspot->talkGate = 0;
 	_data->talkDestCharacterId = charHotspot->hotspotId;
 	_data->talkGate = 0;
 	
@@ -2335,7 +2339,7 @@
 	// If someone is talking to the character, this stops them from moving for the duration)
 	if (h.resource()->talkerId != 0) {
 		debugC(ERROR_DETAILED, kLureDebugAnimations, "Talker Id = %xh, talk_gate = %d",
-			h.resource()->talkDestCharacterId, h.talkGate());
+			h.resource()->talkerId, h.talkGate());
 		if (h.talkGate() == GENERAL_MAGIC_ID) {
 			fields.setField(ACTIVE_HOTSPOT_ID, h.talkGate());
 			fields.setField(USE_HOTSPOT_ID, h.resource()->talkerId);
@@ -2430,7 +2434,7 @@
 				if (!decrementFlag) {
 					HotspotData *hotspot = res.getHotspot(h.resource()->actionHotspotId);
 					assert(hotspot);
-					decrementFlag = (hotspot->roomNumber != h.hotspotId()) ? false :
+					decrementFlag = (hotspot->roomNumber != h.roomNumber()) ? false :
 						Support::charactersIntersecting(hotspot, h.resource());
 				}
 
@@ -3286,7 +3290,7 @@
 
 			// Make sure the dest character holds still while an option is selected
 			HotspotData *destHotspot = res.getHotspot(talkDestCharacter);
-			destHotspot->talkerId = h.hotspotId();
+			//destHotspot->talkerId = h.hotspotId();
 		} else {
 			res.setTalkState(TALK_RESPOND);
 			res.setTalkSelection(1);
@@ -3339,7 +3343,7 @@
 		// Get the response the destination character will say
 		if (descId != TALK_MAGIC_ID) {
 			// Set up to display the question and response in talk dialogs
-			h.converse(talkDestCharacter, descId, false);
+			h.converse(talkDestCharacter, descId);
 			res.setTalkState(TALK_RESPOND_2);
 		} else {
 			res.setTalkState(TALK_RESPOND_3);
@@ -3425,7 +3429,11 @@
 			// End the conversation
 			res.getActiveHotspot(PLAYER_ID)->setTickProc(PLAYER_TICK_PROC_ID);
 			if (charHotspot)
+			{
 				charHotspot->setUseHotspotId(0);
+				charHotspot->resource()->talkerId = 0;
+				charHotspot->setDelayCtr(24);
+			}
 			res.setTalkData(0);
 			res.setCurrentAction(NONE);
 			res.setTalkState(TALK_NONE);

Modified: scummvm/trunk/engines/lure/hotspots.h
===================================================================
--- scummvm/trunk/engines/lure/hotspots.h	2007-11-10 19:51:06 UTC (rev 29470)
+++ scummvm/trunk/engines/lure/hotspots.h	2007-11-10 22:47:11 UTC (rev 29471)
@@ -540,10 +540,8 @@
 	void setVoiceCtr(uint8 v) { _voiceCtr = v; }
 
 	// Miscellaneous
-	void converse(uint16 destCharacterId, uint16 messageId, bool standStill);
-	void converse(uint16 destCharacterId, uint16 messageId) {
-		converse(destCharacterId, messageId, false);
-	}
+	void converse(uint16 destCharacterId, uint16 messageId, bool srcStandStill = false, 
+					   bool destStandStill = false);
 	void showMessage(uint16 messageId, uint16 destCharacterId = NOONE_ID);
 	void scheduleConverse(uint16 destHotspot, uint16 messageId);
 	void handleTalkDialog();

Modified: scummvm/trunk/engines/lure/res.cpp
===================================================================
--- scummvm/trunk/engines/lure/res.cpp	2007-11-10 19:51:06 UTC (rev 29470)
+++ scummvm/trunk/engines/lure/res.cpp	2007-11-10 22:47:11 UTC (rev 29471)
@@ -487,12 +487,13 @@
 		HotspotData *charHotspot = res.getHotspot(_talkingCharacter);
 		assert(charHotspot);
 		charHotspot->talkCountdown = 0;
-
+/*
 		if (charHotspot->talkDestCharacterId != 0) {
 			HotspotData *destHotspot = res.getHotspot(charHotspot->talkDestCharacterId);
 			if (destHotspot != NULL)
 				destHotspot->talkDestCharacterId = 0;
 		}
+*/
 		charHotspot->talkDestCharacterId = 0;
 	}
 

Modified: scummvm/trunk/engines/lure/room.cpp
===================================================================
--- scummvm/trunk/engines/lure/room.cpp	2007-11-10 19:51:06 UTC (rev 29470)
+++ scummvm/trunk/engines/lure/room.cpp	2007-11-10 22:47:11 UTC (rev 29471)
@@ -616,7 +616,7 @@
 		delete _talkDialog;
 		_talkDialog = NULL;
 	}
-
+/*
 	if (res.getTalkingCharacter() != 0) {
 		// Signal to any talked to character that they're no longer being talked to
 		HotspotData *talkingChar = res.getHotspot(res.getTalkingCharacter());
@@ -626,7 +626,7 @@
 			destChar->talkerId = 0;
 		}
 	}
-
+*/
 	res.setTalkingCharacter(srcCharacterId);
 
 	if (srcCharacterId == 0)

Modified: scummvm/trunk/engines/lure/scripts.cpp
===================================================================
--- scummvm/trunk/engines/lure/scripts.cpp	2007-11-10 19:51:06 UTC (rev 29470)
+++ scummvm/trunk/engines/lure/scripts.cpp	2007-11-10 22:47:11 UTC (rev 29471)
@@ -338,7 +338,7 @@
 void Script::setTalking(uint16 characterId, uint16 destHotspot, uint16 messageId) {
 	Hotspot *hotspot = Resources::getReference().getActiveHotspot(characterId);
 	if (hotspot)
-		hotspot->converse(destHotspot, messageId, false);	
+		hotspot->converse(destHotspot, messageId, true, false);	
 }
 
 // Sets the current action ctr value for the given hotspot
@@ -353,7 +353,7 @@
 
 void Script::startSpeaking(uint16 characterId, uint16 destHotspot, uint16 messageId) {
 	Hotspot *hotspot = Resources::getReference().getActiveHotspot(characterId);
-	hotspot->converse(destHotspot, messageId, false);
+	hotspot->converse(destHotspot, messageId, false, false);
 }
 
 // Disables the given hotspot from being highlighted by the cursor


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