mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-05 18:41:12 +00:00
SCI/new music code:
- sounds are no longer stopped in cmdUpdateCues if their signal is set - cmdSetSoundVolume no longer throws a warning if it can't find the associated sound (in some games, it's called before the actual sound is loaded) - removed unused parameters to the SciMusic() class and to MusicEntry::onTimer() - removed a hack to get the sound loop selector svn-id: r46923
This commit is contained in:
parent
2861cab322
commit
72a020320f
@ -37,7 +37,7 @@
|
||||
|
||||
namespace Sci {
|
||||
|
||||
SciMusic::SciMusic(ResourceManager *resMan, SegManager *segMan, SciVersion soundVersion)
|
||||
SciMusic::SciMusic(SciVersion soundVersion)
|
||||
: _soundVersion(soundVersion), _soundOn(true) {
|
||||
|
||||
// Reserve some space in the playlist, to avoid expensive insertion
|
||||
@ -365,7 +365,7 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) {
|
||||
void SciMusic::onTimer() {
|
||||
const MusicList::iterator end = _playList.end();
|
||||
for (MusicList::iterator i = _playList.begin(); i != end; ++i)
|
||||
(*i)->onTimer(_soundVersion);
|
||||
(*i)->onTimer();
|
||||
}
|
||||
|
||||
void SciMusic::soundPlay(MusicEntry *pSnd) {
|
||||
@ -383,11 +383,9 @@ void SciMusic::soundPlay(MusicEntry *pSnd) {
|
||||
_mutex.unlock(); // unlock to perform mixer-related calls
|
||||
|
||||
if (pSnd->pStreamAud && !_pMixer->isSoundHandleActive(pSnd->hCurrentAud)) {
|
||||
SegManager *segMan = ((SciEngine *)g_engine)->getEngineState()->_segMan; // HACK
|
||||
uint16 loop = GET_SEL32V(segMan, pSnd->soundObj, loop);
|
||||
// Are we supposed to loop the stream?
|
||||
if (loop > 1)
|
||||
pSnd->pStreamAud->setNumLoops(loop);
|
||||
if (pSnd->loop > 1)
|
||||
pSnd->pStreamAud->setNumLoops(pSnd->loop);
|
||||
else
|
||||
pSnd->pStreamAud->setNumLoops(1);
|
||||
_pMixer->playInputStream(pSnd->soundType, &pSnd->hCurrentAud,
|
||||
@ -549,7 +547,7 @@ MusicEntry::MusicEntry() {
|
||||
MusicEntry::~MusicEntry() {
|
||||
}
|
||||
|
||||
void MusicEntry::onTimer(SciVersion soundVersion) {
|
||||
void MusicEntry::onTimer() {
|
||||
if (status != kSoundPlaying)
|
||||
return;
|
||||
|
||||
|
@ -112,7 +112,7 @@ public:
|
||||
~MusicEntry();
|
||||
|
||||
void doFade();
|
||||
void onTimer(SciVersion soundVersion);
|
||||
void onTimer();
|
||||
|
||||
#ifndef USE_OLD_MUSIC_FUNCTIONS
|
||||
virtual void saveLoadWithSerializer(Common::Serializer &ser);
|
||||
@ -128,7 +128,7 @@ class SciMusic
|
||||
{
|
||||
|
||||
public:
|
||||
SciMusic(ResourceManager *resMan, SegManager *segMan, SciVersion soundVersion);
|
||||
SciMusic(SciVersion soundVersion);
|
||||
~SciMusic();
|
||||
|
||||
void init();
|
||||
|
@ -134,7 +134,7 @@ SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segM
|
||||
#endif
|
||||
|
||||
#ifndef USE_OLD_MUSIC_FUNCTIONS
|
||||
_music = new SciMusic(_resMan, _segMan, _soundVersion);
|
||||
_music = new SciMusic(_soundVersion);
|
||||
_music->init();
|
||||
#endif
|
||||
|
||||
@ -796,7 +796,7 @@ void SoundCommandParser::cmdUpdateCues(reg_t obj, int16 value) {
|
||||
}
|
||||
break;
|
||||
case SIGNAL_OFFSET:
|
||||
cmdStopSound(obj, 0);
|
||||
PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET);
|
||||
break;
|
||||
default:
|
||||
// Sync the signal of the sound object
|
||||
@ -885,7 +885,11 @@ void SoundCommandParser::cmdSetSoundVolume(reg_t obj, int16 value) {
|
||||
#ifndef USE_OLD_MUSIC_FUNCTIONS
|
||||
MusicEntry *musicSlot = _music->getSlot(obj);
|
||||
if (!musicSlot) {
|
||||
warning("cmdSetSoundVolume: Slot not found (%04x:%04x)", PRINT_REG(obj));
|
||||
// Do not throw a warning if the sound can't be found, as in some games
|
||||
// this is called before the actual sound is loaded (e.g. SQ4CD, with the
|
||||
// drum sounds of the energizer bunny at the beginning), so this is normal
|
||||
// behavior
|
||||
//warning("cmdSetSoundVolume: Slot not found (%04x:%04x)", PRINT_REG(obj));
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user