summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/playergfx.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-02-08 08:45:17 +0000
committerJens Arnold <amiconn@rockbox.org>2006-02-08 08:45:17 +0000
commitfbfd3e2f31f08ab0736b2af491cbf0d7a449fc10 (patch)
treef400bc324700f040e2c93f0a05536fc94b81f317 /apps/plugins/lib/playergfx.c
parentbfbbf4705f2d4c1d741b071f64a164b339d1be1a (diff)
downloadrockbox-fbfd3e2f31f08ab0736b2af491cbf0d7a449fc10.zip
rockbox-fbfd3e2f31f08ab0736b2af491cbf0d7a449fc10.tar.gz
rockbox-fbfd3e2f31f08ab0736b2af491cbf0d7a449fc10.tar.bz2
rockbox-fbfd3e2f31f08ab0736b2af491cbf0d7a449fc10.tar.xz
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
Diffstat (limited to 'apps/plugins/lib/playergfx.c')
-rw-r--r--apps/plugins/lib/playergfx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/plugins/lib/playergfx.c b/apps/plugins/lib/playergfx.c
index 87be782..d7e1ce2 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 */