[Scummvm-cvs-logs] SF.net SVN: scummvm:[46792] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu Dec 31 09:30:30 CET 2009


Revision: 46792
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46792&view=rev
Author:   thebluegr
Date:     2009-12-31 08:30:30 +0000 (Thu, 31 Dec 2009)

Log Message:
-----------
SCI/new music code: The loop selector for each music score is no longer cached, but read directly from the sound object

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/savegame.cpp
    scummvm/trunk/engines/sci/engine/savegame.h
    scummvm/trunk/engines/sci/sfx/midiparser.cpp
    scummvm/trunk/engines/sci/sfx/music.cpp
    scummvm/trunk/engines/sci/sfx/music.h
    scummvm/trunk/engines/sci/sfx/soundcmd.cpp

Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp	2009-12-31 08:10:51 UTC (rev 46791)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp	2009-12-31 08:30:30 UTC (rev 46792)
@@ -116,7 +116,7 @@
 		uint32 restoreTime = 0;
 		s.syncAsSint32LE(restoreTime);
 		ticker = restoreTime * 60 / 1000;
-		s.syncAsSint32LE(loop);
+		s.skip(4);	// loop
 		s.skip(4);	// hold
 		// volume and dataInc will be synced from the sound objects
 		// when the sound list is reconstructed in gamestate_restore()
@@ -134,7 +134,7 @@
 		s.syncAsSint16LE(dataInc);
 		s.syncAsSint16LE(ticker);
 		s.syncAsByte(prio);
-		s.syncAsByte(loop);
+		s.skip(1, VER(15), VER(15));
 		s.syncAsByte(volume);
 		s.syncAsByte(fadeTo);
 		s.syncAsSint16LE(fadeStep);

Modified: scummvm/trunk/engines/sci/engine/savegame.h
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.h	2009-12-31 08:10:51 UTC (rev 46791)
+++ scummvm/trunk/engines/sci/engine/savegame.h	2009-12-31 08:30:30 UTC (rev 46792)
@@ -36,7 +36,7 @@
 struct EngineState;
 
 enum {
-	CURRENT_SAVEGAME_VERSION = 15,
+	CURRENT_SAVEGAME_VERSION = 16,
 	MINIMUM_SAVEGAME_VERSION = 9
 };
 

Modified: scummvm/trunk/engines/sci/sfx/midiparser.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/midiparser.cpp	2009-12-31 08:10:51 UTC (rev 46791)
+++ scummvm/trunk/engines/sci/sfx/midiparser.cpp	2009-12-31 08:30:30 UTC (rev 46792)
@@ -200,10 +200,11 @@
 			info.ext.data = _position._play_pos;
 			_position._play_pos += info.length;
 			if (info.ext.type == 0x2F) {// end of track reached
-				if (_pSnd->loop)
-					_pSnd->loop--;
-				PUT_SEL32V(segMan, _pSnd->soundObj, loop, _pSnd->loop);
-				if (_pSnd->loop) {
+				int16 loop = GET_SEL32V(segMan, _pSnd->soundObj, loop);
+				if (loop)
+					loop--;
+				PUT_SEL32V(segMan, _pSnd->soundObj, loop, loop);
+				if (loop) {
 					// We need to play it again...
 					jumpToTick(_loopTick);
 				} else {

Modified: scummvm/trunk/engines/sci/sfx/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.cpp	2009-12-31 08:10:51 UTC (rev 46791)
+++ scummvm/trunk/engines/sci/sfx/music.cpp	2009-12-31 08:30:30 UTC (rev 46792)
@@ -557,7 +557,6 @@
 	dataInc = 0;
 	ticker = 0;
 	prio = 0;
-	loop = 0;
 	volume = 0;
 
 	pauseCounter = 0;

Modified: scummvm/trunk/engines/sci/sfx/music.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.h	2009-12-31 08:10:51 UTC (rev 46791)
+++ scummvm/trunk/engines/sci/sfx/music.h	2009-12-31 08:30:30 UTC (rev 46792)
@@ -73,7 +73,6 @@
 	uint16 dataInc;
 	uint16 ticker;
 	byte prio;
-	uint16 loop;
 	int16 volume;
 
 	int16 pauseCounter;

Modified: scummvm/trunk/engines/sci/sfx/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/soundcmd.cpp	2009-12-31 08:10:51 UTC (rev 46791)
+++ scummvm/trunk/engines/sci/sfx/soundcmd.cpp	2009-12-31 08:30:30 UTC (rev 46792)
@@ -288,7 +288,6 @@
 	if (number && _resMan->testResource(ResourceId(kResourceTypeSound, number)))
 		newSound->soundRes = new SoundResource(number, _resMan, _soundVersion);
 	newSound->soundObj = obj;
-	newSound->loop = GET_SEL32V(_segMan, obj, loop);
 	newSound->prio = GET_SEL32V(_segMan, obj, pri) & 0xFF;
 	newSound->volume = CLIP<int>(GET_SEL32V(_segMan, obj, vol), 0, Audio::Mixer::kMaxChannelVolume);
 
@@ -421,7 +420,6 @@
 		PUT_SEL32V(_segMan, obj, state, kSoundPlaying);
 	}
 
-	musicSlot->loop = GET_SEL32V(_segMan, obj, loop);
 	musicSlot->prio = GET_SEL32V(_segMan, obj, priority);
 	// vol selector doesnt get used before sci1late
 	if (_soundVersion < SCI_VERSION_1_LATE)
@@ -677,7 +675,6 @@
 		return;
 	}
 
-	musicSlot->loop = GET_SEL32V(_segMan, obj, loop);
 	int16 objVol = CLIP<int>(GET_SEL32V(_segMan, obj, vol), 0, 255);
 	if (objVol != musicSlot->volume)
 		_music->soundSetVolume(musicSlot, objVol);
@@ -895,11 +892,10 @@
 		return;
 	}
 	if (value == -1) {
-		musicSlot->loop = 0xFFFF;
+		PUT_SEL32V(_segMan, obj, loop, 0xFFFF);
 	} else {
-		musicSlot->loop = 1; // actually plays the music once
+		PUT_SEL32V(_segMan, obj, loop, 1); // actually plays the music once
 	}
-	PUT_SEL32V(_segMan, obj, loop, musicSlot->loop);
 #endif
 }
 


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