diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-09-30 10:25:28 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-09-30 10:42:49 +0100 |
commit | f373c97c90e816404c00ab48b2e36b18fd5e6c49 (patch) | |
tree | b268985996c496f9149e4508f9fea950711e1a6c /apps/plugins/lib | |
parent | 9ed36ec22f7ea880b64fa11d2c0d49485287ad03 (diff) | |
download | rockbox-f373c97c90e816404c00ab48b2e36b18fd5e6c49.tar.gz rockbox-f373c97c90e816404c00ab48b2e36b18fd5e6c49.zip |
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
Diffstat (limited to 'apps/plugins/lib')
-rw-r--r-- | apps/plugins/lib/bmp_smooth_scale.c | 2 | ||||
-rw-r--r-- | apps/plugins/lib/osd.c | 8 | ||||
-rw-r--r-- | apps/plugins/lib/pluginlib_bmp.c | 2 | ||||
-rw-r--r-- | apps/plugins/lib/xlcd_scroll.c | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/apps/plugins/lib/bmp_smooth_scale.c b/apps/plugins/lib/bmp_smooth_scale.c index c5f258cdbf..378ff96448 100644 --- a/apps/plugins/lib/bmp_smooth_scale.c +++ b/apps/plugins/lib/bmp_smooth_scale.c | |||
@@ -78,7 +78,7 @@ void smooth_resize_bitmap(struct bitmap *src_bmp, struct bitmap *dest_bmp) | |||
78 | fb_data *sptr, *dptr; | 78 | fb_data *sptr, *dptr; |
79 | int x, y, end; | 79 | int x, y, end; |
80 | int val_y = 0, val_x; | 80 | int val_y = 0, val_x; |
81 | #if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE | 81 | #if LCD_STRIDEFORMAT == VERTICAL_STRIDE |
82 | const int sw = src_bmp->height; | 82 | const int sw = src_bmp->height; |
83 | const int sh = src_bmp->width; | 83 | const int sh = src_bmp->width; |
84 | const int dw = dest_bmp->height; | 84 | const int dw = dest_bmp->height; |
diff --git a/apps/plugins/lib/osd.c b/apps/plugins/lib/osd.c index 7d6e10a410..99f77da7dc 100644 --- a/apps/plugins/lib/osd.c +++ b/apps/plugins/lib/osd.c | |||
@@ -106,10 +106,10 @@ static struct osd grey_osd; | |||
106 | # error Unknown 2-bit format; please define macros | 106 | # error Unknown 2-bit format; please define macros |
107 | # endif /* LCD_PIXELFORMAT */ | 107 | # endif /* LCD_PIXELFORMAT */ |
108 | #elif LCD_DEPTH == 16 | 108 | #elif LCD_DEPTH == 16 |
109 | # if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE | 109 | # if LCD_STRIDEFORMAT == VERTICAL_STRIDE |
110 | # define _OSD_HEIGHT2BYTES(h) ((h)*2) | 110 | # define _OSD_HEIGHT2BYTES(h) ((h)*2) |
111 | # define _OSD_BYTES2HEIGHT(b) ((b)/2) | 111 | # define _OSD_BYTES2HEIGHT(b) ((b)/2) |
112 | # else /* !defined(LCD_STRIDEFORMAT) || LCD_STRIDEFORMAT != VERTICAL_STRIDE */ | 112 | # else /* LCD_STRIDEFORMAT != VERTICAL_STRIDE */ |
113 | # define _OSD_WIDTH2BYTES(w) ((w)*2) | 113 | # define _OSD_WIDTH2BYTES(w) ((w)*2) |
114 | # define _OSD_BYTES2WIDTH(b) ((b)/2) | 114 | # define _OSD_BYTES2WIDTH(b) ((b)/2) |
115 | # endif /* end stride type selection */ | 115 | # endif /* end stride type selection */ |
@@ -160,7 +160,7 @@ static void * _osd_lcd_init_buffers(struct osd *osd, unsigned flags, | |||
160 | 160 | ||
161 | rb->viewport_set_fullscreen(&osd->vp, SCREEN_MAIN); | 161 | rb->viewport_set_fullscreen(&osd->vp, SCREEN_MAIN); |
162 | 162 | ||
163 | #if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE | 163 | #if LCD_STRIDEFORMAT == VERTICAL_STRIDE |
164 | int colbytes = _OSD_HEIGHT2BYTES(LCD_HEIGHT); | 164 | int colbytes = _OSD_HEIGHT2BYTES(LCD_HEIGHT); |
165 | int bytecols = *bufsize / colbytes; | 165 | int bytecols = *bufsize / colbytes; |
166 | int w = _OSD_BYTES2WIDTH(bytecols); | 166 | int w = _OSD_BYTES2WIDTH(bytecols); |
@@ -193,7 +193,7 @@ static void * _osd_lcd_init_buffers(struct osd *osd, unsigned flags, | |||
193 | w = _OSD_BYTES2WIDTH(_OSD_WIDTH2BYTES(w)); | 193 | w = _OSD_BYTES2WIDTH(_OSD_WIDTH2BYTES(w)); |
194 | osd->lcd_bitmap_stride = _OSD_BYTES2HEIGHT(_OSD_HEIGHT2BYTES(LCD_HEIGHT)); | 194 | osd->lcd_bitmap_stride = _OSD_BYTES2HEIGHT(_OSD_HEIGHT2BYTES(LCD_HEIGHT)); |
195 | osd->back_bitmap_stride = h; | 195 | osd->back_bitmap_stride = h; |
196 | #else /* !defined(LCD_STRIDEFORMAT) || LCD_STRIDEFORMAT != VERTICAL_STRIDE */ | 196 | #else /* LCD_STRIDEFORMAT != VERTICAL_STRIDE */ |
197 | int rowbytes = _OSD_WIDTH2BYTES(LCD_WIDTH); | 197 | int rowbytes = _OSD_WIDTH2BYTES(LCD_WIDTH); |
198 | int byterows = *bufsize / rowbytes; | 198 | int byterows = *bufsize / rowbytes; |
199 | int w = _OSD_BYTES2WIDTH(rowbytes); | 199 | int w = _OSD_BYTES2WIDTH(rowbytes); |
diff --git a/apps/plugins/lib/pluginlib_bmp.c b/apps/plugins/lib/pluginlib_bmp.c index f3edfbf425..82f84b05af 100644 --- a/apps/plugins/lib/pluginlib_bmp.c +++ b/apps/plugins/lib/pluginlib_bmp.c | |||
@@ -94,7 +94,7 @@ int save_bmp_file( char* filename, struct bitmap *bm ) | |||
94 | */ | 94 | */ |
95 | void simple_resize_bitmap(struct bitmap *src, struct bitmap *dst) | 95 | void simple_resize_bitmap(struct bitmap *src, struct bitmap *dst) |
96 | { | 96 | { |
97 | #if defined(LCD_STRIDEFORMAT) && (LCD_STRIDEFORMAT == VERTICAL_STRIDE) | 97 | #if LCD_STRIDEFORMAT == VERTICAL_STRIDE |
98 | const int srcw = src->height; | 98 | const int srcw = src->height; |
99 | const int srch = src->width; | 99 | const int srch = src->width; |
100 | const int dstw = dst->height; | 100 | const int dstw = dst->height; |
diff --git a/apps/plugins/lib/xlcd_scroll.c b/apps/plugins/lib/xlcd_scroll.c index 5ac4a366e8..906f4eaae1 100644 --- a/apps/plugins/lib/xlcd_scroll.c +++ b/apps/plugins/lib/xlcd_scroll.c | |||
@@ -30,7 +30,7 @@ | |||
30 | static const unsigned short patterns[4] = {0xFFFF, 0xFF00, 0x00FF, 0x0000}; | 30 | static const unsigned short patterns[4] = {0xFFFF, 0xFF00, 0x00FF, 0x0000}; |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | #if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE | 33 | #if LCD_STRIDEFORMAT == VERTICAL_STRIDE |
34 | void xlcd_scroll_left(int count) | 34 | void xlcd_scroll_left(int count) |
35 | { | 35 | { |
36 | /*size_t dst_stride;*/ | 36 | /*size_t dst_stride;*/ |
@@ -668,4 +668,4 @@ void xlcd_scroll_down(int count) | |||
668 | } | 668 | } |
669 | 669 | ||
670 | #endif /* LCD_PIXELFORMAT, LCD_DEPTH */ | 670 | #endif /* LCD_PIXELFORMAT, LCD_DEPTH */ |
671 | #endif /* defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE */ | 671 | #endif /* LCD_STRIDEFORMAT == VERTICAL_STRIDE */ |