aboutsummaryrefslogtreecommitdiff
path: root/engines/lab
diff options
context:
space:
mode:
authorStrangerke2015-12-26 16:14:25 +0100
committerStrangerke2015-12-26 16:14:25 +0100
commit286cd8164359ac142514ce7eb23df1ff16d73527 (patch)
tree77ed4e2d4abbb2a1e3d7295c61d2c22b52f51cb7 /engines/lab
parentf41267311d291ce71b5499f1e118f699cd4b817b (diff)
downloadscummvm-rg350-286cd8164359ac142514ce7eb23df1ff16d73527.tar.gz
scummvm-rg350-286cd8164359ac142514ce7eb23df1ff16d73527.tar.bz2
scummvm-rg350-286cd8164359ac142514ce7eb23df1ff16d73527.zip
LAB: Rewrite while statements in blitBitmap
Diffstat (limited to 'engines/lab')
-rw-r--r--engines/lab/image.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/engines/lab/image.cpp b/engines/lab/image.cpp
index 4c058a29ee..08c4f6ca34 100644
--- a/engines/lab/image.cpp
+++ b/engines/lab/image.cpp
@@ -73,24 +73,18 @@ void Image::blitBitmap(uint16 srcX, uint16 srcY, Image *imgDest,
byte *dest = destBuffer + destY * destWidth + destX;
if (!masked) {
- while (clipHeight-- > 0) {
+ for (int i = 0; i < clipHeight; i++) {
memcpy(dest, img, clipWidth);
img += _width;
dest += destWidth;
}
} else {
- while (clipHeight-- > 0) {
- byte *maskedImg = img;
- byte *maskedDest = dest;
- int maskedWidth = clipWidth;
-
- while (maskedWidth-- > 0) {
- byte c = *maskedImg++;
+ for (int i = 0; i < clipHeight; i++) {
+ for (int j = 0; j < clipWidth; j++) {
+ byte c = img[j];
if (c)
- *maskedDest++ = c - 1;
- else
- maskedDest++;
+ dest[j] = c - 1;
}
img += _width;