From fbfd3e2f31f08ab0736b2af491cbf0d7a449fc10 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Wed, 8 Feb 2006 08:45:17 +0000 Subject: Changed the 'stride' parameter of all *_bitmap_part() function to always mean the source bitmap width in pixels. Playergfx was the only engine where this was not true. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8621 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/lib/playergfx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/plugins/lib/playergfx.c b/apps/plugins/lib/playergfx.c index 87be782d4d..d7e1ce26e8 100644 --- a/apps/plugins/lib/playergfx.c +++ b/apps/plugins/lib/playergfx.c @@ -430,7 +430,7 @@ void pgfx_fillrect(int x, int y, int width, int height) * * This approximates the (even more strange) internal hardware format. */ -/* Draw a partial bitmap. Note that stride is given in bytes */ +/* Draw a partial bitmap. stride is given in pixels */ void pgfx_bitmap_part(const unsigned char *src, int src_x, int src_y, int stride, int x, int y, int width, int height) { @@ -461,6 +461,8 @@ void pgfx_bitmap_part(const unsigned char *src, int src_x, int src_y, width = pixel_width - x; if (y + height > pixel_height) height = pixel_height - y; + + stride = (stride + 7) >> 3; /* convert to no. of bytes */ src += stride * src_y + (src_x >> 3); /* move starting point */ dst = &gfx_buffer[pixel_height * (x/5) + y]; @@ -507,7 +509,7 @@ void pgfx_bitmap_part(const unsigned char *src, int src_x, int src_y, /* Draw a full bitmap */ void pgfx_bitmap(const unsigned char *src, int x, int y, int width, int height) { - pgfx_bitmap_part(src, 0, 0, (width + 7) >> 3, x, y, width, height); + pgfx_bitmap_part(src, 0, 0, width, x, y, width, height); } #endif /* HAVE_LCD_CHARCELLS */ -- cgit v1.2.3