aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sfx
diff options
context:
space:
mode:
authorFilippos Karapetis2009-05-25 10:30:19 +0000
committerFilippos Karapetis2009-05-25 10:30:19 +0000
commitd59796fb544fea69d1b2f27f89d6eb30bf5d0780 (patch)
tree558e122a71e404cd56aa7742c57b16f108a28f46 /engines/sci/sfx
parent5ef58bdfbe443c19d2f185d924b5058f25cab962 (diff)
downloadscummvm-rg350-d59796fb544fea69d1b2f27f89d6eb30bf5d0780.tar.gz
scummvm-rg350-d59796fb544fea69d1b2f27f89d6eb30bf5d0780.tar.bz2
scummvm-rg350-d59796fb544fea69d1b2f27f89d6eb30bf5d0780.zip
Objectified the AudioResource code (used for speech and digitized music in CD talkie games)
svn-id: r40880
Diffstat (limited to 'engines/sci/sfx')
-rw-r--r--engines/sci/sfx/core.cpp7
-rw-r--r--engines/sci/sfx/core.h3
2 files changed, 9 insertions, 1 deletions
diff --git a/engines/sci/sfx/core.cpp b/engines/sci/sfx/core.cpp
index 1b4b7e7d96..ccf2052e85 100644
--- a/engines/sci/sfx/core.cpp
+++ b/engines/sci/sfx/core.cpp
@@ -367,6 +367,7 @@ void sfx_init(sfx_state_t *self, ResourceManager *resmgr, int flags) {
self->flags = flags;
self->debug = 0; /* Disable all debugging by default */
self->soundSync = NULL;
+ self->audioResource = NULL;
if (flags & SFX_STATE_FLAG_NOSOUND) {
player = NULL;
@@ -443,6 +444,12 @@ void sfx_exit(sfx_state_t *self) {
if (strcmp(player->name, "new") == 0)
g_system->getMixer()->stopAll();
+
+ // Delete audio resources for CD talkie games
+ if (self->audioResource) {
+ delete self->audioResource;
+ self->audioResource = 0;
+ }
}
void sfx_suspend(sfx_state_t *self, int suspend) {
diff --git a/engines/sci/sfx/core.h b/engines/sci/sfx/core.h
index acf8c67d70..9c0d25862f 100644
--- a/engines/sci/sfx/core.h
+++ b/engines/sci/sfx/core.h
@@ -55,7 +55,8 @@ struct sfx_state_t {
song_t *song; /* Active song, or start of active song chain */
int suspended; /* Whether we are suspended */
unsigned int debug; /* Debug flags */
- ResourceSync *soundSync; /* Used by kDoSync for speech syncing in talkie games */
+ ResourceSync *soundSync; /* Used by kDoSync for speech syncing in CD talkie games */
+ AudioResource *audioResource; /* Used for audio resources in CD talkie games */
};
/***********/