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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Jul 8 10:13:32 CEST 2007


Revision: 27958
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27958&view=rev
Author:   peres001
Date:     2007-07-08 01:13:32 -0700 (Sun, 08 Jul 2007)

Log Message:
-----------
Location background sound (different from music) now implemented.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/location.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction.h

Modified: scummvm/trunk/engines/parallaction/location.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/location.cpp	2007-07-08 07:19:50 UTC (rev 27957)
+++ scummvm/trunk/engines/parallaction/location.cpp	2007-07-08 08:13:32 UTC (rev 27958)
@@ -38,6 +38,7 @@
 	_gfx->setFont(kFontLabel);
 
 	Script *_locationScript = _disk->loadLocation(filename);
+	_hasLocationSound = false;
 
 	fillBuffers(*_locationScript, true);
 	while (scumm_stricmp(_tokens[0], "ENDLOCATION")) {
@@ -140,16 +141,15 @@
 			parseAnimation(*_locationScript, _animations, _tokens[1]);
 		}
 		if (!scumm_stricmp(_tokens[0], "SOUND")) {
-			strcpy(_soundFile, _tokens[1]);
+			if (getPlatform() == Common::kPlatformAmiga) {
+				strcpy(_locationSound, _tokens[1]);
+				_hasLocationSound = true;
+			}
 		}
 		if (!scumm_stricmp(_tokens[0], "MUSIC")) {
 			if (getPlatform() == Common::kPlatformAmiga)
 				_soundMan->setMusicFile(_tokens[1]);
 		}
-		if (!scumm_stricmp(_tokens[0], "SOUND")) {
-//			if (getPlatform() == Common::kPlatformAmiga)
-//				_soundMan->loadSfx(_tokens[1], atoi(_tokens[2]));
-		}
 		fillBuffers(*_locationScript, true);
 	}
 
@@ -182,14 +182,14 @@
 
 	if (_localFlagNames)
 		delete _localFlagNames;
-	
+
 	// HACK: prevents leakage. A routine like this
 	// should allocate memory at all, though.
 	if ((_engineFlags & kEngineQuit) == 0) {
 		_localFlagNames = new Table(120);
 		_localFlagNames->addData("visited");
 	}
-		
+
 	_location._walkNodes.clear();
 
 	// TODO (LIST): helperNode should be rendered useless by the use of a Common::List<>
@@ -379,11 +379,11 @@
 		runJobs();
 		_gfx->swapBuffers();
 	}
-	
+
 	if (_location._comment) {
 		doLocationEnterTransition();
 	}
-	
+
 	runJobs();
 	_gfx->swapBuffers();
 
@@ -392,7 +392,8 @@
 		runCommands(_location._aCommands);
 	}
 
-//	_soundMan->playSfx(0);
+	if (_hasLocationSound)
+		_soundMan->playSfx(_locationSound, 0, true);
 
 	debugC(1, kDebugLocation, "changeLocation() done");
 
@@ -416,7 +417,7 @@
         debugC(3, kDebugLocation, "skipping location transition");
         return; // visited
     }
- 
+
 	byte pal[PALETTE_SIZE];
 	_gfx->buildBWPalette(pal);
 	_gfx->setPalette(pal);

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-07-08 07:19:50 UTC (rev 27957)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-07-08 08:13:32 UTC (rev 27958)
@@ -84,7 +84,6 @@
 
 char		_forwardedAnimationNames[20][20];
 uint16		_numForwards = 0;
-char		_soundFile[20];
 
 uint32		_commandFlags = 0;
 uint16		_introSarcData3 = 200;
@@ -158,6 +157,8 @@
 	_localFlagNames = NULL;
 	initResources();
 
+	_hasLocationSound = false;
+
 	_skipMenu = false;
 
 	_transCurrentHoverItem = 0;
@@ -369,6 +370,9 @@
 	if (_location._comment)
 		doLocationEnterTransition();
 
+	if (_hasLocationSound)
+		_soundMan->playSfx(_locationSound, 0, true);
+
 	changeCursor(kCursorArrow);
 
 	if (_location._aCommands.size() > 0)

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2007-07-08 07:19:50 UTC (rev 27957)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2007-07-08 08:13:32 UTC (rev 27958)
@@ -176,7 +176,6 @@
 extern Command 		*_forwardedCommands[];
 extern char 		_forwardedAnimationNames[][20];
 extern uint16 		_numForwards;
-extern char 		_soundFile[];
 extern char 		_slideText[][40];
 extern uint16 		_introSarcData3;		 // sarcophagus stuff to be saved
 extern uint16 		_introSarcData2;		 // sarcophagus stuff to be saved
@@ -416,7 +415,10 @@
 
 	Common::String      _saveFileName;
 
+	bool		_hasLocationSound;
+	char		_locationSound[50];
 
+
 protected:		// members
 	bool detectGame(void);
 


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