aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Hoops2010-11-29 21:18:20 +0000
committerMatthew Hoops2010-11-29 21:18:20 +0000
commitd3c78b8a3d4d1692f7db0d9391f76f3ba0092199 (patch)
tree747ed2dba00a60cf68789bbcb6c061ace5e409eb /engines
parent0b028de5737094b3e3f2d22a4a42e0544f774416 (diff)
downloadscummvm-rg350-d3c78b8a3d4d1692f7db0d9391f76f3ba0092199.tar.gz
scummvm-rg350-d3c78b8a3d4d1692f7db0d9391f76f3ba0092199.tar.bz2
scummvm-rg350-d3c78b8a3d4d1692f7db0d9391f76f3ba0092199.zip
MOHAWK: Don't store the sound name in SndHandle
svn-id: r54647
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/sound.cpp12
-rw-r--r--engines/mohawk/sound.h1
2 files changed, 5 insertions, 8 deletions
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp
index 41d7000ad8..29a097e591 100644
--- a/engines/mohawk/sound.cpp
+++ b/engines/mohawk/sound.cpp
@@ -73,10 +73,6 @@ void Sound::initMidi() {
Audio::SoundHandle *Sound::playSound(uint16 id, byte volume, bool loop) {
debug (0, "Playing sound %d", id);
- SndHandle *handle = getHandle();
- handle->type = kUsedHandle;
- handle->id = id;
-
Audio::AudioStream *audStream = NULL;
switch (_vm->getGameType()) {
@@ -96,8 +92,6 @@ Audio::SoundHandle *Sound::playSound(uint16 id, byte volume, bool loop) {
audStream = Audio::makeWAVStream(_vm->getResource(ID_MSND, id), DisposeAfterUse::YES);
} else
audStream = makeMohawkWaveStream(_vm->getResource(ID_MSND, id));
-
- handle->name = _vm->getResourceName(ID_MSND, id);
break;
case GType_ZOOMBINI:
audStream = makeMohawkWaveStream(_vm->getResource(ID_SND, id));
@@ -110,6 +104,10 @@ Audio::SoundHandle *Sound::playSound(uint16 id, byte volume, bool loop) {
}
if (audStream) {
+ SndHandle *handle = getHandle();
+ handle->type = kUsedHandle;
+ handle->id = id;
+
// Set the stream to loop here if it's requested
if (loop)
audStream = Audio::makeLoopingAudioStream((Audio::RewindableAudioStream *)audStream, 0);
@@ -131,7 +129,7 @@ Audio::SoundHandle *Sound::replaceSound(uint16 id, byte volume, bool loop) {
// Check if sound is already playing
for (uint32 i = 0; i < _handles.size(); i++) {
if (_vm->_mixer->isSoundHandleActive(_handles[i].handle)
- && name.equals(_handles[i].name)) {
+ && name.equals(_vm->getResourceName(ID_MSND, _handles[i].id))) {
return &_handles[i].handle;
}
}
diff --git a/engines/mohawk/sound.h b/engines/mohawk/sound.h
index 340d6fae2f..bbd7f963da 100644
--- a/engines/mohawk/sound.h
+++ b/engines/mohawk/sound.h
@@ -66,7 +66,6 @@ struct SndHandle {
Audio::SoundHandle handle;
SndHandleType type;
uint16 id;
- Common::String name;
};
struct SLSTSndHandle {