[Scummvm-cvs-logs] SF.net SVN: scummvm:[55146] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Fri Jan 7 16:17:08 CET 2011


Revision: 55146
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55146&view=rev
Author:   peres001
Date:     2011-01-07 15:17:07 +0000 (Fri, 07 Jan 2011)

Log Message:
-----------
PARALLACTION: remove code duplication in NS sound code.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/sound.h
    scummvm/trunk/engines/parallaction/sound_ns.cpp

Modified: scummvm/trunk/engines/parallaction/sound.h
===================================================================
--- scummvm/trunk/engines/parallaction/sound.h	2011-01-07 15:14:38 UTC (rev 55145)
+++ scummvm/trunk/engines/parallaction/sound.h	2011-01-07 15:17:07 UTC (rev 55146)
@@ -136,7 +136,9 @@
 	int			_musicData1;
 
 	bool isLocationSilent(const char *locationName);
+	bool locationHasOwnSoftMusic(const char *locationName);
 
+	
 public:
 	DosSoundMan_ns(Parallaction_ns *vm, MidiDriver *midiDriver);
 	~DosSoundMan_ns();

Modified: scummvm/trunk/engines/parallaction/sound_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/sound_ns.cpp	2011-01-07 15:14:38 UTC (rev 55145)
+++ scummvm/trunk/engines/parallaction/sound_ns.cpp	2011-01-07 15:17:07 UTC (rev 55146)
@@ -284,13 +284,16 @@
 	_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 @@
 		debugC(2, kDebugExec, "changeLocation: started character specific music");
 	}
 
-	if (!scumm_stricmp(location, "night") || !scumm_stricmp(location, "intsushi")) {
+	if (locationHasOwnSoftMusic(location)) {
 		setMusicFile("soft");
 		playMusic();
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list