From 45f84e713c825bedd16d4f7765198a9b3ec70b46 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 8 Jul 2010 14:36:53 +0000 Subject: Make slight changes to match 16bpp implementations of bitmap plotters. svn path=/trunk/libnsfb/; revision=10610 --- src/plot/32bpp.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/plot/32bpp.c b/src/plot/32bpp.c index 01cdfbb..28c7962 100644 --- a/src/plot/32bpp.c +++ b/src/plot/32bpp.c @@ -327,7 +327,7 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc, int bmp_stride, bool alpha) { uint32_t *pvideo, *pvideo_limit; - nsfb_colour_t abpixel = 0; /* alphablended pixel */ + nsfb_colour_t abpixel; /* alphablended pixel */ int xloop; int xoff, yoff, xoffs; /* x and y offsets into image */ int x = loc->x0; @@ -348,9 +348,8 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc, clipped.x1 = x + width; clipped.y1 = y + height; - if (!nsfb_plot_clip_ctx(nsfb, &clipped)) { + if (!nsfb_plot_clip_ctx(nsfb, &clipped)) return true; - } /* get height of rendering region, after clipping */ if (height > (clipped.y1 - clipped.y0)) @@ -389,12 +388,12 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc, /* get value of source pixel in question */ abpixel = pixel[yoff + xoff]; if ((abpixel & 0xFF000000) != 0) { - /* pixel is not transparent; have to - * plot something */ + /* pixel is not transparent; have to + * plot something */ if ((abpixel & 0xFF000000) != 0xFF000000) { - /* pixel is not opaque; need to - * blend */ + /* pixel is not opaque; need to + * blend */ abpixel = nsfb_plot_ablend( abpixel, pixel_to_colour( @@ -463,7 +462,7 @@ bitmap(nsfb_t *nsfb, bool alpha) { uint32_t *pvideo; - nsfb_colour_t abpixel = 0; /* alphablended pixel */ + nsfb_colour_t abpixel; /* alphablended pixel */ int xloop, yloop; int xoff, yoff; /* x and y offset into image */ int x = loc->x0; @@ -485,9 +484,8 @@ bitmap(nsfb_t *nsfb, clipped.x1 = x + width; clipped.y1 = y + height; - if (!nsfb_plot_clip_ctx(nsfb, &clipped)) { + if (!nsfb_plot_clip_ctx(nsfb, &clipped)) return true; - } if (height > (clipped.y1 - clipped.y0)) height = (clipped.y1 - clipped.y0); -- cgit v1.2.3