diff --git a/Makefile b/Makefile index d6e6683..42f7103 100644 --- a/Makefile +++ b/Makefile @@ -126,6 +126,14 @@ $(OFILES) : $(OFILES_SRC) : $(HFILES_BIN) +#------------------------------------------------------------------------------- +# you need a rule like this for each extension you use as binary data +#------------------------------------------------------------------------------- +%.png.o %_png.h : %.png +#------------------------------------------------------------------------------- + @echo $(notdir $<) + @$(bin2o) + #------------------------------------------------------------------------------- endif #------------------------------------------------------------------------------- diff --git a/data/icon.png b/data/icon.png new file mode 100644 index 0000000..33417e9 Binary files /dev/null and b/data/icon.png differ diff --git a/source/main.cpp b/source/main.cpp index 7dc3fca..caacd82 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -22,6 +22,7 @@ #include "DrawUtils.h" #include "logger.h" +#include "icon_png.h" #define COLOR_WHITE Color(0xffffffff) #define COLOR_BLACK Color(0, 0, 0, 255) @@ -320,7 +321,8 @@ int32_t handleMenuScreen(int32_t autobootOptionInput) { // draw top bar DrawUtils::setFontSize(24); - DrawUtils::print(16, 6 + 24, "Tiramisu Boot Selector"); + DrawUtils::drawPNG(16, 2, icon_png); + DrawUtils::print(64 + 2, 6 + 24, "Tiramisu Boot Selector"); DrawUtils::drawRectFilled(8, 8 + 24 + 4, SCREEN_WIDTH - 8 * 2, 3, COLOR_WHITE); // draw bottom bar @@ -328,7 +330,7 @@ int32_t handleMenuScreen(int32_t autobootOptionInput) { DrawUtils::setFontSize(18); DrawUtils::print(16, SCREEN_HEIGHT - 8, "\ue07d Navigate "); DrawUtils::print(SCREEN_WIDTH - 16, SCREEN_HEIGHT - 8, "\ue000 Choose", true); - const char *autobootHints = "\ue002 Clear Autoboot / \ue003 Select Autboot"; + const char *autobootHints = "\ue002 Clear Autoboot / \ue003 Select Autoboot"; DrawUtils::print(SCREEN_WIDTH / 2 + DrawUtils::getTextWidth(autobootHints) / 2, SCREEN_HEIGHT - 8, autobootHints, true); DrawUtils::endDraw(); @@ -337,6 +339,7 @@ int32_t handleMenuScreen(int32_t autobootOptionInput) { } } + DrawUtils::beginDraw(); DrawUtils::clear(COLOR_BLACK); DrawUtils::endDraw();