diff options
author | Nicola Mettifogo | 2011-01-07 15:17:07 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2011-01-07 15:17:07 +0000 |
commit | 75d7ee9bd61b52dfd145a0e06365393531d265e7 (patch) | |
tree | 663b320ec096c4f26761f6313eeb91fd52d36870 /engines/parallaction | |
parent | 868717b444ff0755663037a6c9aa4ccdc8437010 (diff) | |
download | scummvm-rg350-75d7ee9bd61b52dfd145a0e06365393531d265e7.tar.gz scummvm-rg350-75d7ee9bd61b52dfd145a0e06365393531d265e7.tar.bz2 scummvm-rg350-75d7ee9bd61b52dfd145a0e06365393531d265e7.zip |
PARALLACTION: remove code duplication in NS sound code.
svn-id: r55146
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/sound.h | 2 | ||||
-rw-r--r-- | engines/parallaction/sound_ns.cpp | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/engines/parallaction/sound.h b/engines/parallaction/sound.h index 985ed77ccc..01eebfcc2d 100644 --- a/engines/parallaction/sound.h +++ b/engines/parallaction/sound.h @@ -136,7 +136,9 @@ class DosSoundMan_ns : public SoundMan_ns { int _musicData1; bool isLocationSilent(const char *locationName); + bool locationHasOwnSoftMusic(const char *locationName); + public: DosSoundMan_ns(Parallaction_ns *vm, MidiDriver *midiDriver); ~DosSoundMan_ns(); diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp index 3c1858b062..431d2a1f4c 100644 --- a/engines/parallaction/sound_ns.cpp +++ b/engines/parallaction/sound_ns.cpp @@ -284,13 +284,16 @@ void DosSoundMan_ns::pause(bool p) { _midiPlayer->pause(p); } +bool DosSoundMan_ns::locationHasOwnSoftMusic(const char *locationName) { + return !scumm_stricmp(locationName, "night") || !scumm_stricmp(locationName, "intsushi"); +} + void DosSoundMan_ns::playCharacterMusic(const char *character) { if (character == NULL) { return; } - if (!scumm_stricmp(_vm->_location._name, "night") || - !scumm_stricmp(_vm->_location._name, "intsushi")) { + if (locationHasOwnSoftMusic(_vm->_location._name)) { return; } @@ -319,7 +322,7 @@ void DosSoundMan_ns::playLocationMusic(const char *location) { debugC(2, kDebugExec, "changeLocation: started character specific music"); } - if (!scumm_stricmp(location, "night") || !scumm_stricmp(location, "intsushi")) { + if (locationHasOwnSoftMusic(location)) { setMusicFile("soft"); playMusic(); |