KYRA: change Adlib driver queue to behave more like the original driver

(in case of an overflow drop the oldest sound instead of the newest)
This commit is contained in:
athrxx 2021-05-01 19:59:49 +02:00
parent 682e7f1230
commit 7e8d970ef5

View file

@ -449,12 +449,11 @@ void AdLibDriver::startSound(int track, int volume) {
if (!trackData)
return;
if (_programQueueEnd == _programQueueStart && _programQueue[_programQueueEnd].data != 0) {
// Don't warn when dropping tracks in EoB. The queue is always full there if a couple of monsters are around.
if (_version >= 3)
warning("AdLibDriver: Program queue full, dropping track %d", track);
return;
}
// We used to drop the new sound here, but that isn't the behavior of the original code.
// It would cause more issues than do any good. Now, we just have a debug message and
// then drop the oldest sound, like the original driver...
if (_programQueueEnd == _programQueueStart && _programQueue[_programQueueEnd].data != 0)
debugC(3, kDebugLevelSound, "AdLibDriver: Program queue full, dropping track %d", _programQueue[_programQueueEnd].id);
_programQueue[_programQueueEnd] = QueueEntry(trackData, track, volume);
++_programQueueEnd &= 15;