diff options
author | Max Horn | 2007-01-26 11:47:26 +0000 |
---|---|---|
committer | Max Horn | 2007-01-26 11:47:26 +0000 |
commit | 516cd07d108f838d15d94fd4d489596cc0382263 (patch) | |
tree | 80e3e60f89fd1540a82a7271306f774ed85ca3b6 /sound/mods/paula.cpp | |
parent | dd5b1e41fba4757a79d6e162217a7ebdb0032734 (diff) | |
download | scummvm-rg350-516cd07d108f838d15d94fd4d489596cc0382263.tar.gz scummvm-rg350-516cd07d108f838d15d94fd4d489596cc0382263.tar.bz2 scummvm-rg350-516cd07d108f838d15d94fd4d489596cc0382263.zip |
Some cleanup / code formatting changes, and added some FIXME comments
svn-id: r25199
Diffstat (limited to 'sound/mods/paula.cpp')
-rw-r--r-- | sound/mods/paula.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sound/mods/paula.cpp b/sound/mods/paula.cpp index 90d247096c..33a8dd7c2a 100644 --- a/sound/mods/paula.cpp +++ b/sound/mods/paula.cpp @@ -45,8 +45,7 @@ Paula::~Paula() { } void Paula::clearVoice(byte voice) { - if (voice >= 4) - return; + assert(voice < NUM_VOICES); _voice[voice].data = 0; _voice[voice].dataRepeat = 0; @@ -68,12 +67,14 @@ int Paula::readBuffer(int16 *buffer, const int numSamples) { int16 *p; int8 *data; - _mutex.lock(); +// FIXME: Could this code be unified/merged with ProtrackerStream::generateSound? +// They look very similar. Maybe one could be rewritten to +// use the other? + + Common::StackLock lock(_mutex); memset(buffer, 0, numSamples * 2); - if (!_playing) - { - _mutex.unlock(); + if (!_playing) { return numSamples; } @@ -84,7 +85,7 @@ int Paula::readBuffer(int16 *buffer, const int numSamples) { _curInt = 0; } nSamples = MIN(samples, _intFreq - _curInt); - for (voice = 0; voice < 4; voice++) { + for (voice = 0; voice < NUM_VOICES; voice++) { if (!_voice[voice].data || (_voice[voice].period <= 0)) continue; @@ -160,7 +161,6 @@ int Paula::readBuffer(int16 *buffer, const int numSamples) { _curInt += nSamples; samples -= nSamples; } - _mutex.unlock(); return numSamples; } |