Pictureflow: Add support for vertical strides.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22604 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2111c105c0
commit
f0becad4a1
1 changed files with 15 additions and 9 deletions
|
@ -1730,42 +1730,49 @@ void render_slide(struct slide_data *slide, const int alpha)
|
||||||
dy = (CAM_DIST_R + zo + fmul(xs, sinr)) / CAM_DIST;
|
dy = (CAM_DIST_R + zo + fmul(xs, sinr)) / CAM_DIST;
|
||||||
|
|
||||||
const pix_t *ptr = &src[column * bmp->height];
|
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 p = (bmp->height-1-DISPLAY_OFFS) * PFREAL_ONE;
|
||||||
int plim = MAX(0, p - (LCD_HEIGHT/2-1) * dy);
|
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) {
|
if (alpha == 256) {
|
||||||
while (p >= plim) {
|
while (p >= plim) {
|
||||||
*pixel = ptr[((unsigned)p) >> PFREAL_SHIFT];
|
*pixel = ptr[((unsigned)p) >> PFREAL_SHIFT];
|
||||||
p -= dy;
|
p -= dy;
|
||||||
pixel -= pixelstep;
|
pixel -= PIXELSTEP_Y;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (p >= plim) {
|
while (p >= plim) {
|
||||||
*pixel = fade_color(ptr[((unsigned)p) >> PFREAL_SHIFT], alpha);
|
*pixel = fade_color(ptr[((unsigned)p) >> PFREAL_SHIFT], alpha);
|
||||||
p -= dy;
|
p -= dy;
|
||||||
pixel -= pixelstep;
|
pixel -= PIXELSTEP_Y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p = (bmp->height-DISPLAY_OFFS) * PFREAL_ONE;
|
p = (bmp->height-DISPLAY_OFFS) * PFREAL_ONE;
|
||||||
plim = MIN(sh * PFREAL_ONE, p + (LCD_HEIGHT/2) * dy);
|
plim = MIN(sh * PFREAL_ONE, p + (LCD_HEIGHT/2) * dy);
|
||||||
int plim2 = MIN(MIN(sh + REFLECT_HEIGHT, sh * 2) * PFREAL_ONE,
|
int plim2 = MIN(MIN(sh + REFLECT_HEIGHT, sh * 2) * PFREAL_ONE,
|
||||||
p + (LCD_HEIGHT/2) * dy);
|
p + (LCD_HEIGHT/2) * dy);
|
||||||
pixel = &buffer[(LCD_HEIGHT/2)*BUFFER_WIDTH + x];
|
pixel = LCDADDR(x, (LCD_HEIGHT/2) );
|
||||||
|
|
||||||
if (alpha == 256) {
|
if (alpha == 256) {
|
||||||
while (p < plim) {
|
while (p < plim) {
|
||||||
*pixel = ptr[((unsigned)p) >> PFREAL_SHIFT];
|
*pixel = ptr[((unsigned)p) >> PFREAL_SHIFT];
|
||||||
p += dy;
|
p += dy;
|
||||||
pixel += pixelstep;
|
pixel += PIXELSTEP_Y;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (p < plim) {
|
while (p < plim) {
|
||||||
*pixel = fade_color(ptr[((unsigned)p) >> PFREAL_SHIFT], alpha);
|
*pixel = fade_color(ptr[((unsigned)p) >> PFREAL_SHIFT], alpha);
|
||||||
p += dy;
|
p += dy;
|
||||||
pixel += pixelstep;
|
pixel += PIXELSTEP_Y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (p < plim2) {
|
while (p < plim2) {
|
||||||
|
@ -1773,7 +1780,7 @@ void render_slide(struct slide_data *slide, const int alpha)
|
||||||
int lalpha = reftab[ty];
|
int lalpha = reftab[ty];
|
||||||
*pixel = fade_color(ptr[sh - 1 - ty], lalpha);
|
*pixel = fade_color(ptr[sh - 1 - ty], lalpha);
|
||||||
p += dy;
|
p += dy;
|
||||||
pixel += pixelstep;
|
pixel += PIXELSTEP_Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zo || slide->angle)
|
if (zo || slide->angle)
|
||||||
|
@ -1790,7 +1797,6 @@ void render_slide(struct slide_data *slide, const int alpha)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Jump the the given slide_index
|
Jump the the given slide_index
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue