make the plugin API frambuffer agnostic

Change-Id: I5abdc231093054c517ff53b9a456997e440e3f6e
This commit is contained in:
Moshe Piekarski 2020-10-06 13:34:04 -05:00 committed by William Wilgus
parent 5d5f8169b5
commit 12f3ed1699
25 changed files with 92 additions and 93 deletions

View file

@ -776,12 +776,12 @@ bool aliens_down, aliens_right, hit_left_border, hit_right_border;
#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
static inline fb_data get_pixel(int x, int y)
{
return rb->lcd_framebuffer[x*LCD_HEIGHT+y];
return *rb->lcd_framebuffer[x*LCD_HEIGHT+y];
}
#else
static inline fb_data get_pixel(int x, int y)
{
return rb->lcd_framebuffer[ytab[y] + x];
return *rb->lcd_framebuffer[ytab[y] + x];
}
#endif
@ -794,7 +794,7 @@ static const unsigned char shifts[4] = {
/* Horizontal packing */
static inline fb_data get_pixel(int x, int y)
{
return (rb->lcd_framebuffer[ytab[y] + (x >> 2)] >> shifts[x & 3]) & 3;
return (*rb->lcd_framebuffer[ytab[y] + (x >> 2)] >> shifts[x & 3]) & 3;
}
#else
/* Vertical packing */
@ -803,7 +803,7 @@ static const unsigned char shifts[4] = {
};
static inline fb_data get_pixel(int x, int y)
{
return (rb->lcd_framebuffer[ytab[y] + x] >> shifts[y & 3]) & 3;
return (*rb->lcd_framebuffer[ytab[y] + x] >> shifts[y & 3]) & 3;
}
#endif /* Horizontal/Vertical packing */