diff options
author | Max Horn | 2002-10-23 00:24:43 +0000 |
---|---|---|
committer | Max Horn | 2002-10-23 00:24:43 +0000 |
commit | ab13e67b0907fdb97b0dde3bb3344650d4d12946 (patch) | |
tree | 4ad06cfef44c96d7055f0beeb69c0ec424ea9d46 /scumm | |
parent | df2bf812c3a40ce104f7ccd3a240e6f8d3303aa8 (diff) | |
download | scummvm-rg350-ab13e67b0907fdb97b0dde3bb3344650d4d12946.tar.gz scummvm-rg350-ab13e67b0907fdb97b0dde3bb3344650d4d12946.tar.bz2 scummvm-rg350-ab13e67b0907fdb97b0dde3bb3344650d4d12946.zip |
fix -Wshadow warnings
svn-id: r5270
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/imuse.cpp | 34 | ||||
-rw-r--r-- | scumm/sound.cpp | 26 |
2 files changed, 30 insertions, 30 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp index fd949a4f13..12ea06db17 100644 --- a/scumm/imuse.cpp +++ b/scumm/imuse.cpp @@ -5635,7 +5635,7 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i byte param = a >> 8; int32 sample = b, r; byte sub_cmd = c >> 8; - int8 channel = -1, l; + int8 chan = -1, l; int8 tmp; if (!(cmd || param)) @@ -5652,18 +5652,18 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i debug(2, "IMuseDigital::doCommand setting volume sample(%d), volume(%d)", sample, d); for (l = 0; l < MAX_DIGITAL_CHANNELS; l++) { if ((_channel[l]._idSound == sample) && (_channel[l]._used == true)) { - channel = l; + chan = l; break; } } - if (channel == -1) { + if (chan == -1) { warning("IMuseDigital::doCommand 12,6 sample(%d) not exist in channels", sample); return 1; } - _channel[channel]._volume = d; - _channel[channel]._volumeRight = d; - if (_channel[channel]._volumeFade != -1) { - tmp = ((_channel[channel]._volumeFade - _channel[channel]._volume) * 2) / _channel[channel]._volumeFadeParam; + _channel[chan]._volume = d; + _channel[chan]._volumeRight = d; + if (_channel[chan]._volumeFade != -1) { + tmp = ((_channel[chan]._volumeFade - _channel[chan]._volume) * 2) / _channel[chan]._volumeFadeParam; if ((tmp < 0) && (tmp > -2)) { tmp = -1; } else if ((tmp > 0) && (tmp < 2)) { @@ -5671,22 +5671,22 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i } else { tmp /= 2; } - _channel[channel]._volumeFadeStep = tmp; + _channel[chan]._volumeFadeStep = tmp; } return 0; case 7: // right volume control (0-127) debug(2, "IMuseDigital::doCommand setting right volume sample(%d),volume(%d)", sample, d); for (l = 0; l < MAX_DIGITAL_CHANNELS; l++) { if ((_channel[l]._idSound == sample) && (_channel[l]._used == true)) { - channel = l; + chan = l; break; } } - if (channel == -1) { + if (chan == -1) { warning("IMuseDigital::doCommand 12,7 sample(%d) not exist in channels", sample); return 1; } - _channel[channel]._volumeRight = d; + _channel[chan]._volumeRight = d; return 0; default: warning("IMuseDigital::doCommand 12 DEFAULT sub command %d", sub_cmd); @@ -5698,17 +5698,17 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i debug(2, "IMuseDigital::doCommand fading volume sample(%d),fade(%d, %d)", sample, d, e); for (l = 0; l < MAX_DIGITAL_CHANNELS; l++) { if ((_channel[l]._idSound == sample) && (_channel[l]._used == true)) { - channel = l; + chan = l; break; } } - if (channel == -1) { + if (chan == -1) { warning("IMuseDigital::doCommand 14,6 sample %d not exist in channels", sample); return 1; } - _channel[channel]._volumeFade = d; - _channel[channel]._volumeFadeParam = e; - tmp = ((_channel[channel]._volumeFade - _channel[channel]._volume) * 2) / _channel[channel]._volumeFadeParam; + _channel[chan]._volumeFade = d; + _channel[chan]._volumeFadeParam = e; + tmp = ((_channel[chan]._volumeFade - _channel[chan]._volume) * 2) / _channel[chan]._volumeFadeParam; if ((tmp < 0) && (tmp > -2)) { tmp = -1; } else if ((tmp > 0) && (tmp < 2)) { @@ -5716,7 +5716,7 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i } else { tmp /= 2; } - _channel[channel]._volumeFadeStep = tmp; + _channel[chan]._volumeFadeStep = tmp; return 0; default: warning("IMuseDigital::doCommand 14 DEFAULT sub command %d", sub_cmd); diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 655166d826..a8449a98c9 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -133,7 +133,7 @@ byte * Sound::readCreativeVocFile(byte * ptr, uint32 & size, uint32 & rate, uint 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 @@ byte * Sound::readCreativeVocFile(byte * ptr, uint32 & size, uint32 & rate, uint 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 @@ void Sound::playSound(int sound) { 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 @@ void Sound::playSound(int sound) { 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 @@ void Sound::playSound(int sound) { 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 @@ void Sound::playSound(int sound) { 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 @@ void Sound::playSound(int sound) { IMuse *se = _scumm->_imuse; if (se) { - _scumm->getResourceAddress(rtSound, sound); - se->start_sound(sound); + _scumm->getResourceAddress(rtSound, soundID); + se->start_sound(soundID); } } |