SUPERNOVA: Ignores mouse clicks while sound is playing

This commit is contained in:
Joseph-Eugene Winzer 2017-08-28 07:21:00 +02:00 committed by Thierry Crozat
parent 18abc4702a
commit bc43ff820e

View File

@ -186,6 +186,9 @@ void SupernovaEngine::updateEvents() {
// fallthrough // fallthrough
case Common::EVENT_RBUTTONUP: case Common::EVENT_RBUTTONUP:
// fallthrough // fallthrough
if (_mixer->isSoundHandleActive(_soundHandle) &&
(_gm->_currentRoom != _gm->_rooms[INTRO]))
return;
_gm->_mouseClicked = true; _gm->_mouseClicked = true;
case Common::EVENT_MOUSEMOVE: case Common::EVENT_MOUSEMOVE:
_gm->_mouseClickType = _event.type; _gm->_mouseClickType = _event.type;
@ -269,8 +272,6 @@ void SupernovaEngine::playSound(AudioIndex sample) {
11931, Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN, DisposeAfterUse::NO); 11931, Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN, DisposeAfterUse::NO);
stopSound(); stopSound();
_mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, audioStream); _mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, audioStream);
// TODO: Stall till sound was played
} }
void SupernovaEngine::stopSound() { void SupernovaEngine::stopSound() {