diff options
-rw-r--r-- | engines/parallaction/location.cpp | 27 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 28 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 1 |
3 files changed, 30 insertions, 26 deletions
diff --git a/engines/parallaction/location.cpp b/engines/parallaction/location.cpp index 9023e13afc..ca97ceb947 100644 --- a/engines/parallaction/location.cpp +++ b/engines/parallaction/location.cpp @@ -283,32 +283,7 @@ extern Job *_jEraseLabel; void Parallaction::changeLocation(char *location) { debugC(1, kDebugLocation, "changeLocation to '%s'", location); -// printf("changeLocation('%s')", location); - if (_musicData1 != 0) { - selectCharacterMusic(_vm->_characterName); - _musicData1 = 0; - debugC(2, kDebugLocation, "changeLocation: started character specific music"); - } - - if (!scumm_stricmp(location, "night") || !scumm_stricmp(location, "intsushi")) { - _vm->_midiPlayer->play("soft"); - - debugC(2, kDebugLocation, "changeLocation: started music 'soft'"); - } - - if (!scumm_stricmp(location, "museo") || - !scumm_stricmp(location, "caveau") || - !scumm_strnicmp(location, "plaza1", 6) || - !scumm_stricmp(location, "estgrotta") || - !scumm_stricmp(location, "intgrottadopo") || - !scumm_stricmp(location, "endtgz") || - !scumm_stricmp(location, "common")) { - - _vm->_midiPlayer->stop(); - _musicData1 = 1; - - debugC(2, kDebugLocation, "changeLocation: music stopped"); - } + pickMusic(location); // WORKAROUND: this if-statement has been added to avoid crashes caused by // execution of label jobs after a location switch. The other workaround in diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 48103775ec..888f776514 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -859,6 +859,34 @@ void Parallaction::selectCharacterMusic(const char *name) { return; } +void Parallaction::pickMusic(const char *location) { + if (_musicData1 != 0) { + selectCharacterMusic(_vm->_characterName); + _musicData1 = 0; + debugC(2, kDebugLocation, "changeLocation: started character specific music"); + } + + if (!scumm_stricmp(location, "night") || !scumm_stricmp(location, "intsushi")) { + _vm->_midiPlayer->play("soft"); + + debugC(2, kDebugLocation, "changeLocation: started music 'soft'"); + } + + if (!scumm_stricmp(location, "museo") || + !scumm_stricmp(location, "caveau") || + !scumm_strnicmp(location, "plaza1", 6) || + !scumm_stricmp(location, "estgrotta") || + !scumm_stricmp(location, "intgrottadopo") || + !scumm_stricmp(location, "endtgz") || + !scumm_stricmp(location, "common")) { + + _vm->_midiPlayer->stop(); + _musicData1 = 1; + + debugC(2, kDebugLocation, "changeLocation: music stopped"); + } +} + void Parallaction::changeCharacter(const char *name) { // printf("changeCharacter(%s)\n", name); diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index cdf8b08195..2196942b0a 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -354,6 +354,7 @@ protected: // members void loadProgram(Animation *a, char *filename); void changeLocation(char *location); + void pickMusic(const char *location); void selectCharacterMusic(const char *name); }; |