[Scummvm-cvs-logs] scummvm master -> 286cd8164359ac142514ce7eb23df1ff16d73527

Strangerke Strangerke at scummvm.org
Sat Dec 26 16:20:33 CET 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
286cd81643 LAB: Rewrite while statements in blitBitmap


Commit: 286cd8164359ac142514ce7eb23df1ff16d73527
    https://github.com/scummvm/scummvm/commit/286cd8164359ac142514ce7eb23df1ff16d73527
Author: Strangerke (strangerke at scummvm.org)
Date: 2015-12-26T16:14:25+01:00

Commit Message:
LAB: Rewrite while statements in blitBitmap

Changed paths:
    engines/lab/image.cpp



diff --git a/engines/lab/image.cpp b/engines/lab/image.cpp
index 4c058a2..08c4f6c 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;






More information about the Scummvm-git-logs mailing list