mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-10 13:45:10 -05:00
Define LCD_STRIDEFORMAT unconditionally
Instead of putting "#ifdef LCD_STRIDEFORMAT" at every usage of the macro it's simpler to have config.h define LCD_STRIDEFORMAT to the default of horizontal stride when the target leaves it unspecified. Change-Id: Ib187012aad65ac678dbd837b1464a83bad722411
This commit is contained in:
parent
9ed36ec22f
commit
f373c97c90
26 changed files with 44 additions and 43 deletions
|
|
@ -78,7 +78,7 @@ void smooth_resize_bitmap(struct bitmap *src_bmp, struct bitmap *dest_bmp)
|
|||
fb_data *sptr, *dptr;
|
||||
int x, y, end;
|
||||
int val_y = 0, val_x;
|
||||
#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
|
||||
#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
|
||||
const int sw = src_bmp->height;
|
||||
const int sh = src_bmp->width;
|
||||
const int dw = dest_bmp->height;
|
||||
|
|
|
|||
|
|
@ -106,10 +106,10 @@ static struct osd grey_osd;
|
|||
# error Unknown 2-bit format; please define macros
|
||||
# endif /* LCD_PIXELFORMAT */
|
||||
#elif LCD_DEPTH == 16
|
||||
# if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
|
||||
# if LCD_STRIDEFORMAT == VERTICAL_STRIDE
|
||||
# define _OSD_HEIGHT2BYTES(h) ((h)*2)
|
||||
# define _OSD_BYTES2HEIGHT(b) ((b)/2)
|
||||
# else /* !defined(LCD_STRIDEFORMAT) || LCD_STRIDEFORMAT != VERTICAL_STRIDE */
|
||||
# else /* LCD_STRIDEFORMAT != VERTICAL_STRIDE */
|
||||
# define _OSD_WIDTH2BYTES(w) ((w)*2)
|
||||
# define _OSD_BYTES2WIDTH(b) ((b)/2)
|
||||
# endif /* end stride type selection */
|
||||
|
|
@ -160,7 +160,7 @@ static void * _osd_lcd_init_buffers(struct osd *osd, unsigned flags,
|
|||
|
||||
rb->viewport_set_fullscreen(&osd->vp, SCREEN_MAIN);
|
||||
|
||||
#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
|
||||
#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
|
||||
int colbytes = _OSD_HEIGHT2BYTES(LCD_HEIGHT);
|
||||
int bytecols = *bufsize / colbytes;
|
||||
int w = _OSD_BYTES2WIDTH(bytecols);
|
||||
|
|
@ -193,7 +193,7 @@ static void * _osd_lcd_init_buffers(struct osd *osd, unsigned flags,
|
|||
w = _OSD_BYTES2WIDTH(_OSD_WIDTH2BYTES(w));
|
||||
osd->lcd_bitmap_stride = _OSD_BYTES2HEIGHT(_OSD_HEIGHT2BYTES(LCD_HEIGHT));
|
||||
osd->back_bitmap_stride = h;
|
||||
#else /* !defined(LCD_STRIDEFORMAT) || LCD_STRIDEFORMAT != VERTICAL_STRIDE */
|
||||
#else /* LCD_STRIDEFORMAT != VERTICAL_STRIDE */
|
||||
int rowbytes = _OSD_WIDTH2BYTES(LCD_WIDTH);
|
||||
int byterows = *bufsize / rowbytes;
|
||||
int w = _OSD_BYTES2WIDTH(rowbytes);
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ int save_bmp_file( char* filename, struct bitmap *bm )
|
|||
*/
|
||||
void simple_resize_bitmap(struct bitmap *src, struct bitmap *dst)
|
||||
{
|
||||
#if defined(LCD_STRIDEFORMAT) && (LCD_STRIDEFORMAT == VERTICAL_STRIDE)
|
||||
#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
|
||||
const int srcw = src->height;
|
||||
const int srch = src->width;
|
||||
const int dstw = dst->height;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
static const unsigned short patterns[4] = {0xFFFF, 0xFF00, 0x00FF, 0x0000};
|
||||
#endif
|
||||
|
||||
#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
|
||||
#if LCD_STRIDEFORMAT == VERTICAL_STRIDE
|
||||
void xlcd_scroll_left(int count)
|
||||
{
|
||||
/*size_t dst_stride;*/
|
||||
|
|
@ -668,4 +668,4 @@ void xlcd_scroll_down(int count)
|
|||
}
|
||||
|
||||
#endif /* LCD_PIXELFORMAT, LCD_DEPTH */
|
||||
#endif /* defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE */
|
||||
#endif /* LCD_STRIDEFORMAT == VERTICAL_STRIDE */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue