aboutsummaryrefslogtreecommitdiff
path: root/engines/neverhood/sound.cpp
diff options
context:
space:
mode:
authorjohndoe1232013-01-17 09:09:39 +0000
committerWillem Jan Palenstijn2013-05-08 20:47:40 +0200
commit57497817e1f086a62471587e3601d8f0f7d7f13b (patch)
tree76e1f76ff059b7d2bad82189ffbc9638b12bb0c1 /engines/neverhood/sound.cpp
parenta98d9aa58afb4dd944616e7f194c09ff28456e1b (diff)
downloadscummvm-rg350-57497817e1f086a62471587e3601d8f0f7d7f13b.tar.gz
scummvm-rg350-57497817e1f086a62471587e3601d8f0f7d7f13b.tar.bz2
scummvm-rg350-57497817e1f086a62471587e3601d8f0f7d7f13b.zip
NEVERHOOD: Add enum for the resource types
Diffstat (limited to 'engines/neverhood/sound.cpp')
-rw-r--r--engines/neverhood/sound.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/neverhood/sound.cpp b/engines/neverhood/sound.cpp
index 3cbcf96354..13ac87fbad 100644
--- a/engines/neverhood/sound.cpp
+++ b/engines/neverhood/sound.cpp
@@ -128,8 +128,8 @@ MusicItem::~MusicItem() {
}
SoundItem::SoundItem(NeverhoodEngine *vm, uint32 nameHash, uint32 soundFileHash,
- bool playOnceAfterRandomCountdown, int16 minCountdown, int16 maxCountdown,
- bool playOnceAfterCountdown, int16 initialCountdown, bool playLooping, int16 currCountdown)
+ bool playOnceAfterRandomCountdown, int16 minCountdown, int16 maxCountdown,
+ bool playOnceAfterCountdown, int16 initialCountdown, bool playLooping, int16 currCountdown)
: _soundResource(NULL), _nameHash(nameHash), _soundFileHash(soundFileHash),
_playOnceAfterRandomCountdown(false), _minCountdown(0), _maxCountdown(0),
_playOnceAfterCountdown(_playOnceAfterCountdown), _initialCountdown(initialCountdown),
@@ -546,7 +546,8 @@ void AudioResourceMan::removeSound(int16 soundIndex) {
void AudioResourceMan::loadSound(int16 soundIndex) {
AudioResourceManSoundItem *soundItem = _soundItems[soundIndex];
- if (!soundItem->_data && soundItem->_resourceHandle.isValid()) {
+ if (!soundItem->_data && soundItem->_resourceHandle.isValid() &&
+ (soundItem->_resourceHandle.type() == kResTypeSound || soundItem->_resourceHandle.type() == kResTypeMusic)) {
// TODO Check if it's a sound resource
_vm->_res->loadResource(soundItem->_resourceHandle);
soundItem->_data = soundItem->_resourceHandle.data();