aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2007-01-29 21:34:39 +0000
committerJohannes Schickel2007-01-29 21:34:39 +0000
commit7bb9b05f551b81f3c34dacf3bea80ae7fd726fbc (patch)
treedcf6e6248eda7183925089d8ef0f5ba2a5fcac77 /engines/kyra
parent004b17446c1e8855d484670ccc49aae2027324f4 (diff)
downloadscummvm-rg350-7bb9b05f551b81f3c34dacf3bea80ae7fd726fbc.tar.gz
scummvm-rg350-7bb9b05f551b81f3c34dacf3bea80ae7fd726fbc.tar.bz2
scummvm-rg350-7bb9b05f551b81f3c34dacf3bea80ae7fd726fbc.zip
cleanup
svn-id: r25268
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/sound.h1
-rw-r--r--engines/kyra/sound_towns.cpp20
2 files changed, 10 insertions, 11 deletions
diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h
index fdb243f67e..2c09716c2f 100644
--- a/engines/kyra/sound.h
+++ b/engines/kyra/sound.h
@@ -262,7 +262,6 @@ private:
bool _sfxIsPlaying;
uint _sfxFileIndex;
uint8 *_sfxFileData;
- uint8 *_sfxPlaybackBuffer;
static const char *_sfxFiles[];
static const int _sfxFilenum;
diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp
index 6e7ec74807..cfb2d99811 100644
--- a/engines/kyra/sound_towns.cpp
+++ b/engines/kyra/sound_towns.cpp
@@ -32,7 +32,7 @@
namespace Kyra {
SoundTowns::SoundTowns(KyraEngine *engine, Audio::Mixer *mixer) : Sound(engine, mixer), _lastTrack(-1),
- _currentSFX(0), _sfxFileData(0), _sfxFileIndex((uint)-1), _sfxPlaybackBuffer(0), _sfxWDTable(0) {
+ _currentSFX(0), _sfxFileData(0), _sfxFileIndex((uint)-1), _sfxWDTable(0) {
}
SoundTowns::~SoundTowns() {
@@ -206,17 +206,17 @@ void SoundTowns::playSoundEffect(uint8 track) {
uint32 playbackBufferSize = (sfxHeaderID == 1) ? sfxHeaderInBufferSize : sfxHeaderOutBufferSize;
stopSoundEffect();
- _sfxPlaybackBuffer = new uint8[playbackBufferSize];
- memset(_sfxPlaybackBuffer, 0x80, playbackBufferSize);
+ uint8 *sfxPlaybackBuffer = new uint8[playbackBufferSize];
+ memset(sfxPlaybackBuffer, 0x80, playbackBufferSize);
uint8 * sfxBody = ((uint8*)sfxHeader) + 0x20;
if (!sfxHeaderID) {
- memcpy(_sfxPlaybackBuffer, sfxBody, playbackBufferSize);
+ memcpy(sfxPlaybackBuffer, sfxBody, playbackBufferSize);
} else if (sfxHeaderID == 1) {
- Screen::decodeFrame4(sfxBody, _sfxPlaybackBuffer, playbackBufferSize);
+ Screen::decodeFrame4(sfxBody, sfxPlaybackBuffer, playbackBufferSize);
} else if (_sfxWDTable) {
- uint8 * tgt = _sfxPlaybackBuffer;
+ uint8 * tgt = sfxPlaybackBuffer;
uint32 sfx_BtTable_Offset = 0;
uint32 sfx_WdTable_Offset = 0;
uint32 sfx_WdTable_Number = 5;
@@ -234,16 +234,16 @@ void SoundTowns::playSoundEffect(uint8 track) {
}
for (uint32 i = 0; i < playbackBufferSize; i++) {
- if (_sfxPlaybackBuffer[i] < 0x80)
- _sfxPlaybackBuffer[i] = 0x80 - _sfxPlaybackBuffer[i];
+ if (sfxPlaybackBuffer[i] < 0x80)
+ sfxPlaybackBuffer[i] = 0x80 - sfxPlaybackBuffer[i];
}
playbackBufferSize -= 0x20;
- setPitch(_sfxPlaybackBuffer, playbackBufferSize, sfxHeader->pitch, pitch);
+ setPitch(sfxPlaybackBuffer, playbackBufferSize, sfxHeader->pitch, pitch);
_currentSFX = Audio::makeLinearInputStream(0x2b11,
Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_LITTLE_ENDIAN | Audio::Mixer::FLAG_AUTOFREE,
- _sfxPlaybackBuffer, playbackBufferSize, 0, 0);
+ sfxPlaybackBuffer, playbackBufferSize, 0, 0);
_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_sfxHandle, _currentSFX);
}