summaryrefslogtreecommitdiffstats
path: root/apps/plugins/pictureflow
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-09-02 03:32:50 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-09-02 03:32:50 +0000
commitf0becad4a164f578167e845a446751923007f668 (patch)
tree569f1eb32ccb6581e72cc24371dfa30108f4bc6e /apps/plugins/pictureflow
parent2111c105c0505d15bc39a1973d20b436450f5d85 (diff)
downloadrockbox-f0becad4a164f578167e845a446751923007f668.tar.gz
rockbox-f0becad4a164f578167e845a446751923007f668.tar.bz2
rockbox-f0becad4a164f578167e845a446751923007f668.zip
Pictureflow: Add support for vertical strides.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22604 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/pictureflow')
-rw-r--r--apps/plugins/pictureflow/pictureflow.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index 52209e60a2..10f9aadd07 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -1730,42 +1730,49 @@ void render_slide(struct slide_data *slide, const int alpha)
dy = (CAM_DIST_R + zo + fmul(xs, sinr)) / CAM_DIST;
const pix_t *ptr = &src[column * bmp->height];
- const int pixelstep = BUFFER_WIDTH;
+
+#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
+#define PIXELSTEP_Y 1
+#define LCDADDR(x, y) (&buffer[LCD_HEIGHT*(x) + (y)])
+#else
+#define PIXELSTEP_Y BUFFER_WIDTH
+#define LCDADDR(x, y) (&buffer[(y)*BUFFER_WIDTH + (x)])
+#endif
int p = (bmp->height-1-DISPLAY_OFFS) * PFREAL_ONE;
int plim = MAX(0, p - (LCD_HEIGHT/2-1) * dy);
- pix_t *pixel = &buffer[((LCD_HEIGHT/2)-1)*BUFFER_WIDTH + x];
+ pix_t *pixel = LCDADDR(x, (LCD_HEIGHT/2)-1 );
if (alpha == 256) {
while (p >= plim) {
*pixel = ptr[((unsigned)p) >> PFREAL_SHIFT];
p -= dy;
- pixel -= pixelstep;
+ pixel -= PIXELSTEP_Y;
}
} else {
while (p >= plim) {
*pixel = fade_color(ptr[((unsigned)p) >> PFREAL_SHIFT], alpha);
p -= dy;
- pixel -= pixelstep;
+ pixel -= PIXELSTEP_Y;
}
}
p = (bmp->height-DISPLAY_OFFS) * PFREAL_ONE;
plim = MIN(sh * PFREAL_ONE, p + (LCD_HEIGHT/2) * dy);
int plim2 = MIN(MIN(sh + REFLECT_HEIGHT, sh * 2) * PFREAL_ONE,
p + (LCD_HEIGHT/2) * dy);
- pixel = &buffer[(LCD_HEIGHT/2)*BUFFER_WIDTH + x];
+ pixel = LCDADDR(x, (LCD_HEIGHT/2) );
if (alpha == 256) {
while (p < plim) {
*pixel = ptr[((unsigned)p) >> PFREAL_SHIFT];
p += dy;
- pixel += pixelstep;
+ pixel += PIXELSTEP_Y;
}
} else {
while (p < plim) {
*pixel = fade_color(ptr[((unsigned)p) >> PFREAL_SHIFT], alpha);
p += dy;
- pixel += pixelstep;
+ pixel += PIXELSTEP_Y;
}
}
while (p < plim2) {
@@ -1773,7 +1780,7 @@ void render_slide(struct slide_data *slide, const int alpha)
int lalpha = reftab[ty];
*pixel = fade_color(ptr[sh - 1 - ty], lalpha);
p += dy;
- pixel += pixelstep;
+ pixel += PIXELSTEP_Y;
}
if (zo || slide->angle)
@@ -1790,7 +1797,6 @@ void render_slide(struct slide_data *slide, const int alpha)
return;
}
-
/**
Jump the the given slide_index
*/