aboutsummaryrefslogtreecommitdiff
path: root/engines/tony
diff options
context:
space:
mode:
authorTorbjörn Andersson2012-08-25 12:56:02 +0200
committerTorbjörn Andersson2012-08-25 12:56:02 +0200
commit659436739f1e32297bdd8faac83b71e51d4a4937 (patch)
tree2af6de822fb855400b66c37cc0f1431e76a053a2 /engines/tony
parenta9828c88184a4c1a9161ca1fe80f5e6fff9c4f4e (diff)
downloadscummvm-rg350-659436739f1e32297bdd8faac83b71e51d4a4937.tar.gz
scummvm-rg350-659436739f1e32297bdd8faac83b71e51d4a4937.tar.bz2
scummvm-rg350-659436739f1e32297bdd8faac83b71e51d4a4937.zip
TONY: Make the verb menu sound effects play
At least for now, preloading utility sound effects *is* needed in ScummVM. And since we now have preloading of both normal and utility sound effects, I've unstubbed the unloading functions as well.
Diffstat (limited to 'engines/tony')
-rw-r--r--engines/tony/tony.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/engines/tony/tony.cpp b/engines/tony/tony.cpp
index 081556572a..ec2ee49ba2 100644
--- a/engines/tony/tony.cpp
+++ b/engines/tony/tony.cpp
@@ -54,6 +54,7 @@ TonyEngine::TonyEngine(OSystem *syst, const TonyGameDescription *gameDesc) : Eng
SearchMan.addSubDirectoryMatching(gameDataDir, "Voices");
SearchMan.addSubDirectoryMatching(gameDataDir, "Roasted");
SearchMan.addSubDirectoryMatching(gameDataDir, "Music");
+ SearchMan.addSubDirectoryMatching(gameDataDir, "Music/utilsfx");
// Set up load slot number
_initialLoadSlotNumber = -1;
@@ -355,15 +356,36 @@ FPSfx *TonyEngine::createSFX(Common::SeekableReadStream *stream) {
}
void TonyEngine::preloadUtilSFX(int nChannel, const char *fn) {
- // No preloading is needed in ScummVM
+ if (_utilSfx[nChannel] != NULL) {
+ _utilSfx[nChannel]->stop();
+ _utilSfx[nChannel]->release();
+ _utilSfx[nChannel] = NULL;
+ }
+
+ _theSound.createSfx(&_utilSfx[nChannel]);
+
+ _utilSfx[nChannel]->loadFile(fn, FPCODEC_ADPCM);
+ _utilSfx[nChannel]->setVolume(63);
}
void TonyEngine::unloadAllSFX() {
- // No preloading is needed in ScummVM
+ for (int i = 0; i < MAX_SFX_CHANNELS; i++) {
+ if (_sfx[i] != NULL) {
+ _sfx[i]->stop();
+ _sfx[i]->release();
+ _sfx[i] = NULL;
+ }
+ }
}
void TonyEngine::unloadAllUtilSFX() {
- // No preloading is needed in ScummVM
+ for (int i = 0; i < MAX_SFX_CHANNELS; i++) {
+ if (_utilSfx[i] != NULL) {
+ _utilSfx[i]->stop();
+ _utilSfx[i]->release();
+ _utilSfx[i] = NULL;
+ }
+ }
}
void TonyEngine::initMusic() {