diff --git a/Makefile.pc b/Makefile.pc index 766f9b3..c2bbc8f 100644 --- a/Makefile.pc +++ b/Makefile.pc @@ -11,7 +11,8 @@ test : pc_main/main.cpp pc_main/pc_launch.c \ common/menu.c common/font.c common/language.c common/launch.c \ common/menu-entry.c common/menu-list.c common/text.c \ common/nanojpeg.c common/ui.c common/math.c common/theme.c \ - build_pc/tahoma24.o build_pc/tahoma12.o build_pc/switchicon_questionmark.bin.o build_pc/folder_icon.bin.o + build_pc/tahoma24.o build_pc/tahoma12.o build_pc/switchicon_questionmark.bin.o build_pc/folder_icon.bin.o \ + build_pc/button_a_light.bin.o build_pc/button_a_dark.bin.o gcc -Wall -O2 -g0 $^ -lsfml-graphics -lsfml-window -lsfml-system -lstdc++ -I. -Ibuild_pc -o $@ build_pc/tahoma12.o : data/tahoma12.nxfnt @@ -34,5 +35,15 @@ build_pc/folder_icon.bin.o : data/folder_icon.bin @echo $(notdir $<) @$(bin2o) +build_pc/button_a_light.bin.o : data/button_a_light.bin + mkdir -p $(dir $@) + @echo $(notdir $<) + @$(bin2o) + +build_pc/button_a_dark.bin.o : data/button_a_dark.bin + mkdir -p $(dir $@) + @echo $(notdir $<) + @$(bin2o) + clean: rm -rf build_pc/ test diff --git a/common/menu.c b/common/menu.c index 5ad0df8..47d1007 100644 --- a/common/menu.c +++ b/common/menu.c @@ -14,15 +14,34 @@ void launchMenuEntryTask(menuEntry_s* arg) launchMenuEntry(me); } -//Draws a RGB888 image. -static void drawImage(int x, int y, int width, int height, const uint8_t *image) { +typedef enum +{ + IMAGE_MODE_RGB24, + IMAGE_MODE_RGB32 +} ImageMode; + +//Draws an RGB888 or RGB8888 image. +static void drawImage(int x, int y, int width, int height, const uint8_t *image, ImageMode mode) { int tmpx, tmpy; int pos; + color_t current_color; for (tmpx=0; tmpxnEntries==0) { DrawText(tahoma12, 64, 96 + 32, themeCurrent.textColor, textGetString(StrId_NoAppsFound_Msg)); diff --git a/common/theme.c b/common/theme.c index 0cc57bf..2db60c2 100644 --- a/common/theme.c +++ b/common/theme.c @@ -1,4 +1,6 @@ #include "theme.h" +#include "button_a_light_bin.h" +#include "button_a_dark_bin.h" void themeStartup(ThemePreset preset) { switch (preset) { @@ -10,7 +12,8 @@ void themeStartup(ThemePreset preset) { backWaveColor: MakeColor(154, 171, 255, 255), backgroundColor: MakeColor(233, 236, 241, 255), highlightColor: MakeColor(129, 137, 236, 255), - enableWaveBlending: 0 + enableWaveBlending: 0, + buttonAImage: button_a_light_bin }; break; @@ -22,7 +25,8 @@ void themeStartup(ThemePreset preset) { backWaveColor: MakeColor(73, 103, 169, 255), backgroundColor: MakeColor(45, 55, 66, 255), highlightColor: MakeColor(129, 137, 236, 255), - enableWaveBlending: 0 + enableWaveBlending: 0, + buttonAImage: button_a_dark_bin }; break; } diff --git a/common/theme.h b/common/theme.h index d3c2756..15a42dd 100644 --- a/common/theme.h +++ b/common/theme.h @@ -11,6 +11,7 @@ typedef struct color_t backgroundColor; color_t highlightColor; bool enableWaveBlending; + const uint8_t *buttonAImage; } theme_t; typedef enum diff --git a/data/button_a_dark.bin b/data/button_a_dark.bin new file mode 100644 index 0000000..3be501a Binary files /dev/null and b/data/button_a_dark.bin differ diff --git a/data/button_a_light.bin b/data/button_a_light.bin new file mode 100644 index 0000000..f166ee6 Binary files /dev/null and b/data/button_a_light.bin differ