From d3e33d16473194aae9e00712f12b721dcef762a5 Mon Sep 17 00:00:00 2001 From: Philip J Freeman Date: Tue, 10 Jan 2017 18:48:07 -0800 Subject: pull fix in draw.h from sparkler to stars (78d9c385ae3a1939e059c674ba5649df99d5615c) --- modules/stars/draw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/stars/draw.h b/modules/stars/draw.h index 58a4a36..5010374 100644 --- a/modules/stars/draw.h +++ b/modules/stars/draw.h @@ -24,7 +24,7 @@ static inline int draw_pixel(fb_fragment_t *f, int x, int y, uint32_t pixel) } /* FIXME this assumes stride is aligned to 4 */ - pixels[(y * f->width + (f->stride >> 2)) + x] = pixel; + pixels[(y * (f->width + (f->stride >> 2))) + x] = pixel; return 1; } -- cgit v1.2.3 From c85c7448bfb0890aad35a265147e7fd81de30cd7 Mon Sep 17 00:00:00 2001 From: Philip J Freeman Date: Tue, 10 Jan 2017 19:45:08 -0800 Subject: stars: fixed bug in opacity calculation (starslib) --- modules/stars/starslib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/stars/starslib.c b/modules/stars/starslib.c index 3c1905c..9d43062 100644 --- a/modules/stars/starslib.c +++ b/modules/stars/starslib.c @@ -114,7 +114,7 @@ int process_point( struct universe *u, struct return_point *rp ) } } else { int m = OPACITY_MAX*((u->depth-u->iterator->z)*4)/u->depth; - if ( m>=OPACITY_MAX ){ m=OPACITY_MAX-1; } + if ( m>OPACITY_MAX ){ m=OPACITY_MAX; } u->iterator->z = u->iterator->z - 1; #ifdef DEBUG printf("RETURN POINT: %lx\n", (long unsigned int )u->iterator); -- cgit v1.2.3