Use compressed splash image
This commit is contained in:
@@ -20,6 +20,8 @@ set(BITMAP_RLE_ARGS ${BITMAP_ARGS} --rle)
|
|||||||
set(MASK_RLE_ARGS ${MASK_ARGS} --rle)
|
set(MASK_RLE_ARGS ${MASK_ARGS} --rle)
|
||||||
|
|
||||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_bitmaps "${RADIO_SRC_DIR}/bitmaps/480x272/bmp_*.png" "5/6/5" "${BITMAP_ARGS}")
|
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_bitmaps "${RADIO_SRC_DIR}/bitmaps/480x272/bmp_*.png" "5/6/5" "${BITMAP_ARGS}")
|
||||||
|
add_png_target(${BITMAP_TARGET_PREFIX}_splash "${RADIO_SRC_DIR}/bitmaps/480x272/splash.png")
|
||||||
|
|
||||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_calibration_bitmaps "${RADIO_SRC_DIR}/bitmaps/480x272/calibration/bmp_*.png" "5/6/5" "${BITMAP_ARGS}")
|
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_calibration_bitmaps "${RADIO_SRC_DIR}/bitmaps/480x272/calibration/bmp_*.png" "5/6/5" "${BITMAP_ARGS}")
|
||||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_button_bitmaps "${RADIO_SRC_DIR}/bitmaps/480x272/button/alpha_*.png" "4/4/4/4" "${BITMAP_ARGS}")
|
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_button_bitmaps "${RADIO_SRC_DIR}/bitmaps/480x272/button/alpha_*.png" "4/4/4/4" "${BITMAP_ARGS}")
|
||||||
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_alpha_bitmaps "${RADIO_SRC_DIR}/bitmaps/480x272/alpha_*.png" "4/4/4/4" "${BITMAP_ARGS}")
|
add_bitmaps_target(${BITMAP_TARGET_PREFIX}_alpha_bitmaps "${RADIO_SRC_DIR}/bitmaps/480x272/alpha_*.png" "4/4/4/4" "${BITMAP_ARGS}")
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 148 KiB |
@@ -22,20 +22,25 @@
|
|||||||
|
|
||||||
#if defined(SPLASH)
|
#if defined(SPLASH)
|
||||||
|
|
||||||
const uint8_t __bmp_splash[] __ALIGNED(4) {
|
const uint8_t __bmp_splash[] {
|
||||||
#include "bmp_splash.lbm"
|
#include "splash.lbm"
|
||||||
};
|
};
|
||||||
Bitmap BMP_SPLASH(BMP_RGB565, (const uint16_t *)__bmp_splash);
|
|
||||||
|
|
||||||
void drawSplash()
|
void drawSplash()
|
||||||
{
|
{
|
||||||
static bool loadImgFromSD = true;
|
static bool loadSplashImg = true;
|
||||||
static BitmapBuffer * splashImg = nullptr;
|
static BitmapBuffer * splashImg = nullptr;
|
||||||
|
|
||||||
if (loadImgFromSD && splashImg == nullptr) {
|
// try splash from SD card first
|
||||||
|
if (loadSplashImg && splashImg == nullptr) {
|
||||||
if (!sdMounted()) sdInit();
|
if (!sdMounted()) sdInit();
|
||||||
splashImg = BitmapBuffer::loadBitmap(BITMAPS_PATH "/" SPLASH_FILE);
|
splashImg = BitmapBuffer::loadBitmap(BITMAPS_PATH "/" SPLASH_FILE);
|
||||||
loadImgFromSD = false;
|
loadSplashImg = false;
|
||||||
|
|
||||||
|
// otherwise load from FLASH
|
||||||
|
if (splashImg == nullptr) {
|
||||||
|
splashImg = BitmapBuffer::loadRamBitmap(__bmp_splash, sizeof(__bmp_splash));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lcd->clear();
|
lcd->clear();
|
||||||
@@ -45,11 +50,6 @@ void drawSplash()
|
|||||||
(LCD_H - splashImg->height())/2,
|
(LCD_H - splashImg->height())/2,
|
||||||
splashImg);
|
splashImg);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
lcd->drawBitmap((LCD_W - BMP_SPLASH.width())/2,
|
|
||||||
(LCD_H - BMP_SPLASH.height())/2,
|
|
||||||
&BMP_SPLASH);
|
|
||||||
}
|
|
||||||
|
|
||||||
lcdRefresh();
|
lcdRefresh();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user