[Scummvm-cvs-logs] scummvm master -> 36982fb8a439990d5a28762185fe178a1c788a50

wjp wjp at usecode.org
Tue Nov 15 16:08:20 CET 2011


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:
36982fb8a4 DREAMWEB: Clean up loops


Commit: 36982fb8a439990d5a28762185fe178a1c788a50
    https://github.com/scummvm/scummvm/commit/36982fb8a439990d5a28762185fe178a1c788a50
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-11-15T07:07:34-08:00

Commit Message:
DREAMWEB: Clean up loops

Changed paths:
    engines/dreamweb/sprite.cpp



diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index 7ac3a8a..6c8c8db 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -901,16 +901,12 @@ void DreamGenContext::splitintolines() {
 Rain *DreamGenContext::splitintolines(uint8 x, uint8 y, Rain *rain) {
 	do {
 		// Look for line start
-		do {
-			if (getblockofpixel(x, y))
-				break;
+		while (!getblockofpixel(x, y)) {
 			--x;
 			++y;
-			if (x == 0)
-				return rain;
-			if (y >= data.byte(kMapysize))
+			if (x == 0 || y >= data.byte(kMapysize))
 				return rain;
-		} while (true);
+		}
 
 		rain->x = x;
 		rain->y = y;
@@ -918,28 +914,21 @@ Rain *DreamGenContext::splitintolines(uint8 x, uint8 y, Rain *rain) {
 		uint8 length = 1;
 
 		// Look for line end
-		do {
-			if (! getblockofpixel(x, y))
-				break;
+		while (getblockofpixel(x, y)) {
 			--x;
 			++y;
-			if (x == 0)
-				break;
-			if (y >= data.byte(kMapysize))
+			if (x == 0 || y >= data.byte(kMapysize))
 				break;
 			++length;
-		} while (true);
+		}
 
 		rain->size = length;
 		rain->w3_lo = engine->randomNumber();
 		rain->w3_hi = engine->randomNumber();
 		rain->b5 = (engine->randomNumber() & 3) + 4;
 		++rain;
-		if (x == 0)
-			return rain;
-		if (y >= data.byte(kMapysize))
-			return rain;
-	} while (true);
+	} while (x > 0 && y < data.byte(kMapysize));
+
 	return rain;
 }
 






More information about the Scummvm-git-logs mailing list