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)
|
||||
|
||||
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}_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}")
|
||||
|
||||
|
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 148 KiB |
@@ -22,20 +22,25 @@
|
||||
|
||||
#if defined(SPLASH)
|
||||
|
||||
const uint8_t __bmp_splash[] __ALIGNED(4) {
|
||||
#include "bmp_splash.lbm"
|
||||
const uint8_t __bmp_splash[] {
|
||||
#include "splash.lbm"
|
||||
};
|
||||
Bitmap BMP_SPLASH(BMP_RGB565, (const uint16_t *)__bmp_splash);
|
||||
|
||||
void drawSplash()
|
||||
{
|
||||
static bool loadImgFromSD = true;
|
||||
static bool loadSplashImg = true;
|
||||
static BitmapBuffer * splashImg = nullptr;
|
||||
|
||||
if (loadImgFromSD && splashImg == nullptr) {
|
||||
// try splash from SD card first
|
||||
if (loadSplashImg && splashImg == nullptr) {
|
||||
if (!sdMounted()) sdInit();
|
||||
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();
|
||||
@@ -45,12 +50,7 @@ void drawSplash()
|
||||
(LCD_H - splashImg->height())/2,
|
||||
splashImg);
|
||||
}
|
||||
else {
|
||||
lcd->drawBitmap((LCD_W - BMP_SPLASH.width())/2,
|
||||
(LCD_H - BMP_SPLASH.height())/2,
|
||||
&BMP_SPLASH);
|
||||
}
|
||||
|
||||
|
||||
lcdRefresh();
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user