From 658026e6267277b27d297c481728f74d160a8481 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Fri, 17 Jul 2020 10:31:31 -0400 Subject: [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. Note: I left behind lcd_bitmap in features.txt, because removing it would require considerable work in the manual and the translations. Change-Id: Ia8ca7761f610d9332a0d22a7d189775fb15ec88a --- apps/gui/splash.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'apps/gui/splash.c') diff --git a/apps/gui/splash.c b/apps/gui/splash.c index fa2c21768a..5bcac80169 100644 --- a/apps/gui/splash.c +++ b/apps/gui/splash.c @@ -31,16 +31,11 @@ #include "viewport.h" #include "strtok_r.h" -#ifdef HAVE_LCD_BITMAP - #define MAXLINES (LCD_HEIGHT/6) #define MAXBUFFER 512 #define RECT_SPACING 2 #define SPLASH_MEMORY_INTERVAL (HZ) -#endif - - static void splash_internal(struct screen * screen, const char *fmt, va_list ap) { char splash_buf[MAXBUFFER]; @@ -54,15 +49,13 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) int y, i; int space_w, w, h; struct viewport vp; -#ifdef HAVE_LCD_BITMAP int width, height; int maxw = 0; viewport_set_defaults(&vp, screen->screen_type); screen->set_viewport(&vp); - + screen->getstringsize(" ", &space_w, &h); -#endif y = h; vsnprintf(splash_buf, sizeof(splash_buf), fmt, ap); @@ -77,20 +70,14 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) lines[0] = next; while (true) { -#ifdef HAVE_LCD_BITMAP screen->getstringsize(next, &w, NULL); -#else - w = utf8length(next); -#endif if (lastbreak) { if (x + (next - lastbreak) * space_w + w > vp.width - RECT_SPACING*2) { /* too wide, wrap */ -#ifdef HAVE_LCD_BITMAP if (x > maxw) maxw = x; -#endif if ((y + h > vp.height) || (line >= (MAXLINES-1))) break; /* screen full or out of lines */ x = 0; @@ -109,10 +96,8 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) next = strtok_r(NULL, " ", &store); if (!next) { /* no more words */ -#ifdef HAVE_LCD_BITMAP if (x > maxw) maxw = x; -#endif break; } } @@ -123,8 +108,6 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) screen->scroll_stop(); -#ifdef HAVE_LCD_BITMAP - width = maxw + 2*RECT_SPACING; height = y + 2*RECT_SPACING; @@ -166,14 +149,11 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) /* prepare putting the text */ y = RECT_SPACING; -#endif /* print the message to screen */ for (i = 0; i <= line; i++, y+=h) { -#ifdef HAVE_LCD_BITMAP screen->putsxy(0, y, lines[i]); -#endif } screen->update_viewport(); end: -- cgit v1.2.3