mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-25 07:41:40 +02:00
cmd: bmp: manage centered display
Allow to display BMP at the middle of the screen. 'm' means "middle" as it is done for the splashscreen variable: splashpos=m,m Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
This commit is contained in:
parent
4e92e60d35
commit
b0fcedb7ad
12
cmd/bmp.c
12
cmd/bmp.c
@ -124,7 +124,13 @@ static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar
|
|||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
addr = simple_strtoul(argv[1], NULL, 16);
|
addr = simple_strtoul(argv[1], NULL, 16);
|
||||||
|
if (!strcmp(argv[2], "m"))
|
||||||
|
x = BMP_ALIGN_CENTER;
|
||||||
|
else
|
||||||
x = simple_strtoul(argv[2], NULL, 10);
|
x = simple_strtoul(argv[2], NULL, 10);
|
||||||
|
if (!strcmp(argv[3], "m"))
|
||||||
|
y = BMP_ALIGN_CENTER;
|
||||||
|
else
|
||||||
y = simple_strtoul(argv[3], NULL, 10);
|
y = simple_strtoul(argv[3], NULL, 10);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -249,9 +255,11 @@ int bmp_display(ulong addr, int x, int y)
|
|||||||
if (!ret) {
|
if (!ret) {
|
||||||
bool align = false;
|
bool align = false;
|
||||||
|
|
||||||
# ifdef CONFIG_SPLASH_SCREEN_ALIGN
|
if (CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN) ||
|
||||||
|
x == BMP_ALIGN_CENTER ||
|
||||||
|
y == BMP_ALIGN_CENTER)
|
||||||
align = true;
|
align = true;
|
||||||
# endif /* CONFIG_SPLASH_SCREEN_ALIGN */
|
|
||||||
ret = video_bmp_display(dev, addr, x, y, align);
|
ret = video_bmp_display(dev, addr, x, y, align);
|
||||||
}
|
}
|
||||||
#elif defined(CONFIG_LCD)
|
#elif defined(CONFIG_LCD)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user