aboutsummaryrefslogtreecommitdiff
path: root/engines/neverhood
diff options
context:
space:
mode:
authorjohndoe1232013-01-29 12:03:05 +0000
committerWillem Jan Palenstijn2013-05-08 20:47:43 +0200
commit70fdfd9d572b4c395dfa4d3fbff791e064d4079d (patch)
tree457ca8255d935d9920a75cffe75f9ea1ed77782b /engines/neverhood
parentc96d2475b100610271c974043a8a9c4322b8e60b (diff)
downloadscummvm-rg350-70fdfd9d572b4c395dfa4d3fbff791e064d4079d.tar.gz
scummvm-rg350-70fdfd9d572b4c395dfa4d3fbff791e064d4079d.tar.bz2
scummvm-rg350-70fdfd9d572b4c395dfa4d3fbff791e064d4079d.zip
NEVERHOOD: Delete all sound/music items on exit
- Minor cleanup
Diffstat (limited to 'engines/neverhood')
-rw-r--r--engines/neverhood/menumodule.cpp1
-rw-r--r--engines/neverhood/sound.cpp22
2 files changed, 13 insertions, 10 deletions
diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp
index f1669a6213..f752ce6745 100644
--- a/engines/neverhood/menumodule.cpp
+++ b/engines/neverhood/menumodule.cpp
@@ -178,7 +178,6 @@ void MenuModule::updateScene() {
}
uint32 MenuModule::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
- // TODO CHECKME Handles 0x101F, possibly just a debug/cache message which can be ignored?
return Module::handleMessage(messageNum, param, sender);;
}
diff --git a/engines/neverhood/sound.cpp b/engines/neverhood/sound.cpp
index 9e0e572ca0..a479bf26f9 100644
--- a/engines/neverhood/sound.cpp
+++ b/engines/neverhood/sound.cpp
@@ -233,21 +233,18 @@ void SoundItem::setVolume(int volume) {
void SoundItem::update() {
if (_playOnceAfterCountdown) {
- if (_currCountdown == 0) {
+ if (_currCountdown == 0)
_currCountdown = _initialCountdown;
- } else if (--_currCountdown == 0) {
+ else if (--_currCountdown == 0)
_soundResource->play();
- }
} else if (_playOnceAfterRandomCountdown) {
if (_currCountdown == 0) {
if (_minCountdown > 0 && _maxCountdown > 0 && _minCountdown < _maxCountdown)
_currCountdown = _vm->_rnd->getRandomNumberRng(_minCountdown, _maxCountdown);
- } else if (--_currCountdown == 0) {
+ } else if (--_currCountdown == 0)
_soundResource->play();
- }
- } else if (_playLooping && !_soundResource->isPlaying()) {
- _soundResource->play(); // TODO Looping parameter?
- }
+ } else if (_playLooping && !_soundResource->isPlaying())
+ _soundResource->play();
}
// SoundMan
@@ -257,7 +254,10 @@ SoundMan::SoundMan(NeverhoodEngine *vm)
}
SoundMan::~SoundMan() {
- // TODO Clean up
+ for (uint i = 0; i < _soundItems.size(); ++i)
+ delete _soundItems[i];
+ for (uint i = 0; i < _musicItems.size(); ++i)
+ delete _musicItems[i];
}
void SoundMan::addMusic(uint32 groupNameHash, uint32 musicFileHash) {
@@ -709,6 +709,10 @@ AudioResourceMan::AudioResourceMan(NeverhoodEngine *vm)
}
AudioResourceMan::~AudioResourceMan() {
+ for (uint i = 0; i < _soundItems.size(); ++i)
+ delete _soundItems[i];
+ for (uint i = 0; i < _musicItems.size(); ++i)
+ delete _musicItems[i];
}
int16 AudioResourceMan::addSound(uint32 fileHash) {