[Scummvm-cvs-logs] SF.net SVN: scummvm:[54647] scummvm/trunk/engines/mohawk
mthreepwood at users.sourceforge.net
mthreepwood at users.sourceforge.net
Mon Nov 29 22:18:21 CET 2010
Revision: 54647
http://scummvm.svn.sourceforge.net/scummvm/?rev=54647&view=rev
Author: mthreepwood
Date: 2010-11-29 21:18:20 +0000 (Mon, 29 Nov 2010)
Log Message:
-----------
MOHAWK: Don't store the sound name in SndHandle
Modified Paths:
--------------
scummvm/trunk/engines/mohawk/sound.cpp
scummvm/trunk/engines/mohawk/sound.h
Modified: scummvm/trunk/engines/mohawk/sound.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/sound.cpp 2010-11-29 21:14:20 UTC (rev 54646)
+++ scummvm/trunk/engines/mohawk/sound.cpp 2010-11-29 21:18:20 UTC (rev 54647)
@@ -73,10 +73,6 @@
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 @@
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 @@
}
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 @@
// 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;
}
}
Modified: scummvm/trunk/engines/mohawk/sound.h
===================================================================
--- scummvm/trunk/engines/mohawk/sound.h 2010-11-29 21:14:20 UTC (rev 54646)
+++ scummvm/trunk/engines/mohawk/sound.h 2010-11-29 21:18:20 UTC (rev 54647)
@@ -66,7 +66,6 @@
Audio::SoundHandle handle;
SndHandleType type;
uint16 id;
- Common::String name;
};
struct SLSTSndHandle {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list