aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage
diff options
context:
space:
mode:
authorPaul Gilbert2011-05-27 20:55:09 +1000
committerPaul Gilbert2011-05-27 20:55:09 +1000
commitfd4c55850d0afd40be779169c917bdbf34ba7959 (patch)
tree554bf4ca7f3975bf85522531d325ec229d855bf3 /engines/tsage
parent1d190139125bd5ed0af43213c779a71b3b0615f5 (diff)
downloadscummvm-rg350-fd4c55850d0afd40be779169c917bdbf34ba7959.tar.gz
scummvm-rg350-fd4c55850d0afd40be779169c917bdbf34ba7959.tar.bz2
scummvm-rg350-fd4c55850d0afd40be779169c917bdbf34ba7959.zip
TSAGE: Bugfixes for sound de-initialisation
Diffstat (limited to 'engines/tsage')
-rw-r--r--engines/tsage/globals.cpp1
-rw-r--r--engines/tsage/sound.cpp9
-rw-r--r--engines/tsage/sound.h3
-rw-r--r--engines/tsage/tsage.cpp3
4 files changed, 11 insertions, 5 deletions
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index e38fb21237..910fd033d0 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -101,7 +101,6 @@ Globals::Globals() :
}
Globals::~Globals() {
- _globals = NULL;
delete _inventory;
delete _game;
}
diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index c66b428950..b6b434e279 100644
--- a/engines/tsage/sound.cpp
+++ b/engines/tsage/sound.cpp
@@ -129,9 +129,7 @@ Common::List<SoundDriverEntry> &SoundManager::buildDriverList(bool detectFlag) {
}
void SoundManager::installConfigDrivers() {
-#ifdef TSAGE_SOUND
installDriver(ADLIB_DRIVER_NUM);
-#endif
}
Common::List<SoundDriverEntry> &SoundManager::getDriverList(bool detectFlag) {
@@ -623,7 +621,7 @@ void SoundManager::_sfRethinkVoiceTypes() {
}
}
- int var2 = 0;
+// int var2 = 0;
for (Common::List<Sound *>::iterator playIterator = sfManager()._playList.begin();
playIterator != sfManager()._playList.end(); ++playIterator) {
@@ -835,6 +833,10 @@ Sound::Sound() {
_field26E = NULL;
}
+Sound::~Sound() {
+ stop();
+}
+
void Sound::play(int soundNum) {
prime(soundNum);
_globals->_soundManager.addToPlayList(this);
@@ -1158,6 +1160,7 @@ const byte adlib_group_data[] = { 1, 1, 9, 1, 0xff };
AdlibSoundDriver::AdlibSoundDriver() {
_minVersion = 0x102;
+ _maxVersion = 0x10A;
_groupData.groupMask = 1;
diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h
index 0f361e00bd..eebb549a76 100644
--- a/engines/tsage/sound.h
+++ b/engines/tsage/sound.h
@@ -257,7 +257,7 @@ public:
int _field58[SOUND_ARR_SIZE];
int _field68[SOUND_ARR_SIZE];
int _field78[SOUND_ARR_SIZE];
- int _field98[SOUND_ARR_SIZE];
+ int _voiceStructIndex[SOUND_ARR_SIZE];
int _fieldA8[SOUND_ARR_SIZE];
int _fieldB8[SOUND_ARR_SIZE];
int _fieldC8[SOUND_ARR_SIZE];
@@ -268,6 +268,7 @@ public:
byte *_field26E;
public:
Sound();
+ ~Sound();
void play(int soundNum);
void stop();
diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp
index 68d477aa0b..99708d617b 100644
--- a/engines/tsage/tsage.cpp
+++ b/engines/tsage/tsage.cpp
@@ -90,6 +90,9 @@ void TSageEngine::deinitialise() {
delete _globals;
delete _resourceManager;
delete _saver;
+ _globals = NULL;
+ _resourceManager = NULL;
+ _saver = NULL;
}
Common::Error TSageEngine::run() {