1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-15 06:52:34 +02:00

Pause all other sounds during a cutscene (#649)

* Pause all other sounds during a cutscene

* Modify if statement so it's more understandable
This commit is contained in:
qkolj 2018-10-26 02:07:16 +02:00 committed by Filip Gawin
parent 35405534e7
commit c2b55a09c7

View File

@ -782,6 +782,7 @@ void GameWorld::startCutscene() {
state->skipCutscene = false;
if (cutsceneAudio.length() > 0) {
sound.pauseAllSounds();
sound.playMusic(cutsceneAudio);
}
}
@ -794,6 +795,7 @@ void GameWorld::clearCutscene() {
if (cutsceneAudio.length() > 0) {
sound.stopMusic(cutsceneAudio);
cutsceneAudio = "";
sound.resumeAllSounds();
}
delete state->currentCutscene;
@ -881,7 +883,12 @@ void GameWorld::clearTickData() {
void GameWorld::setPaused(bool pause) {
paused = pause;
sound.pause(pause);
bool resumingCutscene = !pause && !isCutsceneDone();
if (resumingCutscene) {
sound.playMusic(cutsceneAudio);
} else {
sound.pause(pause);
}
}
bool GameWorld::isPaused() const {