mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-13 23:43:34 +00:00
DRAGONS: Play sfx from vab tone range.
This commit is contained in:
parent
fe2046af4f
commit
55ff2f91bc
@ -441,8 +441,12 @@ void SoundManager::playSound(uint16 soundId, uint16 volumeId) {
|
||||
if (vagID >= 0) {
|
||||
Audio::SoundHandle *handle = getVoiceHandle(soundId);
|
||||
if (handle) {
|
||||
//TODO need to handle sfx where the requested key doesn't match the vag tone.
|
||||
// We need to change pitch in this case.
|
||||
_vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, handle, vabSound->getAudioStream(program, vagID), -1, _sfxVolume);
|
||||
}
|
||||
} else {
|
||||
warning("Sound not found Program: %d, key %d", program, key);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -158,7 +158,11 @@ void VabSound::loadToneAttributes(Common::SeekableReadStream *vhData) {
|
||||
int16 VabSound::getVagID(uint16 program, uint16 key) {
|
||||
if (program < _header.numVAG) {
|
||||
for (int i = 0; i < _programAttrs[program].tones; i++) {
|
||||
if (_toneAttrs[i].prog == program && _toneAttrs[i].min == key && _toneAttrs[i].max == key) {
|
||||
if (_toneAttrs[i].prog == program && _toneAttrs[i].min <= key && _toneAttrs[i].max >= key) {
|
||||
if (key != _toneAttrs[i].min) {
|
||||
warning("Sfx key requested doesn't exactly match vab tone. TODO we need to change the playback pitch. key requested: %d tone match (min,max) (%d, %d)",
|
||||
key, _toneAttrs[i].min, _toneAttrs[i].max);
|
||||
}
|
||||
return _toneAttrs[i].vag - 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user