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

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sun Aug 12 13:19:02 CEST 2007


Revision: 28552
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28552&view=rev
Author:   dreammaster
Date:     2007-08-12 04:19:01 -0700 (Sun, 12 Aug 2007)

Log Message:
-----------
Added missing calls to the sound system

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

Modified: scummvm/trunk/engines/lure/fights.cpp
===================================================================
--- scummvm/trunk/engines/lure/fights.cpp	2007-08-12 11:17:48 UTC (rev 28551)
+++ scummvm/trunk/engines/lure/fights.cpp	2007-08-12 11:19:01 UTC (rev 28552)
@@ -466,7 +466,7 @@
 			moveOffset += 2 * sizeof(uint16);
 
 			if (v1 == opponent.fwblocking) {
-				Sound.playSound(42);
+				Sound.addSound(42);
 				moveOffset = v2;
 			}
 			break;
@@ -478,7 +478,7 @@
 			if (fighter.fwdist <= FIGHT_DISTANCE) {
 				if (h.hotspotId() == PLAYER_ID) {
 					// Player hits opponent
-					Sound.playSound(52);
+					Sound.addSound(52);
 
 					if (opponent.fwhits != 5) {
 						opponent.fwseq_ad = v1;
@@ -490,13 +490,13 @@
 					}
 				} else {
 					// Opponent hit player
-					Sound.playSound(37);
+					Sound.addSound(37);
 					opponent.fwseq_ad = v1;
 					if (++opponent.fwhits == 10) {
 						// Player has been killed
 						fighter.fwhits = 10;
 						opponent.fwseq_ad = FIGHT_PLAYER_DIES;
-						Sound.playSound(36);
+						Sound.addSound(36);
 					}
 				}
 			}
@@ -526,7 +526,7 @@
 
 		case 0xFFEA:
 			// Fight sound
-			Sound.playSound(getWord(moveOffset));
+			Sound.addSound(getWord(moveOffset) & 0xff);
 			moveOffset += sizeof(uint16);
 			break;
 

Modified: scummvm/trunk/engines/lure/hotspots.cpp
===================================================================
--- scummvm/trunk/engines/lure/hotspots.cpp	2007-08-12 11:17:48 UTC (rev 28551)
+++ scummvm/trunk/engines/lure/hotspots.cpp	2007-08-12 11:19:01 UTC (rev 28552)
@@ -35,6 +35,7 @@
 #include "lure/events.h"
 #include "lure/game.h"
 #include "lure/fights.h"
+#include "lure/sound.h"
 #include "common/endian.h"
 
 namespace Lure {
@@ -165,6 +166,39 @@
 	_nameBuffer[0] = '\0';
 }
 
+Hotspot::Hotspot(): _pathFinder(NULL) {
+	_data = NULL;
+	_anim = NULL;
+	_frames = NULL;
+	_numFrames = 0;
+	_persistant = false;
+	_hotspotId = 0xffff;
+	_override = NULL;
+	_colourOffset = 0;
+	_destHotspotId = 0;
+	_blockedOffset = 0;
+	_exitCtr = 0;
+	_voiceCtr = 0;
+	_walkFlag = false;
+	_skipFlag = false;
+	_roomNumber = 0;
+	_destHotspotId = 0;
+	_startX = 0;
+	_startY = 0;
+	_destX = 0;
+	_destY = 0;
+	_layer = 0;
+	_height = 0;
+	_width = 0;
+	_heightCopy = 0;
+	_widthCopy = 0;
+	_yCorrection = 0;
+	_tickCtr = 0;
+	_tickHandler = NULL;
+	_frameWidth = _width;
+	_frameStartsUsed = false;
+}
+
 Hotspot::~Hotspot() {
 	if (_frames) delete _frames;
 }
@@ -869,7 +903,7 @@
 				return PC_WAIT;
 
 		} else if (hotspot->actionHotspotId != _hotspotId) {
-			if (fields.getField(82) != 2) {
+			if (fields.getField(AREA_FLAG) != 2) {
 				showMessage(5, hotspot->hotspotId);
 				setDelayCtr(4);
 			}
@@ -1294,8 +1328,8 @@
 	joinRec = res.getExitJoin(hotspot->hotspotId);
 	if (!joinRec->blocked) {
 		// Close the door
-		if (!doorCloseCheck(joinRec->hotspot1Id) ||
-			!doorCloseCheck(joinRec->hotspot2Id)) {
+		if (!doorCloseCheck(joinRec->hotspots[0].hotspotId) ||
+			!doorCloseCheck(joinRec->hotspots[1].hotspotId)) {
 			// A character is preventing the door from closing
 			showMessage(2);
 		} else {
@@ -2587,38 +2621,37 @@
 
 void HotspotTickHandlers::roomExitAnimHandler(Hotspot &h) {
 	Resources &res = Resources::getReference();
-//	ValueTableData &fields = res.fieldList();
+	ValueTableData &fields = res.fieldList();
+	Room &room = Room::getReference();
+
 	RoomExitJoinData *rec = res.getExitJoin(h.hotspotId());
 	if (!rec) return;
-	byte *currentFrame, *destFrame;
+	RoomExitJoinStruct &rs = (rec->hotspots[0].hotspotId == h.hotspotId()) ? 
+		rec->hotspots[0] : rec->hotspots[1];
 
-	if (rec->hotspot1Id == h.hotspotId()) {
-		currentFrame = &rec->h1CurrentFrame; 
-		destFrame = &rec->h1DestFrame;
-	} else {
-		currentFrame = &rec->h2CurrentFrame;
-		destFrame = &rec->h2DestFrame;
-	}
-	
-	if ((rec->blocked != 0) && (*currentFrame != *destFrame)) {
+	if ((rec->blocked != 0) && (rs.currentFrame != rs.destFrame)) {
 		// Closing the door
 		h.setOccupied(true);
 
-		++*currentFrame;
-		if (*currentFrame == *destFrame) {
-			// TODO: play closed door sound
-		}
-	} else if ((rec->blocked == 0) && (*currentFrame != 0)) {
+		++rs.currentFrame;
+		if ((rs.currentFrame == rs.destFrame) && (h.hotspotId() == room.roomNumber()))
+			Sound.addSound(rs.closeSound);
+
+	} else if ((rec->blocked == 0) && (rs.currentFrame != 0)) {
 		// Opening the door
 		h.setOccupied(false);
 
-		--*currentFrame;
-		if (*currentFrame == *destFrame) {
-			//TODO: Check against script val 88 and play sound
+		--rs.currentFrame;
+		if ((rs.currentFrame == rs.destFrame) && (h.hotspotId() == room.roomNumber())) {
+			Sound.addSound(rs.openSound);
+			
+			// If in the outside village, trash reverb
+			if (fields.getField(AREA_FLAG) == 1)
+				Sound.musicInterface_TrashReverb();
 		}
 	}
 
-	h.setFrameNumber(*currentFrame);
+	h.setFrameNumber(rs.currentFrame);
 }
 
 void HotspotTickHandlers::playerAnimHandler(Hotspot &h) {
@@ -2931,10 +2964,11 @@
 void HotspotTickHandlers::jailorAnimHandler(Hotspot &h) {
 	Resources &res = Resources::getReference();
 	ValueTableData &fields = res.fieldList();
+	Game &game = Game::getReference();
 	HotspotData *player = res.getHotspot(PLAYER_ID);
 
 	if ((fields.getField(11) != 0) || (h.hotspotId() == CASTLE_SKORL_ID)) {
-		if (!h.skipFlag() && (h.roomNumber() == player->roomNumber)) {
+		if (!h.skipFlag() && !game.preloadFlag() && (h.roomNumber() == player->roomNumber)) {
 			if (Support::charactersIntersecting(h.resource(), player)) {
 				// Skorl has caught the player
 				Game::getReference().setState(GS_RESTORE_RESTART | GS_CAUGHT);
@@ -2966,6 +3000,9 @@
 			res.deactivateHotspot(h.hotspotId());
 			res.activateHotspot(0x41C);
 
+			// Add sound
+			Sound.addSound(8);			
+
 			// Enable the fire and activate its animation
 			HotspotData *fire = res.getHotspot(0x418);
 			fire->flags |= 0x80;

Modified: scummvm/trunk/engines/lure/hotspots.h
===================================================================
--- scummvm/trunk/engines/lure/hotspots.h	2007-08-12 11:17:48 UTC (rev 28551)
+++ scummvm/trunk/engines/lure/hotspots.h	2007-08-12 11:19:01 UTC (rev 28552)
@@ -345,6 +345,7 @@
 public:
 	Hotspot(HotspotData *res);
 	Hotspot(Hotspot *character, uint16 objType);
+	Hotspot();
 	~Hotspot();
 
 	void setAnimation(uint16 newAnimId);


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