From 25123570c76f2055d3ae05d79741038c0e23c536 Mon Sep 17 00:00:00 2001 From: Karl Kurbjun Date: Fri, 4 Sep 2009 00:46:24 +0000 Subject: Fix STRIDE macro for multiscreen and add stride support for picture lib. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22615 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/lib/picture.c | 13 +++++++------ apps/plugins/lib/picture.h | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'apps/plugins/lib') diff --git a/apps/plugins/lib/picture.c b/apps/plugins/lib/picture.c index a759b945b6..7717b76eeb 100644 --- a/apps/plugins/lib/picture.c +++ b/apps/plugins/lib/picture.c @@ -26,15 +26,15 @@ void picture_draw(struct screen* display, const struct picture* picture, display->bitmap( picture->data, x, y, - picture->width, picture->height + picture->width, picture->slide_height ); } /** * Draws a part of the given picture on the given screen * Use it when the data contains multiple pictures from top to bottom. - * In that case, picture.height represents the height of one picture, - * not the whole set. + * In that case, picture.slide_height represents the height of one picture, + * not the whole set. picture.height represents the height of the whole image * @param display the screen where to display the picture * @param picture the picture's data, only a part will be displayed * @param yoffset display the data in the picture from yoffset to @@ -49,9 +49,9 @@ void vertical_picture_draw_part(struct screen* display, const struct picture* pi picture->data, /*slice into picture->data */ 0, yoffset, - picture->width, + STRIDE(display->screen_type, picture->width, picture->height), /* Position on the screen */ - x, y, picture->width, picture->height + x, y, picture->width, picture->slide_height ); } @@ -68,5 +68,6 @@ void vertical_picture_draw_part(struct screen* display, const struct picture* pi void vertical_picture_draw_sprite(struct screen* display, const struct picture* picture, int sprite_no, int x, int y){ - vertical_picture_draw_part(display, picture, sprite_no*picture->height, x, y); + vertical_picture_draw_part( display, picture, + sprite_no*picture->slide_height, x, y); } diff --git a/apps/plugins/lib/picture.h b/apps/plugins/lib/picture.h index 0013489039..7aa9899018 100644 --- a/apps/plugins/lib/picture.h +++ b/apps/plugins/lib/picture.h @@ -27,6 +27,7 @@ struct picture{ const void* data; int width; int height; + int slide_height; }; void picture_draw(struct screen* display, const struct picture* picture, -- cgit v1.2.3