aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorAlyssa Milburn2011-07-17 15:10:58 +0200
committerAlyssa Milburn2011-07-17 15:10:58 +0200
commit85df146ad42c79644d1916a9f2660603a8294d4a (patch)
tree74b3a7850771e2b3f5672227b9e92aec0bf75a7b /engines
parent1a9ec35de6aac704fdfbd5e3a928ef68bb59094e (diff)
downloadscummvm-rg350-85df146ad42c79644d1916a9f2660603a8294d4a.tar.gz
scummvm-rg350-85df146ad42c79644d1916a9f2660603a8294d4a.tar.bz2
scummvm-rg350-85df146ad42c79644d1916a9f2660603a8294d4a.zip
COMPOSER: Don't use memcpy for overlapping copies (fixes gaps in some sprites).
Diffstat (limited to 'engines')
-rw-r--r--engines/composer/composer.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp
index 639b077ed7..accbe7dda5 100644
--- a/engines/composer/composer.cpp
+++ b/engines/composer/composer.cpp
@@ -1389,8 +1389,10 @@ static void decompressSLWM(byte *buffer, Common::SeekableReadStream *stream) {
count += 2;
start++;
- memcpy(buffer, buffer - start, count);
- buffer += count;
+ for (uint i = 0; i < count; i++) {
+ *buffer = *(buffer - start);
+ buffer++;
+ }
}
}
@@ -1441,8 +1443,11 @@ void ComposerEngine::decompressBitmap(uint16 type, Common::SeekableReadStream *s
size -= 2;
}
count += 4;
- memcpy(buffer, buffer - step - 1, count);
- buffer += count;
+ // this is often overlapping (for repeating patterns)
+ for (uint i = 0; i < count; i++) {
+ *buffer = *(buffer - step - 1);
+ buffer++;
+ }
}
break;
case kBitmapRLESLWM: