[Scummvm-cvs-logs] CVS: scummvm/scumm script_v5.cpp,1.15,1.16

Max Horn fingolfin at users.sourceforge.net
Sun Mar 9 18:56:07 CET 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv30997

Modified Files:
	script_v5.cpp 
Log Message:
cleanup CD opcode a bit; slightly increase the 'delay' -> sounds better since speakers are not cut off abruptly anymore

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- script_v5.cpp	6 Mar 2003 21:46:18 -0000	1.15
+++ script_v5.cpp	10 Mar 2003 02:55:50 -0000	1.16
@@ -2411,21 +2411,25 @@
 		case 7:										/* overhead */
 			_string[textSlot].overhead = true;
 			break;
-		case 8:{										/* play loom talkie sound - use in other games ? */
-				int x = getVarOrDirectWord(0x80);
-				int offset;
-				int delay;
+		case 8:{									/* play loom talkie sound - used in other games ? */
+				int offset = (uint16)getVarOrDirectWord(0x80);
+				int delay = (uint16)getVarOrDirectWord(0x40);
 
-				if (x != 0)
-					offset = (int)((x & 0xffff) * 7.5 - 22650);
-				else
-					offset = 0;
-				delay = (int)((getVarOrDirectWord(0x40) & 0xffff) * 7.5);
 				if (_gameId == GID_LOOM256) {
 					_vars[VAR_MI1_TIMER] = 0;
 					if (offset == 0 && delay == 0) {
 						_sound->stopCD();
 					} else {
+						// Loom specified the offset from the start of the CD;
+						// thus we have to subtract the lenght of the first track
+						// (22500 frames) plus the 2 second = 150 frame leadin.
+						// I.e. in total 22650 frames.
+						offset = (int)(offset * 7.5 - 22650);
+
+						// Slightly increase the delay (5 frames = 1/25 of a second).
+						// This noticably improves the experience in Loom CD.
+						delay = (int)(delay * 7.5 + 5);
+						
 						_sound->playCDTrack(1, 0, offset, delay);
 					}
 				} else {





More information about the Scummvm-git-logs mailing list