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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sat Jan 2 09:15:05 CET 2010


Revision: 46875
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46875&view=rev
Author:   m_kiewitz
Date:     2010-01-02 08:15:01 +0000 (Sat, 02 Jan 2010)

Log Message:
-----------
SCI/newmusic: set default volume on MusicEntry creation, use volume selector sci1late (soundversion) only

Modified Paths:
--------------
    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/sfx/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.cpp	2010-01-02 03:44:40 UTC (rev 46874)
+++ scummvm/trunk/engines/sci/sfx/music.cpp	2010-01-02 08:15:01 UTC (rev 46875)
@@ -524,7 +524,7 @@
 	signal = 0;
 	prio = 0;
 	loop = 0;
-	volume = 0;
+	volume = MUSIC_VOLUME_DEFAULT;
 	hold = 0;
 
 	pauseCounter = 0;

Modified: scummvm/trunk/engines/sci/sfx/music.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.h	2010-01-02 03:44:40 UTC (rev 46874)
+++ scummvm/trunk/engines/sci/sfx/music.h	2010-01-02 08:15:01 UTC (rev 46875)
@@ -56,7 +56,7 @@
 	kSoundPlaying = 3
 };
 
-#define MUSIC_VOLUME_FOR_SCI0 127
+#define MUSIC_VOLUME_DEFAULT 127
 #define MUSIC_VOLUME_MAX 127
 
 class MidiParser_SCI;

Modified: scummvm/trunk/engines/sci/sfx/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/soundcmd.cpp	2010-01-02 03:44:40 UTC (rev 46874)
+++ scummvm/trunk/engines/sci/sfx/soundcmd.cpp	2010-01-02 08:15:01 UTC (rev 46875)
@@ -280,7 +280,8 @@
 	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, MUSIC_VOLUME_MAX);
+	if (_soundVersion >= SCI_VERSION_1_LATE)
+		newSound->volume = CLIP<int>(GET_SEL32V(_segMan, obj, vol), 0, MUSIC_VOLUME_MAX);
 
 	// Check if a track with the same sound object is already playing
 	MusicEntry *oldSound = _music->getSlot(obj);
@@ -418,10 +419,7 @@
 
 	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)
-		musicSlot->volume = MUSIC_VOLUME_FOR_SCI0;
-	else
+	if (_soundVersion >= SCI_VERSION_1_LATE)
 		musicSlot->volume = GET_SEL32V(_segMan, obj, vol);
 	_music->soundPlay(musicSlot);
 
@@ -641,7 +639,6 @@
 	}
 
 	int volume = musicSlot->volume;
-	PUT_SEL32V(_segMan, musicSlot->soundObj, vol, volume);
 	musicSlot->fadeTo = _argv[2].toUint16();
 	musicSlot->fadeStep = volume > _argv[2].toUint16() ? -_argv[4].toUint16() : _argv[4].toUint16();
 	musicSlot->fadeTickerStep = _argv[3].toUint16() * 16667 / _music->soundGetTempo();
@@ -1018,10 +1015,8 @@
 			(*i)->dataInc = GET_SEL32V(_segMan, (*i)->soundObj, dataInc);
 			(*i)->signal = GET_SEL32V(_segMan, (*i)->soundObj, signal);
 
-			if (_soundVersion >= SCI_VERSION_1_EARLY)
+			if (_soundVersion >= SCI_VERSION_1_LATE)
 				(*i)->volume = GET_SEL32V(_segMan, (*i)->soundObj, vol);
-			else
-				(*i)->volume = MUSIC_VOLUME_FOR_SCI0;
 		}
 
 		(*i)->soundRes = new SoundResource((*i)->resnum, _resMan, _soundVersion);


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