[Pkg-wmaker-commits] [wmbubble] 93/207: Make drawing bubbles clearer (less pointer walking)

Doug Torrance dtorrance-guest at moszumanska.debian.org
Mon Aug 24 04:18:09 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmbubble.

commit 7c1078c1edc7454bb82a33fc792ead8f6775435d
Author: Robert Jacobs <rnjacobs at mit.edu>
Date:   Sun Aug 21 02:02:21 2011 -0700

    Make drawing bubbles clearer (less pointer walking)
---
 bubblemon.c | 44 ++++++++++++++++----------------------------
 1 file changed, 16 insertions(+), 28 deletions(-)

diff --git a/bubblemon.c b/bubblemon.c
index b24693c..e51aefe 100644
--- a/bubblemon.c
+++ b/bubblemon.c
@@ -825,38 +825,26 @@ void draw_watertank(void) {
 
 		/* Top row */
 		bubblebuf_ptr = &(bm.bubblebuf[(((REALY(bm.bubbles[i].y) - 1) * BOX_SIZE) + BOX_SIZE) + bm.bubbles[i].x - 1]);
-		if (*bubblebuf_ptr < aircolor)
-			(*bubblebuf_ptr)++; /* water becomes antialias; antialias becomes air for outside corners */
-		bubblebuf_ptr++;
-			
-		*bubblebuf_ptr = aircolor;
-		bubblebuf_ptr++;
-			
-		if (*bubblebuf_ptr < aircolor)
-			(*bubblebuf_ptr)++;
-		bubblebuf_ptr += BOX_SIZE-2;
+		if (bubblebuf_ptr[0] < aircolor)
+			bubblebuf_ptr[0]++; /* water becomes antialias; antialias becomes air for outside corners */
+		bubblebuf_ptr[1] = aircolor;
+		if (bubblebuf_ptr[2] < aircolor)
+			bubblebuf_ptr[2]++;
+		bubblebuf_ptr += BOX_SIZE;
 		
 		/* Middle row - no color clipping necessary */
-		*bubblebuf_ptr = aircolor;
-		bubblebuf_ptr++;
-		*bubblebuf_ptr = aircolor;
-		bubblebuf_ptr++;
-		*bubblebuf_ptr = aircolor;
-		bubblebuf_ptr += BOX_SIZE-2;
+		bubblebuf_ptr[0] = aircolor;
+		bubblebuf_ptr[1] = aircolor;
+		bubblebuf_ptr[2] = aircolor;
+		bubblebuf_ptr += BOX_SIZE;
 
 		/* Bottom row */
-		if (y < MAKEY(BOX_SIZE-1)) {
-			if (*bubblebuf_ptr < aircolor) {
-				(*bubblebuf_ptr)++;
-			}
-			bubblebuf_ptr++;
-			
-			*bubblebuf_ptr = aircolor;
-			bubblebuf_ptr++;
-			
-			if (*bubblebuf_ptr < aircolor) {
-				(*bubblebuf_ptr)++;
-			}
+		if (bm.bubbles[i].y < MAKEY(BOX_SIZE-1)) {
+			if (bubblebuf_ptr[0] < aircolor)
+				bubblebuf_ptr[0]++;
+			bubblebuf_ptr[1] = aircolor;
+			if (bubblebuf_ptr[2] < aircolor)
+				bubblebuf_ptr[2]++;
 		}
 	}
 }	/* bubblemon_update */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbubble.git



More information about the Pkg-wmaker-commits mailing list