diff options
-rw-r--r-- | apps/gui/icon.c | 18 | ||||
-rw-r--r-- | apps/gui/scrollbar.c | 6 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 4 | ||||
-rw-r--r-- | firmware/export/config.h | 4 | ||||
-rw-r--r-- | firmware/export/lcd.h | 7 |
5 files changed, 29 insertions, 10 deletions
diff --git a/apps/gui/icon.c b/apps/gui/icon.c index 6a5ff708d1..74af4a0d90 100644 --- a/apps/gui/icon.c +++ b/apps/gui/icon.c | |||
@@ -124,6 +124,7 @@ void screen_put_iconxy(struct screen * display, | |||
124 | int screen = display->screen_type; | 124 | int screen = display->screen_type; |
125 | int width = ICON_WIDTH(screen); | 125 | int width = ICON_WIDTH(screen); |
126 | int height = ICON_HEIGHT(screen); | 126 | int height = ICON_HEIGHT(screen); |
127 | int stride; | ||
127 | screen_bitmap_part_func *draw_func = NULL; | 128 | screen_bitmap_part_func *draw_func = NULL; |
128 | 129 | ||
129 | if (icon == Icon_NOICON) | 130 | if (icon == Icon_NOICON) |
@@ -142,15 +143,20 @@ void screen_put_iconxy(struct screen * display, | |||
142 | screen_put_iconxy(display, xpos, ypos, Icon_Questionmark); | 143 | screen_put_iconxy(display, xpos, ypos, Icon_Questionmark); |
143 | return; | 144 | return; |
144 | } | 145 | } |
145 | data = viewer_iconset[screen].data; | 146 | data = viewer_iconset[screen].data; |
147 | stride = STRIDE( viewer_iconset[screen].width, | ||
148 | viewer_iconset[screen].height); | ||
146 | } | 149 | } |
147 | else if (custom_icons_loaded[screen]) | 150 | else if (custom_icons_loaded[screen]) |
148 | { | 151 | { |
149 | data = user_iconset[screen].data; | 152 | data = user_iconset[screen].data; |
153 | stride = STRIDE( user_iconset[screen].width, | ||
154 | user_iconset[screen].height); | ||
150 | } | 155 | } |
151 | else | 156 | else |
152 | { | 157 | { |
153 | data = inbuilt_icons[screen]; | 158 | data = inbuilt_icons[screen]; |
159 | stride = STRIDE(BMPWIDTH_default_icons, BMPHEIGHT_default_icons); | ||
154 | } | 160 | } |
155 | /* add some left padding to the icons if they are on the edge */ | 161 | /* add some left padding to the icons if they are on the edge */ |
156 | if (xpos == 0) | 162 | if (xpos == 0) |
@@ -158,12 +164,12 @@ void screen_put_iconxy(struct screen * display, | |||
158 | 164 | ||
159 | #if (LCD_DEPTH == 16) || defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH == 16) | 165 | #if (LCD_DEPTH == 16) || defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH == 16) |
160 | if (display->depth == 16) | 166 | if (display->depth == 16) |
161 | draw_func = display->transparent_bitmap_part; | 167 | draw_func = display->transparent_bitmap_part; |
162 | else | 168 | else |
163 | #endif | 169 | #endif |
164 | draw_func = display->bitmap_part; | 170 | draw_func = display->bitmap_part; |
165 | 171 | ||
166 | draw_func(data, 0, height * icon, width, xpos, ypos, width, height); | 172 | draw_func(data, 0, height * icon, stride, xpos, ypos, width, height); |
167 | } | 173 | } |
168 | 174 | ||
169 | void screen_put_cursorxy(struct screen * display, int x, int y, bool on) | 175 | void screen_put_cursorxy(struct screen * display, int x, int y, bool on) |
diff --git a/apps/gui/scrollbar.c b/apps/gui/scrollbar.c index 0f2a485b32..193bb4b65a 100644 --- a/apps/gui/scrollbar.c +++ b/apps/gui/scrollbar.c | |||
@@ -202,7 +202,8 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x, | |||
202 | #if LCD_DEPTH > 1 | 202 | #if LCD_DEPTH > 1 |
203 | else | 203 | else |
204 | screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0, | 204 | screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0, |
205 | bm.width, x + start, y, size, height); | 205 | STRIDE(bm.width, bm.height), |
206 | x + start, y, size, height); | ||
206 | #endif | 207 | #endif |
207 | } else { | 208 | } else { |
208 | #if LCD_DEPTH > 1 | 209 | #if LCD_DEPTH > 1 |
@@ -213,7 +214,8 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap bm, int x, | |||
213 | #if LCD_DEPTH > 1 | 214 | #if LCD_DEPTH > 1 |
214 | else | 215 | else |
215 | screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0, | 216 | screen->transparent_bitmap_part((fb_data *)bm.data, 0, 0, |
216 | bm.width, x, y + start, width, size); | 217 | STRIDE(bm.width, bm.height), |
218 | x, y + start, width, size); | ||
217 | #endif | 219 | #endif |
218 | } | 220 | } |
219 | } | 221 | } |
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index a6cab63829..409984494c 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c | |||
@@ -232,8 +232,8 @@ static void wps_draw_image(struct gui_wps *gwps, struct gui_img *img, int subima | |||
232 | } else { | 232 | } else { |
233 | display->transparent_bitmap_part((fb_data *)img->bm.data, | 233 | display->transparent_bitmap_part((fb_data *)img->bm.data, |
234 | 0, img->subimage_height * subimage, | 234 | 0, img->subimage_height * subimage, |
235 | img->bm.width, img->x, | 235 | STRIDE(img->bm.width, img->bm.height), |
236 | img->y, img->bm.width, | 236 | img->x, img->y, img->bm.width, |
237 | img->subimage_height); | 237 | img->subimage_height); |
238 | } | 238 | } |
239 | #endif | 239 | #endif |
diff --git a/firmware/export/config.h b/firmware/export/config.h index 18dca402fb..13d272f7b7 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -206,6 +206,10 @@ | |||
206 | #define RGB565 565 | 206 | #define RGB565 565 |
207 | #define RGB565SWAPPED 3553 | 207 | #define RGB565SWAPPED 3553 |
208 | 208 | ||
209 | /* LCD_STRIDEFORMAT */ | ||
210 | #define VERTICAL_STRIDE 1 | ||
211 | #define HORIZONTAL_STRIDE 2 | ||
212 | |||
209 | /* CONFIG_ORIENTATION */ | 213 | /* CONFIG_ORIENTATION */ |
210 | #define SCREEN_PORTRAIT 0 | 214 | #define SCREEN_PORTRAIT 0 |
211 | #define SCREEN_LANDSCAPE 1 | 215 | #define SCREEN_LANDSCAPE 1 |
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 5846fae9c1..3d391d6685 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h | |||
@@ -306,6 +306,13 @@ static inline unsigned lcd_color_to_native(unsigned color) | |||
306 | 306 | ||
307 | #endif /* HAVE_LCD_COLOR */ | 307 | #endif /* HAVE_LCD_COLOR */ |
308 | 308 | ||
309 | /* Frame buffer stride */ | ||
310 | #if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE | ||
311 | #define STRIDE(w, h) (h) | ||
312 | #else | ||
313 | #define STRIDE(w, h) (w) | ||
314 | #endif | ||
315 | |||
309 | /* Frame buffer dimensions */ | 316 | /* Frame buffer dimensions */ |
310 | #if LCD_DEPTH == 1 | 317 | #if LCD_DEPTH == 1 |
311 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING | 318 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING |