aboutsummaryrefslogtreecommitdiff
path: root/engines/toon/toon.cpp
diff options
context:
space:
mode:
authorSylvain Dupont2010-10-25 22:15:47 +0000
committerSylvain Dupont2010-10-25 22:15:47 +0000
commit7ab1e368e880e17d3ea904fe74153219e9531d1d (patch)
tree07182732047bbddf669e4fd2b6377b095957b855 /engines/toon/toon.cpp
parentf370ba174aa8085f80779bd92e22189451ccaf01 (diff)
downloadscummvm-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.cpp7
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);