[Scummvm-cvs-logs] SF.net SVN: scummvm:[41185] scummvm/trunk/engines/scumm/he

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Fri Jun 5 02:57:58 CEST 2009


Revision: 41185
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41185&view=rev
Author:   Kirben
Date:     2009-06-05 00:57:58 +0000 (Fri, 05 Jun 2009)

Log Message:
-----------
Update sound code in HE80+ games, for sound rate differences.

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/he/sound_he.cpp
    scummvm/trunk/engines/scumm/he/sound_he.h

Modified: scummvm/trunk/engines/scumm/he/sound_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/sound_he.cpp	2009-06-05 00:33:25 UTC (rev 41184)
+++ scummvm/trunk/engines/scumm/he/sound_he.cpp	2009-06-05 00:57:58 UTC (rev 41185)
@@ -158,6 +158,7 @@
 		if (_heChannel[i].sound == sound) {
 			_heChannel[i].sound = 0;
 			_heChannel[i].priority = 0;
+			_heChannel[i].rate = 0;
 			_heChannel[i].timer = 0;
 			_heChannel[i].sbngBlock = 0;
 			_heChannel[i].codeOffs = 0;
@@ -196,6 +197,7 @@
 
 	_heChannel[chan].sound = 0;
 	_heChannel[chan].priority = 0;
+	_heChannel[chan].rate = 0;
 	_heChannel[chan].timer = 0;
 	_heChannel[chan].sbngBlock = 0;
 	_heChannel[chan].codeOffs = 0;
@@ -254,7 +256,7 @@
 	}
 
 	if (_mixer->isSoundHandleActive(_heSoundChannels[chan]) && chan != -1) {
-		int time =  _vm->getHETimer(chan + 4) * 11025 / 1000;
+		int time =  _vm->getHETimer(chan + 4) * _heChannel[chan].rate / 1000;
 		return time;
 	} else {
 		return 0;
@@ -360,7 +362,7 @@
 			continue;
 		}
 
-		tmr = _vm->getHETimer(chan + 4) * 11025 / 1000;
+		tmr = _vm->getHETimer(chan + 4) * _heChannel[chan].rate / 1000;
 		tmr += _vm->VAR(_vm->VAR_SOUNDCODE_TMR);
 		if (tmr < 0)
 			tmr = 0;
@@ -407,6 +409,7 @@
 
 			_heChannel[chan].sound = 0;
 			_heChannel[chan].priority = 0;
+			_heChannel[chan].rate = 0;
 			_heChannel[chan].timer = 0;
 			_heChannel[chan].sbngBlock = 0;
 			_heChannel[chan].codeOffs = 0;
@@ -625,6 +628,7 @@
 		_vm->setHETimer(heChannel + 4);
 		_heChannel[heChannel].sound = soundID;
 		_heChannel[heChannel].priority = priority;
+		_heChannel[heChannel].rate = rate;
 		_heChannel[heChannel].sbngBlock = (codeOffs != -1) ? 1 : 0;
 		_heChannel[heChannel].codeOffs = codeOffs;
 		memset(_heChannel[heChannel].soundVars, 0, sizeof(_heChannel[heChannel].soundVars));
@@ -646,6 +650,7 @@
 			size *= 2; // 16bits.
 			delete voxStream;
 
+			_heChannel[heChannel].rate = rate;
 			if (_heChannel[heChannel].timer)
 				_heChannel[heChannel].timer = size * 1000 / rate;
 
@@ -696,6 +701,7 @@
 		_vm->setHETimer(heChannel + 4);
 		_heChannel[heChannel].sound = soundID;
 		_heChannel[heChannel].priority = priority;
+		_heChannel[heChannel].rate = rate;
 		_heChannel[heChannel].sbngBlock = (codeOffs != -1) ? 1 : 0;
 		_heChannel[heChannel].codeOffs = codeOffs;
 		memset(_heChannel[heChannel].soundVars, 0, sizeof(_heChannel[heChannel].soundVars));

Modified: scummvm/trunk/engines/scumm/he/sound_he.h
===================================================================
--- scummvm/trunk/engines/scumm/he/sound_he.h	2009-06-05 00:33:25 UTC (rev 41184)
+++ scummvm/trunk/engines/scumm/he/sound_he.h	2009-06-05 00:57:58 UTC (rev 41185)
@@ -53,6 +53,7 @@
 		int sound;
 		int codeOffs;
 		int priority;
+		int rate;
 		int timer;
 		int sbngBlock;
 		int soundVars[27];


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