[Scummvm-cvs-logs] SF.net SVN: scummvm: [26080] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Sun Mar 11 11:51:02 CET 2007
Revision: 26080
http://scummvm.svn.sourceforge.net/scummvm/?rev=26080&view=rev
Author: peres001
Date: 2007-03-11 03:50:52 -0700 (Sun, 11 Mar 2007)
Log Message:
-----------
some refactoring for music management
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/location.cpp
scummvm/trunk/engines/parallaction/parallaction.cpp
scummvm/trunk/engines/parallaction/parallaction.h
Modified: scummvm/trunk/engines/parallaction/location.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/location.cpp 2007-03-11 01:06:54 UTC (rev 26079)
+++ scummvm/trunk/engines/parallaction/location.cpp 2007-03-11 10:50:52 UTC (rev 26080)
@@ -283,33 +283,8 @@
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");
- }
+ pickMusic(location);
- 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");
- }
-
// WORKAROUND: this if-statement has been added to avoid crashes caused by
// execution of label jobs after a location switch. The other workaround in
// Parallaction::runGame should have been rendered useless by this one.
Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp 2007-03-11 01:06:54 UTC (rev 26079)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp 2007-03-11 10:50:52 UTC (rev 26080)
@@ -859,6 +859,34 @@
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);
Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h 2007-03-11 01:06:54 UTC (rev 26079)
+++ scummvm/trunk/engines/parallaction/parallaction.h 2007-03-11 10:50:52 UTC (rev 26080)
@@ -354,6 +354,7 @@
void loadProgram(Animation *a, char *filename);
void changeLocation(char *location);
+ void pickMusic(const char *location);
void selectCharacterMusic(const char *name);
};
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