mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-06 18:27:26 +00:00
PARALLACTION: remove code duplication in NS sound code.
svn-id: r55146
This commit is contained in:
parent
868717b444
commit
75d7ee9bd6
@ -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();
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user