From f5b79a4cdfc2e481c275eb8fb9b3b833648479c5 Mon Sep 17 00:00:00 2001 From: Thanasis Antoniou Date: Mon, 9 Sep 2019 21:08:41 +0300 Subject: BLADERUNNER: Play full exit KIA sound before quit via KIA --- engines/bladerunner/ui/kia.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'engines/bladerunner') diff --git a/engines/bladerunner/ui/kia.cpp b/engines/bladerunner/ui/kia.cpp index 9ec9d686c0..32704fc7d2 100644 --- a/engines/bladerunner/ui/kia.cpp +++ b/engines/bladerunner/ui/kia.cpp @@ -663,7 +663,13 @@ void KIA::mouseDownCallback(int buttonId, void *callbackData) { case 14: self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(kSfxBUTN5P), 70, 0, 0, 50, 0); if (buttonId == 12) { - self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(kSfxSHUTDOWN), 70, 0, 0, 50, 0); + int endTrackId = self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(kSfxSHUTDOWN), 70, 0, 0, 50, 0); + if (endTrackId != -1) { + // wait until the full clip has played (similar to the original) + while (self->_vm->_audioPlayer->isActive(endTrackId)) { + self->_vm->_system->delayMillis(16); + } + } } break; case 15: -- cgit v1.2.3