[Scummvm-cvs-logs] SF.net SVN: scummvm:[50765] scummvm/trunk/engines/sci/sound/soundcmd.cpp

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Fri Jul 9 20:11:42 CEST 2010


Revision: 50765
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50765&view=rev
Author:   m_kiewitz
Date:     2010-07-09 18:11:42 +0000 (Fri, 09 Jul 2010)

Log Message:
-----------
SCI: move comments and change selector for sci0 sound in kDoSoundPause, also allow pausing everything even for sci1early (qfg2 is using it)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/sound/soundcmd.cpp

Modified: scummvm/trunk/engines/sci/sound/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/soundcmd.cpp	2010-07-09 17:25:45 UTC (rev 50764)
+++ scummvm/trunk/engines/sci/sound/soundcmd.cpp	2010-07-09 18:11:42 UTC (rev 50765)
@@ -210,16 +210,21 @@
 
 reg_t SoundCommandParser::kDoSoundPause(int argc, reg_t *argv, reg_t acc) {
 	if (_soundVersion <= SCI_VERSION_0_LATE) {
+		// SCI0 games give us 0/1 for either resuming or pausing the current music
+		//  this one doesn't count, so pausing 2 times and resuming once means here that we are supposed to resume
 		uint16 value = argv[0].toUint16();
 		MusicEntry *musicSlot = _music->getActiveSci0MusicSlot();
 		switch (value) {
 		case 1:
-			if ((musicSlot) && (musicSlot->status == kSoundPlaying))
+			if ((musicSlot) && (musicSlot->status == kSoundPlaying)) {
 				_music->soundPause(musicSlot);
+				writeSelectorValue(_segMan, musicSlot->soundObj, SELECTOR(state), kSoundPaused);
+			}
 			return make_reg(0, 0);
 		case 0:
 			if ((musicSlot) && (musicSlot->status == kSoundPaused)) {
 				_music->soundResume(musicSlot);
+				writeSelectorValue(_segMan, musicSlot->soundObj, SELECTOR(state), kSoundPlaying);
 				return make_reg(0, 1);
 			}
 			return make_reg(0, 0);
@@ -231,13 +236,6 @@
 	reg_t obj = argv[0];
 	uint16 value = argc > 1 ? argv[1].toUint16() : 0;
 	if (!obj.segment) {		// pause the whole playlist
-		// SCI0 games (up to including qfg1) give us 0/1 for either resuming or pausing the current music
-		//  this one doesn't count, so pausing 2 times and resuming once means here that we are supposed to resume
-
-		// Pausing/Resuming the whole playlist was introduced in the SCI1 late sound scheme.
-		if (_soundVersion <= SCI_VERSION_1_EARLY)
-			return acc;
-
 		_music->pauseAll(value);
 	} else {	// pause a playlist slot
 		MusicEntry *musicSlot = _music->getSlot(obj);
@@ -246,13 +244,7 @@
 			return acc;
 		}
 
-		if (_soundVersion <= SCI_VERSION_0_LATE) {
-			// Always pause the sound in SCI0 games. It's resumed in cmdResumeSound()
-			writeSelectorValue(_segMan, musicSlot->soundObj, SELECTOR(state), kSoundPaused);
-			_music->soundPause(musicSlot);
-		} else {
-			_music->soundToggle(musicSlot, value);
-		}
+		_music->soundToggle(musicSlot, value);
 	}
 	return acc;
 }


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