diff --git a/radio/src/bitmaps/212x64/lock.png b/radio/src/bitmaps/212x64/lock.png index a3b103e94..7d46606e3 100644 Binary files a/radio/src/bitmaps/212x64/lock.png and b/radio/src/bitmaps/212x64/lock.png differ diff --git a/radio/src/bitmaps/212x64/power.png b/radio/src/bitmaps/212x64/power.png new file mode 100755 index 000000000..0d0568c29 Binary files /dev/null and b/radio/src/bitmaps/212x64/power.png differ diff --git a/radio/src/bitmaps/212x64/shutdown.png b/radio/src/bitmaps/212x64/shutdown.png index 8f3307020..ebfc8ac73 100755 Binary files a/radio/src/bitmaps/212x64/shutdown.png and b/radio/src/bitmaps/212x64/shutdown.png differ diff --git a/radio/src/gui/212x64/lcd.cpp b/radio/src/gui/212x64/lcd.cpp index 19274805a..c75427d3c 100644 --- a/radio/src/gui/212x64/lcd.cpp +++ b/radio/src/gui/212x64/lcd.cpp @@ -1008,7 +1008,7 @@ void lcdDrawBitmap(coord_t x, coord_t y, const uint8_t * img, coord_t offset, co } } -void lcdDrawRleBitmap(coord_t x, coord_t y, const uint8_t * img, coord_t offset, coord_t width) +void lcdDrawRleBitmap(coord_t x, coord_t y, const uint8_t * img, coord_t offset, coord_t width, bool overlay) { RleBitmap pic(img, offset); @@ -1024,19 +1024,40 @@ void lcdDrawRleBitmap(coord_t x, coord_t y, const uint8_t * img, coord_t offset, for (uint8_t row=0; row= DISPLAY_END) return; - uint8_t b = pic.getNext(); - if (y & 1) { - *p = (*p & 0x0f) + ((b & 0x0f) << 4); - if ((p+LCD_W) < DISPLAY_END) { - *(p+LCD_W) = (*(p+LCD_W) & 0xf0) + ((b & 0xf0) >> 4); + if (overlay) { + for (coord_t i=0; i= DISPLAY_END) return; + uint8_t b = pic.getNext(); + if (y & 1) { + if (b & 0x0f) + *p = (*p & 0x0f) + ((b & 0x0f) << 4); + if ((p+LCD_W) < DISPLAY_END && b & 0xf0) { + *(p+LCD_W) = (*(p+LCD_W) & 0xf0) + ((b & 0xf0) >> 4); + } } + else { + if (b & 0x0f) + *p = (*p & 0xf0) + (b & 0x0f); + if (b & 0xf0) + *p = (*p & 0x0f) + (b & 0xf0); + } + p++; } - else { - *p = b; + } else { + for (coord_t i=0; i= DISPLAY_END) return; + uint8_t b = pic.getNext(); + if (y & 1) { + *p = (*p & 0x0f) + ((b & 0x0f) << 4); + if ((p+LCD_W) < DISPLAY_END) { + *(p+LCD_W) = (*(p+LCD_W) & 0xf0) + ((b & 0xf0) >> 4); + } + } + else { + *p = b; + } + p++; } - p++; } pic.goToNextRow(); pic.skip(offset); diff --git a/radio/src/gui/212x64/lcd.h b/radio/src/gui/212x64/lcd.h index fd4a4254c..975295282 100644 --- a/radio/src/gui/212x64/lcd.h +++ b/radio/src/gui/212x64/lcd.h @@ -164,7 +164,7 @@ void drawTelemetryTopBar(); void lcdDraw1bitBitmap(coord_t x, coord_t y, const unsigned char * img, uint8_t idx, LcdFlags att=0); void lcdDrawBitmap(coord_t x, coord_t y, const uint8_t * img, coord_t offset=0, coord_t width=0); -void lcdDrawRleBitmap(coord_t x, coord_t y, const uint8_t * img, coord_t offset=0, coord_t width=0); +void lcdDrawRleBitmap(coord_t x, coord_t y, const uint8_t * img, coord_t offset=0, coord_t width=0, bool overlay=false); #define LCD_ICON(x, y, icon) lcdDrawRleBitmap(x, y, icons, icon) diff --git a/radio/src/gui/212x64/startup_shutdown.cpp b/radio/src/gui/212x64/startup_shutdown.cpp index c855fefcc..61944cd8a 100644 --- a/radio/src/gui/212x64/startup_shutdown.cpp +++ b/radio/src/gui/212x64/startup_shutdown.cpp @@ -22,8 +22,14 @@ #include "opentx.h" -#define ANIMATIONS_BITMAP_WIDTH 60 -#define ANIMATIONS_BITMAP_HEIGHT 60 +#define ANIMATIONS_BITMAP_WIDTH 30 +#define ANIMATIONS_BITMAP_HEIGHT 30 + +#define POWER_BITMAP_WIDTH 40 +#define POWER_BITMAP_HEIGHT 40 + +#define SLEEP_BITMAP_WIDTH 60 +#define SLEEP_BITMAP_HEIGHT 60 const unsigned char bmp_lock[] = { @@ -33,11 +39,28 @@ const unsigned char bmp_lock[] = { const unsigned char bmp_shutdown[] = { #include "shutdown.lbm" }; +const int8_t bmp_shutdown_xo[] = { + 0, 0, -ANIMATIONS_BITMAP_WIDTH, -ANIMATIONS_BITMAP_WIDTH +}; +const int8_t bmp_shutdown_yo[] = { + -ANIMATIONS_BITMAP_HEIGHT, 0, 0, -ANIMATIONS_BITMAP_HEIGHT +}; + +const unsigned char bmp_power[] = { +#include "power.lbm" +}; const unsigned char bmp_sleep[] = { #include "sleep.lbm" }; +static void drawAnimation(uint8_t idx) +{ + lcdDrawRleBitmap((LCD_W - POWER_BITMAP_WIDTH) / 2, (LCD_H - POWER_BITMAP_HEIGHT) / 2, bmp_power); + for (uint8_t i = 0; i <=idx; i += 1) + lcdDrawRleBitmap((LCD_W / 2) + bmp_shutdown_xo[i], (LCD_H / 2) + bmp_shutdown_yo[i], bmp_shutdown, i * ANIMATIONS_BITMAP_WIDTH, ANIMATIONS_BITMAP_WIDTH, true); +} + void drawStartupAnimation(uint32_t duration, uint32_t totalDuration) { if (totalDuration == 0) @@ -49,9 +72,9 @@ void drawStartupAnimation(uint32_t duration, uint32_t totalDuration) lcdClear(); if (index == 0) - lcdDrawRleBitmap((LCD_W - ANIMATIONS_BITMAP_WIDTH) / 2, (LCD_H - ANIMATIONS_BITMAP_HEIGHT) / 2, bmp_lock, 0, ANIMATIONS_BITMAP_WIDTH); + lcdDrawRleBitmap((LCD_W - POWER_BITMAP_WIDTH) / 2, (LCD_H - POWER_BITMAP_HEIGHT) / 2, bmp_lock); else - lcdDrawRleBitmap((LCD_W - ANIMATIONS_BITMAP_WIDTH) / 2, (LCD_H - ANIMATIONS_BITMAP_HEIGHT) / 2, bmp_shutdown, (index - 1) * ANIMATIONS_BITMAP_WIDTH, ANIMATIONS_BITMAP_WIDTH); + drawAnimation(index - 1); lcdRefresh(); } @@ -66,7 +89,8 @@ void drawShutdownAnimation(uint32_t duration, uint32_t totalDuration, const char lcdRefreshWait(); lcdClear(); - lcdDrawRleBitmap((LCD_W - ANIMATIONS_BITMAP_WIDTH) / 2, (LCD_H - ANIMATIONS_BITMAP_HEIGHT) / 2, bmp_shutdown, (3 - index) * ANIMATIONS_BITMAP_WIDTH, ANIMATIONS_BITMAP_WIDTH); + drawAnimation(3 - index); + if (message) { lcdDrawText((LCD_W - getTextWidth(message)) / 2, LCD_H - 2*FH, message); } @@ -78,7 +102,7 @@ void drawSleepBitmap() { lcdRefreshWait(); lcdClear(); - lcdDrawRleBitmap((LCD_W - ANIMATIONS_BITMAP_WIDTH) / 2, (LCD_H - ANIMATIONS_BITMAP_HEIGHT) / 2, bmp_sleep, 0); + lcdDrawRleBitmap((LCD_W - SLEEP_BITMAP_WIDTH) / 2, (LCD_H - SLEEP_BITMAP_HEIGHT) / 2, bmp_sleep); lcdRefresh(); lcdRefreshWait(); }