diff options
author | Sylvain Dupont | 2010-10-25 22:15:47 +0000 |
---|---|---|
committer | Sylvain Dupont | 2010-10-25 22:15:47 +0000 |
commit | 7ab1e368e880e17d3ea904fe74153219e9531d1d (patch) | |
tree | 07182732047bbddf669e4fd2b6377b095957b855 /engines/toon/toon.cpp | |
parent | f370ba174aa8085f80779bd92e22189451ccaf01 (diff) | |
download | scummvm-rg350-7ab1e368e880e17d3ea904fe74153219e9531d1d.tar.gz scummvm-rg350-7ab1e368e880e17d3ea904fe74153219e9531d1d.tar.bz2 scummvm-rg350-7ab1e368e880e17d3ea904fe74153219e9531d1d.zip |
TOON: Implemented Ambient SFX
For example used in arcade playing sounds, lullaby music,
toilet game win sound effects...
svn-id: r53834
Diffstat (limited to 'engines/toon/toon.cpp')
-rw-r--r-- | engines/toon/toon.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index 84a28ae990..c47c2c18df 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -161,7 +161,7 @@ void ToonEngine::waitForScriptStep() { // Wait after a specified number of script steps when executing a script // to lower CPU usage if (++_scriptStep >= 40) { - g_system->delayMillis(10); + g_system->delayMillis(1); _scriptStep = 0; } } @@ -359,6 +359,7 @@ void ToonEngine::update(int32 timeIncrement) { updateTimer(timeIncrement); updateTimers(); updateScrolling(false, timeIncrement); + _audioManager->updateAmbientSFX(); _animationManager->update(timeIncrement); _cursorAnimationInstance->update(timeIncrement); @@ -815,6 +816,7 @@ void ToonEngine::simpleUpdate(bool waitCharacterToTalk) { updateAnimationSceneScripts(elapsedTime); updateTimer(elapsedTime); _animationManager->update(elapsedTime); + _audioManager->updateAmbientSFX(); render(); @@ -1574,6 +1576,8 @@ void ToonEngine::exitScene() { strcpy(temp, createRoomFilename(Common::String::printf("%s.pak", _gameState->_locations[_gameState->_currentScene]._name).c_str()).c_str()); resources()->closePackage(temp); + _audioManager->killAllAmbientSFX(); + _drew->stopWalk(); _flux->stopWalk(); @@ -2665,6 +2669,7 @@ void ToonEngine::newGame() { } } + void ToonEngine::playSFX(int32 id, int32 volume) { if (id < 0) _audioManager->playSFX(-id + 1, volume, true); |