mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-07 03:12:36 +01: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:
parent
35405534e7
commit
c2b55a09c7
@ -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;
|
||||
bool resumingCutscene = !pause && !isCutsceneDone();
|
||||
if (resumingCutscene) {
|
||||
sound.playMusic(cutsceneAudio);
|
||||
} else {
|
||||
sound.pause(pause);
|
||||
}
|
||||
}
|
||||
|
||||
bool GameWorld::isPaused() const {
|
||||
|
Loading…
Reference in New Issue
Block a user