fix(color): Default splash screen that fits NV14/EL18 screens (#2764)

This commit is contained in:
richardclli
2023-04-14 19:46:21 +10:00
committed by GitHub
parent 4f624cc3bc
commit 01829a12d2
6 changed files with 31 additions and 5 deletions
+6 -2
View File
@@ -16,7 +16,9 @@ set(MASK_RLE_ARGS ${MASK_ARGS} --rle)
set(BITMAP_LZ4_ARGS ${BITMAP_ARGS} --lz4)
set(MASK_LZ4_ARGS ${MASK_ARGS} --lz4)
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_splash "${RADIO_SRC_DIR}/bitmaps/480x272/splash.png" "5/6/5" "${BITMAP_LZ4_ARGS}")
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_splash_logo "${RADIO_SRC_DIR}/bitmaps/480x272/splash_logo.png" "4/4/4/4" "${BITMAP_LZ4_ARGS}")
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_splash_bg "${RADIO_SRC_DIR}/bitmaps/480x272/splash_bg.png" "4/4/4/4" "${BITMAP_LZ4_ARGS}")
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_splash_bg2 "${RADIO_SRC_DIR}/bitmaps/480x272/splash_bg2.png" "4/4/4/4" "${BITMAP_LZ4_ARGS}")
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_button_bitmaps "${RADIO_SRC_DIR}/bitmaps/480x272/button/alpha_*.png" "4/4/4/4" "${BITMAP_LZ4_ARGS}")
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_masks "${RADIO_SRC_DIR}/bitmaps/480x272/mask_*.png" 8bits "${MASK_LZ4_ARGS}")
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_slider_masks "${RADIO_SRC_DIR}/bitmaps/480x272/slider/*.png" 8bits "${MASK_LZ4_ARGS}")
@@ -30,7 +32,9 @@ add_bitmaps_target(${BITMAP_TARGET_PREFIX}_bootloader_icons "${RADIO_SRC_DIR}/bi
add_custom_target(${BITMAP_TARGET_PREFIX}_bitmaps)
add_dependencies(${BITMAP_TARGET_PREFIX}_bitmaps
${BITMAP_TARGET_PREFIX}_splash
${BITMAP_TARGET_PREFIX}_splash_logo
${BITMAP_TARGET_PREFIX}_splash_bg
${BITMAP_TARGET_PREFIX}_splash_bg2
${BITMAP_TARGET_PREFIX}_button_bitmaps
${BITMAP_TARGET_PREFIX}_masks
${BITMAP_TARGET_PREFIX}_slider_masks
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

+25 -3
View File
@@ -23,10 +23,22 @@
#if defined(SPLASH)
const uint8_t __bmp_splash[] {
#include "splash.lbm"
const uint8_t __bmp_splash_bg[] {
#include "splash_bg.lbm"
};
//const uint8_t __bmp_splash_bg2[] {
//#include "splash_bg2.lbm"
//};
const uint8_t __bmp_splash_logo[] {
#include "splash_logo.lbm"
};
//static const uint8_t mask_splash_bg[] = {
//#include "mask_splash_bg.lbm"
//};
void draw_splash_cb(lv_event_t * e)
{
auto draw_ctx = lv_event_get_draw_ctx(e);
@@ -63,7 +75,17 @@ void drawSplash()
loadSplashImg = false;
if (splashImg == nullptr) {
splashImg = new LZ4Bitmap(BMP_RGB565, __bmp_splash);
splashImg = new BitmapBuffer(BMP_RGB565, LCD_W, LCD_H);
BitmapBuffer* splashBg = new LZ4Bitmap(BMP_ARGB4444, __bmp_splash_bg);
BitmapBuffer* splashLogo = new LZ4Bitmap(BMP_ARGB4444, __bmp_splash_logo);
for (int i=0; i<LCD_W; i += splashBg->width()) {
for (int j=0; j<LCD_H; j += splashBg->height()) {
splashImg->drawBitmap(i, j, splashBg);
}
}
splashImg->drawBitmap((LCD_W/2) - (splashLogo->width()/2),
(LCD_H/2) - (splashLogo->height()/2),
splashLogo);
}
splashScreen = window_create(nullptr);