allow splash image to be loaded from SD on Horus (#5463)
* allow splash image to be loaded from SD on Horus * added a new menu entry to assign splash screen
This commit is contained in:
committed by
Bertrand Songis
parent
0d7832b208
commit
716a91fc0c
@@ -19,13 +19,36 @@
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
#include "bmp_splash.lbm"
|
||||
|
||||
#if defined(SPLASH)
|
||||
|
||||
#include "bmp_splash.lbm"
|
||||
|
||||
void drawSplash()
|
||||
{
|
||||
lcd->clear();
|
||||
lcd->drawBitmap((LCD_W-BMP_SPLASH.getWidth())/2, (LCD_H-BMP_SPLASH.getHeight())/2, &BMP_SPLASH);
|
||||
static bool loadImgFromSD = true;
|
||||
static BitmapBuffer* splashImg = NULL;
|
||||
|
||||
if (loadImgFromSD && splashImg == NULL) {
|
||||
bool sd_mounted = sdMounted();
|
||||
if (!sd_mounted) sdInit();
|
||||
splashImg = BitmapBuffer::load(BITMAPS_PATH "/" SPLASH_FILE);
|
||||
loadImgFromSD = false;
|
||||
if (!sd_mounted) sdDone();
|
||||
}
|
||||
|
||||
lcd->clear();
|
||||
|
||||
if (splashImg) {
|
||||
lcd->drawBitmap((LCD_W - splashImg->getWidth())/2,
|
||||
(LCD_H - splashImg->getHeight())/2,
|
||||
splashImg);
|
||||
}
|
||||
else {
|
||||
lcd->drawBitmap((LCD_W - BMP_SPLASH.getWidth())/2,
|
||||
(LCD_H - BMP_SPLASH.getHeight())/2,
|
||||
&BMP_SPLASH);
|
||||
}
|
||||
|
||||
#if MENUS_LOCK == 1
|
||||
if (readonly == false) {
|
||||
|
||||
Reference in New Issue
Block a user