diff options
author | Nicola Mettifogo | 2007-07-08 08:13:32 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-07-08 08:13:32 +0000 |
commit | 674f2e93c23457161808b9dbe7153094f2560c08 (patch) | |
tree | 6af78737ea749bb55865edbe79b53aa596b651e3 | |
parent | 7a2949dcfc3d1ff90679af873cdea239f32f99b2 (diff) | |
download | scummvm-rg350-674f2e93c23457161808b9dbe7153094f2560c08.tar.gz scummvm-rg350-674f2e93c23457161808b9dbe7153094f2560c08.tar.bz2 scummvm-rg350-674f2e93c23457161808b9dbe7153094f2560c08.zip |
Location background sound (different from music) now implemented.
svn-id: r27958
-rw-r--r-- | engines/parallaction/location.cpp | 23 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 6 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 4 |
3 files changed, 20 insertions, 13 deletions
diff --git a/engines/parallaction/location.cpp b/engines/parallaction/location.cpp index 2a5af2dc67..3c54460692 100644 --- a/engines/parallaction/location.cpp +++ b/engines/parallaction/location.cpp @@ -38,6 +38,7 @@ void Parallaction::parseLocation(const char *filename) { _gfx->setFont(kFontLabel); Script *_locationScript = _disk->loadLocation(filename); + _hasLocationSound = false; fillBuffers(*_locationScript, true); while (scumm_stricmp(_tokens[0], "ENDLOCATION")) { @@ -140,16 +141,15 @@ void Parallaction::parseLocation(const char *filename) { parseAnimation(*_locationScript, _animations, _tokens[1]); } if (!scumm_stricmp(_tokens[0], "SOUND")) { - strcpy(_soundFile, _tokens[1]); + if (getPlatform() == Common::kPlatformAmiga) { + strcpy(_locationSound, _tokens[1]); + _hasLocationSound = true; + } } if (!scumm_stricmp(_tokens[0], "MUSIC")) { if (getPlatform() == Common::kPlatformAmiga) _soundMan->setMusicFile(_tokens[1]); } - if (!scumm_stricmp(_tokens[0], "SOUND")) { -// if (getPlatform() == Common::kPlatformAmiga) -// _soundMan->loadSfx(_tokens[1], atoi(_tokens[2])); - } fillBuffers(*_locationScript, true); } @@ -182,14 +182,14 @@ void Parallaction::freeLocation() { if (_localFlagNames) delete _localFlagNames; - + // HACK: prevents leakage. A routine like this // should allocate memory at all, though. if ((_engineFlags & kEngineQuit) == 0) { _localFlagNames = new Table(120); _localFlagNames->addData("visited"); } - + _location._walkNodes.clear(); // TODO (LIST): helperNode should be rendered useless by the use of a Common::List<> @@ -379,11 +379,11 @@ void Parallaction::changeLocation(char *location) { runJobs(); _gfx->swapBuffers(); } - + if (_location._comment) { doLocationEnterTransition(); } - + runJobs(); _gfx->swapBuffers(); @@ -392,7 +392,8 @@ void Parallaction::changeLocation(char *location) { runCommands(_location._aCommands); } -// _soundMan->playSfx(0); + if (_hasLocationSound) + _soundMan->playSfx(_locationSound, 0, true); debugC(1, kDebugLocation, "changeLocation() done"); @@ -416,7 +417,7 @@ void Parallaction::doLocationEnterTransition() { debugC(3, kDebugLocation, "skipping location transition"); return; // visited } - + byte pal[PALETTE_SIZE]; _gfx->buildBWPalette(pal); _gfx->setPalette(pal); diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 23f0887688..c830b575a9 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -84,7 +84,6 @@ Command * _forwardedCommands[20] = { char _forwardedAnimationNames[20][20]; uint16 _numForwards = 0; -char _soundFile[20]; uint32 _commandFlags = 0; uint16 _introSarcData3 = 200; @@ -158,6 +157,8 @@ int Parallaction::init() { _localFlagNames = NULL; initResources(); + _hasLocationSound = false; + _skipMenu = false; _transCurrentHoverItem = 0; @@ -369,6 +370,9 @@ void Parallaction::runGame() { if (_location._comment) doLocationEnterTransition(); + if (_hasLocationSound) + _soundMan->playSfx(_locationSound, 0, true); + changeCursor(kCursorArrow); if (_location._aCommands.size() > 0) diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index f2143c844d..561b15acc9 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -176,7 +176,6 @@ extern uint32 _localFlags[]; extern Command *_forwardedCommands[]; extern char _forwardedAnimationNames[][20]; extern uint16 _numForwards; -extern char _soundFile[]; extern char _slideText[][40]; extern uint16 _introSarcData3; // sarcophagus stuff to be saved extern uint16 _introSarcData2; // sarcophagus stuff to be saved @@ -416,6 +415,9 @@ protected: // data Common::String _saveFileName; + bool _hasLocationSound; + char _locationSound[50]; + protected: // members bool detectGame(void); |