aboutsummaryrefslogtreecommitdiff
path: root/sound/mods/protracker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sound/mods/protracker.cpp')
-rw-r--r--sound/mods/protracker.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/mods/protracker.cpp b/sound/mods/protracker.cpp
index ab3776624b..83fb1790cf 100644
--- a/sound/mods/protracker.cpp
+++ b/sound/mods/protracker.cpp
@@ -179,9 +179,12 @@ void ProtrackerStream::generateSound() {
_buf->ensureCapacity(samples);
+// FIXME: Could this code be unified/ with Paula::readBuffer?
+// They look very similar. Maybe one could be rewritten to
+// use the other?
+
int16 *p = _buf->getEnd();
- for (int i = 0; i < samples; i++)
- p[i] = 0;
+ memset(p, 0, samples * sizeof(int16));
for (int track = 0; track < 4; track++) {
if (_track[track].sample > 0) {
@@ -234,8 +237,7 @@ void ProtrackerStream::generateSound() {
}
} else {
if (offset < slen) {
- if ((int)(offset + samples * rate) >=
- slen) {
+ if ((int)(offset + samples * rate) >= slen) {
/* The end of the sample is the limiting factor */
int end = (int)((slen - offset) / rate);