KYRA: (EOB/PC98) - minor sfx code tweak

The original adds a delay after track 28.
This commit is contained in:
athrxx 2019-12-18 19:41:40 +01:00
parent e4439fb1a5
commit 64b897a560
2 changed files with 6 additions and 2 deletions

View File

@ -471,6 +471,8 @@ private:
SoundResourceInfo_PC *_resInfo[3];
int _currentResourceSet;
uint32 _sfxDelay;
bool _ready;
};

View File

@ -31,7 +31,7 @@
namespace Kyra {
SoundPC98_EoB::SoundPC98_EoB(KyraEngine_v1 *vm, Audio::Mixer *mixer) : Sound(vm, mixer),
_vm(vm), _driver(0), _currentResourceSet(-1), _ready(false) {
_vm(vm), _driver(0), _currentResourceSet(-1), _sfxDelay(0), _ready(false) {
memset(_resInfo, 0, sizeof(_resInfo));
}
@ -104,9 +104,11 @@ void SoundPC98_EoB::haltTrack() {
}
void SoundPC98_EoB::playSoundEffect(uint8 track, uint8) {
if (_currentResourceSet != kMusicIngame || !_sfxEnabled || !_ready || track >= 120)
if (_currentResourceSet != kMusicIngame || !_sfxEnabled || !_ready || track >= 120 || (track != 28 && _sfxDelay > _vm->_system->getMillis()))
return;
_driver->startSoundEffect(track);
if (track == 28)
_sfxDelay = _vm->_system->getMillis() + 1440;
}
void SoundPC98_EoB::updateVolumeSettings() {