aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he
diff options
context:
space:
mode:
authorMax Horn2010-01-19 00:56:29 +0000
committerMax Horn2010-01-19 00:56:29 +0000
commit557bb394de6619dd1f360b72333fd2ec7b3defab (patch)
treeb1166a12105d01c92edb528177d24aa5115232e5 /engines/scumm/he
parent69be7476212916b166ac16db41253cd367fb0dcc (diff)
downloadscummvm-rg350-557bb394de6619dd1f360b72333fd2ec7b3defab.tar.gz
scummvm-rg350-557bb394de6619dd1f360b72333fd2ec7b3defab.tar.bz2
scummvm-rg350-557bb394de6619dd1f360b72333fd2ec7b3defab.zip
Get rid of Mixer::FLAG_AUTOFREE.
Also fix several recently introduced new/delete vs. malloc/free mismatches. svn-id: r47369
Diffstat (limited to 'engines/scumm/he')
-rw-r--r--engines/scumm/he/cup_player_he.cpp2
-rw-r--r--engines/scumm/he/sound_he.cpp15
2 files changed, 7 insertions, 10 deletions
diff --git a/engines/scumm/he/cup_player_he.cpp b/engines/scumm/he/cup_player_he.cpp
index dc4eafe56b..ea8f9e9f8a 100644
--- a/engines/scumm/he/cup_player_he.cpp
+++ b/engines/scumm/he/cup_player_he.cpp
@@ -176,7 +176,7 @@ void CUP_Player::updateSfx() {
loopEnd = soundSize - 8;
}
_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &sfxChannel->handle,
- Audio::makeRawMemoryStream(soundData + 8, soundSize - 8, 11025, flags, 0, loopEnd));
+ Audio::makeRawMemoryStream(soundData + 8, soundSize - 8, DisposeAfterUse::NO, 11025, flags, 0, loopEnd));
}
} else {
warning("Unable to find a free channel to play sound %d", sfx->num);
diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp
index bd003033c7..d4e1e407a8 100644
--- a/engines/scumm/he/sound_he.cpp
+++ b/engines/scumm/he/sound_he.cpp
@@ -572,7 +572,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags)
musicFile.close();
if (_vm->_game.heversion == 70) {
- _mixer->playRaw(type, &_heSoundChannels[heChannel], spoolPtr, size, 11025, flags, soundID);
+ _mixer->playRaw(type, &_heSoundChannels[heChannel], spoolPtr, size, DisposeAfterUse::NO, 11025, flags, soundID);
return;
}
}
@@ -657,17 +657,15 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags)
if (_heChannel[heChannel].timer)
_heChannel[heChannel].timer = size * 1000 / rate;
- flags |= Audio::Mixer::FLAG_AUTOFREE;
-
// makeADPCMStream returns a stream in native endianness, but RawMemoryStream (and playRaw)
// defaults to big endian. If we're on a little endian system, set the LE flag.
#ifdef SCUMM_LITTLE_ENDIAN
flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN;
#endif
-
- _mixer->playRaw(type, &_heSoundChannels[heChannel], sound + heOffset, size - heOffset, rate, flags, soundID);
+
+ _mixer->playRaw(type, &_heSoundChannels[heChannel], sound + heOffset, size - heOffset, DisposeAfterUse::YES, rate, flags, soundID);
} else {
- _mixer->playRaw(type, &_heSoundChannels[heChannel], ptr + stream.pos() + heOffset, size - heOffset, rate, flags, soundID);
+ _mixer->playRaw(type, &_heSoundChannels[heChannel], ptr + stream.pos() + heOffset, size - heOffset, DisposeAfterUse::YES, rate, flags, soundID);
}
}
// Support for sound in Humongous Entertainment games
@@ -725,7 +723,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags)
}
_mixer->stopHandle(_heSoundChannels[heChannel]);
- _mixer->playRaw(type, &_heSoundChannels[heChannel], ptr + heOffset + 8, size, rate, flags, soundID);
+ _mixer->playRaw(type, &_heSoundChannels[heChannel], ptr + heOffset + 8, size, DisposeAfterUse::NO, rate, flags, soundID);
}
// Support for PCM music in 3DO versions of Humongous Entertainment games
else if (READ_BE_UINT32(ptr) == MKID_BE('MRAW')) {
@@ -738,13 +736,12 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags)
assert(READ_BE_UINT32(ptr) == MKID_BE('SDAT'));
size = READ_BE_UINT32(ptr + 4) - 8;
- flags = Audio::Mixer::FLAG_AUTOFREE;
byte *sound = (byte *)malloc(size);
memcpy(sound, ptr + 8, size);
_mixer->stopID(_currentMusic);
_currentMusic = soundID;
- _mixer->playRaw(Audio::Mixer::kMusicSoundType, NULL, sound, size, rate, flags, soundID);
+ _mixer->playRaw(Audio::Mixer::kMusicSoundType, NULL, sound, size, DisposeAfterUse::YES, rate, 0, soundID);
}
else if (READ_BE_UINT32(ptr) == MKID_BE('MIDI')) {
if (_vm->_imuse) {