diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-02-08 08:45:17 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-02-08 08:45:17 +0000 |
commit | fbfd3e2f31f08ab0736b2af491cbf0d7a449fc10 (patch) | |
tree | f400bc324700f040e2c93f0a05536fc94b81f317 | |
parent | bfbbf4705f2d4c1d741b071f64a164b339d1be1a (diff) | |
download | rockbox-fbfd3e2f31f08ab0736b2af491cbf0d7a449fc10.tar.gz rockbox-fbfd3e2f31f08ab0736b2af491cbf0d7a449fc10.zip |
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
-rw-r--r-- | apps/plugins/lib/playergfx.c | 6 |
1 files changed, 4 insertions, 2 deletions
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) | |||
430 | * | 430 | * |
431 | * This approximates the (even more strange) internal hardware format. */ | 431 | * This approximates the (even more strange) internal hardware format. */ |
432 | 432 | ||
433 | /* Draw a partial bitmap. Note that stride is given in bytes */ | 433 | /* Draw a partial bitmap. stride is given in pixels */ |
434 | void pgfx_bitmap_part(const unsigned char *src, int src_x, int src_y, | 434 | void pgfx_bitmap_part(const unsigned char *src, int src_x, int src_y, |
435 | int stride, int x, int y, int width, int height) | 435 | int stride, int x, int y, int width, int height) |
436 | { | 436 | { |
@@ -461,6 +461,8 @@ void pgfx_bitmap_part(const unsigned char *src, int src_x, int src_y, | |||
461 | width = pixel_width - x; | 461 | width = pixel_width - x; |
462 | if (y + height > pixel_height) | 462 | if (y + height > pixel_height) |
463 | height = pixel_height - y; | 463 | height = pixel_height - y; |
464 | |||
465 | stride = (stride + 7) >> 3; /* convert to no. of bytes */ | ||
464 | 466 | ||
465 | src += stride * src_y + (src_x >> 3); /* move starting point */ | 467 | src += stride * src_y + (src_x >> 3); /* move starting point */ |
466 | dst = &gfx_buffer[pixel_height * (x/5) + y]; | 468 | 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, | |||
507 | /* Draw a full bitmap */ | 509 | /* Draw a full bitmap */ |
508 | void pgfx_bitmap(const unsigned char *src, int x, int y, int width, int height) | 510 | void pgfx_bitmap(const unsigned char *src, int x, int y, int width, int height) |
509 | { | 511 | { |
510 | pgfx_bitmap_part(src, 0, 0, (width + 7) >> 3, x, y, width, height); | 512 | pgfx_bitmap_part(src, 0, 0, width, x, y, width, height); |
511 | } | 513 | } |
512 | 514 | ||
513 | #endif /* HAVE_LCD_CHARCELLS */ | 515 | #endif /* HAVE_LCD_CHARCELLS */ |