aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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() {