summaryrefslogtreecommitdiff
path: root/apps/plugins/lib
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-09-04 00:46:24 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-09-04 00:46:24 +0000
commit25123570c76f2055d3ae05d79741038c0e23c536 (patch)
treea2edd8351a611b9cef0aef08c880a994d9e1d75e /apps/plugins/lib
parentf6025186fd1f6d9083c07568bc3d160f3e8774f8 (diff)
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
Diffstat (limited to 'apps/plugins/lib')
-rw-r--r--apps/plugins/lib/picture.c13
-rw-r--r--apps/plugins/lib/picture.h1
2 files changed, 8 insertions, 6 deletions
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,