[Scummvm-cvs-logs] CVS: scummvm/scumm sound.cpp,1.41,1.42
Max Horn
fingolfin at users.sourceforge.net
Tue Oct 22 17:25:02 CEST 2002
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.22,1.23 actor.h,1.3,1.4 script_v2.cpp,1.40,1.41 saveload.cpp,1.15,1.16
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm imuse.cpp,1.68,1.69
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/scumm
In directory usw-pr-cvs1:/tmp/cvs-serv23374/scumm
Modified Files:
sound.cpp
Log Message:
fix -Wshadow warnings
Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- sound.cpp 22 Oct 2002 11:48:24 -0000 1.41
+++ sound.cpp 23 Oct 2002 00:24:12 -0000 1.42
@@ -133,7 +133,7 @@
while(!quit) {
int len = READ_LE_UINT32(ptr + offset);
offset += 4;
- int code = len & 0xFF;
+ code = len & 0xFF;
len >>= 8;
switch(code) {
case 0: quit = 1; break;
@@ -172,18 +172,19 @@
return ret_sound;
}
-void Sound::playSound(int sound) {
+void Sound::playSound(int soundID) {
byte *ptr;
+ char *sound;
int size;
int rate;
debug(3,"playSound #%d (room %d)",
- sound, _scumm->getResourceRoomNr(rtSound, sound));
- ptr = _scumm->getResourceAddress(rtSound, sound);
+ soundID, _scumm->getResourceRoomNr(rtSound, soundID));
+ ptr = _scumm->getResourceAddress(rtSound, soundID);
if (ptr) {
if (READ_UINT32_UNALIGNED(ptr) == MKID('iMUS')){
if (_scumm->_imuseDigital)
- _scumm->_imuseDigital->startSound(sound);
+ _scumm->_imuseDigital->startSound(soundID);
return;
}
else if (READ_UINT32_UNALIGNED(ptr) == MKID('SOUN')) {
@@ -192,7 +193,7 @@
playCDTrack(ptr[16], ptr[17] == 0xff ? -1 : ptr[17],
(ptr[18] * 60 + ptr[19]) * 75 + ptr[20], 0);
- _scumm->current_cd_sound = sound;
+ _scumm->current_cd_sound = soundID;
return;
}
// Support for SFX in Monkey Island 1, Mac version
@@ -208,7 +209,7 @@
ptr += 0x72;
// Allocate a sound buffer, copy the data into it, and play
- char *sound = (char*)malloc(size);
+ sound = (char*)malloc(size);
memcpy(sound, ptr, size);
_scumm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
return;
@@ -225,13 +226,13 @@
rate = 8000; // FIXME - what value here ?!? 8000 is just a guess
// Allocate a sound buffer, copy the data into it, and play
- char *sound = (char*)malloc(size);
+ sound = (char*)malloc(size);
memcpy(sound, ptr + 8, size);
_scumm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
return;
}
else if (READ_UINT32_UNALIGNED(ptr) == MKID('Crea')) {
- _scumm->_imuseDigital->startSound(sound);
+ _scumm->_imuseDigital->startSound(soundID);
return;
}
else if (READ_UINT32_UNALIGNED(ptr) == MKID('ADL ')) {
@@ -285,12 +286,11 @@
size = READ_BE_UINT32_UNALIGNED(ptr + 4) - 27;
// Allocate a sound buffer, copy the data into it, and play
- char *sound = (char*)malloc(size);
+ sound = (char*)malloc(size);
memcpy(sound, ptr + 33, size);
_scumm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
return;
} else if (_scumm->_features & GF_OLD256) {
- char *sound;
size = READ_LE_UINT32(ptr);
#if 0
@@ -394,8 +394,8 @@
IMuse *se = _scumm->_imuse;
if (se) {
- _scumm->getResourceAddress(rtSound, sound);
- se->start_sound(sound);
+ _scumm->getResourceAddress(rtSound, soundID);
+ se->start_sound(soundID);
}
}
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.22,1.23 actor.h,1.3,1.4 script_v2.cpp,1.40,1.41 saveload.cpp,1.15,1.16
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm imuse.cpp,1.68,1.69
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list