[Scummvm-cvs-logs] CVS: scummvm/sword2 sound.cpp,1.37,1.38

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Sat Jan 3 03:25:08 CET 2004


Update of /cvsroot/scummvm/scummvm/sword2
In directory sc8-pr-cvs1:/tmp/cvs-serv20292

Modified Files:
	sound.cpp 
Log Message:
Made the music code more like the one in BS1, i.e. the fade time is longer
and it now fades both up and down.

Plenty of cleanups, simplifications and just moving code around to group it
in what I hope is a more logical fashion.

Fixed a long-standing bug where spot effects would eventually use up all
available sound effect handles. (I may have introduced this when I removed
the expiration of sound effects from FxServer().)


Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/sound.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- sound.cpp	29 Dec 2003 15:30:10 -0000	1.37
+++ sound.cpp	3 Jan 2004 11:24:39 -0000	1.38
@@ -67,8 +67,10 @@
 			break;
 		case FX_SPOT2:
 			// Once the Fx has finished remove it from the queue.
-			if (_sound->isFxOpen(i + 1))
+			if (!_sound->isFxPlaying(i + 1)) {
 				_fxQueue[i].resource = 0;
+				_sound->closeFx(i + 1);
+			}
 			break;
 		}
 	}
@@ -178,6 +180,7 @@
 			break;
 		default:
 			strcpy(type, "INVALID");
+			break;
 		}
 
 		debug(0, "SFX (sample=\"%s\", vol=%d, pan=%d, delay=%d, type=%s)", _vm->fetchObjectName(params[0]), params[3], params[4], params[2], type);
@@ -244,7 +247,7 @@
 	}
 
 	if (_vm->_fxQueue[j].type == FX_LOOP) {
-		// play now, rather than in Process_fx_queue where it was
+		// play now, rather than in processFxQueue where it was
 		// getting played again & again!
 		_vm->triggerFx(j);
 	}





More information about the Scummvm-git-logs mailing list