[Scummvm-cvs-logs] SF.net SVN: scummvm:[47252] scummvm/trunk/engines/sci/sound
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Mon Jan 11 15:26:18 CET 2010
Revision: 47252
http://scummvm.svn.sourceforge.net/scummvm/?rev=47252&view=rev
Author: thebluegr
Date: 2010-01-11 14:26:13 +0000 (Mon, 11 Jan 2010)
Log Message:
-----------
New music code: Implemented sound stopping after fading, and disabled MIDI sound volume fading, till we figure out what's wrong with fading in the Sierra logo screen in GK1
Modified Paths:
--------------
scummvm/trunk/engines/sci/sound/music.cpp
scummvm/trunk/engines/sci/sound/music.h
scummvm/trunk/engines/sci/sound/soundcmd.cpp
Modified: scummvm/trunk/engines/sci/sound/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/music.cpp 2010-01-11 14:12:52 UTC (rev 47251)
+++ scummvm/trunk/engines/sci/sound/music.cpp 2010-01-11 14:26:13 UTC (rev 47252)
@@ -36,6 +36,9 @@
namespace Sci {
+// When defined, volume fading immediately sets the final sound volume
+#define DISABLE_VOLUME_FADING
+
SciMusic::SciMusic(SciVersion soundVersion)
: _soundVersion(soundVersion), _soundOn(true) {
@@ -513,6 +516,7 @@
fadeTickerStep = 0;
fadeSetVolume = false;
fadeCompleted = false;
+ stopAfterFading = false;
status = kSoundStopped;
@@ -557,7 +561,11 @@
// Only process MIDI streams in this thread, not digital sound effects
if (pMidiParser)
+#ifndef DISABLE_VOLUME_FADING
pMidiParser->setVolume(volume);
+#else
+ pMidiParser->setVolume(fadeTo);
+#endif
fadeSetVolume = true; // set flag so that SoundCommandParser::cmdUpdateCues will set the volume of the stream
}
}
Modified: scummvm/trunk/engines/sci/sound/music.h
===================================================================
--- scummvm/trunk/engines/sci/sound/music.h 2010-01-11 14:12:52 UTC (rev 47251)
+++ scummvm/trunk/engines/sci/sound/music.h 2010-01-11 14:26:13 UTC (rev 47252)
@@ -95,6 +95,7 @@
uint32 fadeTickerStep;
bool fadeSetVolume;
bool fadeCompleted;
+ bool stopAfterFading;
SoundStatus status;
Modified: scummvm/trunk/engines/sci/sound/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/soundcmd.cpp 2010-01-11 14:12:52 UTC (rev 47251)
+++ scummvm/trunk/engines/sci/sound/soundcmd.cpp 2010-01-11 14:26:13 UTC (rev 47252)
@@ -669,12 +669,13 @@
musicSlot->fadeTicker = 0;
break;
- case 5: // Possibly SCI1?!
- case 6: // SCI 1.1 TODO: find out what additional parameter is
+ case 5: // SCI01+
+ case 6: // SCI1+ (SCI1 late sound scheme), with fade and continue
musicSlot->fadeTo = CLIP<uint16>(_argv[2].toUint16(), 0, MUSIC_VOLUME_MAX);
musicSlot->fadeStep = volume > _argv[2].toUint16() ? -_argv[4].toUint16() : _argv[4].toUint16();
musicSlot->fadeTickerStep = _argv[3].toUint16() * 16667 / _music->soundGetTempo();
musicSlot->fadeTicker = 0;
+ musicSlot->stopAfterFading = (_argc == 6) ? (_argv[5].toUint16() != 0) : false;
break;
default:
@@ -846,6 +847,8 @@
cmdStopSound(obj, 0);
} else {
PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET);
+ if (musicSlot->stopAfterFading)
+ cmdStopSound(obj, 0);
}
}
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