[Scummvm-cvs-logs] SF.net SVN: scummvm:[49105] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Wed May 19 19:16:16 CEST 2010


Revision: 49105
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49105&view=rev
Author:   peres001
Date:     2010-05-19 17:16:15 +0000 (Wed, 19 May 2010)

Log Message:
-----------
Add a parser for HEAR zones in BRA, and handle the relative MUSIC command. Patch 3003382 by fuzzie, with enhancements.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/objects.h
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parser.h
    scummvm/trunk/engines/parallaction/parser_br.cpp

Modified: scummvm/trunk/engines/parallaction/objects.h
===================================================================
--- scummvm/trunk/engines/parallaction/objects.h	2010-05-19 17:11:15 UTC (rev 49104)
+++ scummvm/trunk/engines/parallaction/objects.h	2010-05-19 17:16:15 UTC (rev 49105)
@@ -186,7 +186,9 @@
 	~Dialogue();
 };
 
-#define MAX_WALKPOINT_LISTS 20
+#define MAX_WALKPOINT_LISTS 	20
+#define FREE_HEAR_CHANNEL		-1
+#define MUSIC_HEAR_CHANNEL		-2
 
 struct TypeData {
 	// common
@@ -232,7 +234,7 @@
 		_doorStartFrame2_br = 0;
 		_doorStartPos2_br.x = -1000;
 		_doorStartPos2_br.y = -1000;
-		_hearChannel = -1;
+		_hearChannel = FREE_HEAR_CHANNEL;
 		_hearFreq = -1;
 		_mergeObj1 = 0;
 		_mergeObj2 = 0;

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2010-05-19 17:11:15 UTC (rev 49104)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2010-05-19 17:16:15 UTC (rev 49105)
@@ -591,10 +591,15 @@
 		break;
 
 	case kZoneHear:
-		_soundMan->execute(SC_SETSFXCHANNEL, z->u._hearChannel);
-		_soundMan->execute(SC_SETSFXLOOPING, (int)((z->_flags & kFlagsLooping) == kFlagsLooping));
-		_soundMan->execute(SC_SETSFXVOLUME, 60);
-		_soundMan->execute(SC_PLAYSFX, z->u._filename.c_str());
+		if (z->u._hearChannel == MUSIC_HEAR_CHANNEL) {
+			_soundMan->execute(SC_SETMUSICFILE, z->u._filename.c_str());
+			_soundMan->execute(SC_PLAYMUSIC);
+		} else {
+			_soundMan->execute(SC_SETSFXCHANNEL, z->u._hearChannel);
+			_soundMan->execute(SC_SETSFXLOOPING, (int)((z->_flags & kFlagsLooping) == kFlagsLooping));
+			_soundMan->execute(SC_SETSFXVOLUME, 60);
+			_soundMan->execute(SC_PLAYSFX, z->u._filename.c_str());
+		}
 		break;
 
 	case kZoneSpeak:

Modified: scummvm/trunk/engines/parallaction/parser.h
===================================================================
--- scummvm/trunk/engines/parallaction/parser.h	2010-05-19 17:11:15 UTC (rev 49104)
+++ scummvm/trunk/engines/parallaction/parser.h	2010-05-19 17:16:15 UTC (rev 49105)
@@ -293,6 +293,7 @@
 	virtual void	parsePathData(ZonePtr z);
 	virtual void	parseGetData(ZonePtr z);
 	virtual void	parseDoorData(ZonePtr z);
+	virtual void	parseHearData(ZonePtr z);
 protected:
 	void	parseAnswerCounter(Answer *answer);
 	virtual Answer *parseAnswer();

Modified: scummvm/trunk/engines/parallaction/parser_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser_br.cpp	2010-05-19 17:11:15 UTC (rev 49104)
+++ scummvm/trunk/engines/parallaction/parser_br.cpp	2010-05-19 17:16:15 UTC (rev 49105)
@@ -808,6 +808,23 @@
 	}
 }
 
+void LocationParser_br::parseHearData(ZonePtr z) {
+	TypeData *data = &z->u;
+	if (!scumm_stricmp(_tokens[0], "sound")) {
+		assert(!data->_filename.size());
+		data->_filename = _tokens[1];
+		data->_hearChannel = atoi(_tokens[2]);
+	} else
+	if (!scumm_stricmp(_tokens[0], "freq")) {
+		data->_hearFreq = atoi(_tokens[1]);
+	} else
+	if (!scumm_stricmp(_tokens[0], "music")) {
+		assert(data->_hearChannel == FREE_HEAR_CHANNEL);
+		data->_filename = _tokens[1];
+		data->_hearChannel = MUSIC_HEAR_CHANNEL;
+	}
+}
+
 typedef void (LocationParser_br::*ZoneTypeParser)(ZonePtr);
 static ZoneTypeParser parsers[] = {
 	0,	// no type


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