From f23f1334048764cbd4cb39d1f074bc77e98dfed7 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Sat, 24 Feb 2018 14:23:06 +1100 Subject: [PATCH] Changed icon highlight to flashing aqua --- Makefile.pc | 2 +- common/menu.c | 8 +++++--- common/theme.c | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile.pc b/Makefile.pc index 4955cca..ed2758f 100644 --- a/Makefile.pc +++ b/Makefile.pc @@ -15,7 +15,7 @@ test : pc_main/main.cpp pc_main/pc_launch.c \ build_pc/interuiregular14.o build_pc/interuiregular18.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 build_pc/hbmenu_logo_light.bin.o build_pc/hbmenu_logo_dark.bin.o - gcc -Wall -O2 -g0 $^ -lsfml-graphics -lsfml-window -lsfml-system -lstdc++ -I. -Ibuild_pc -o $@ + gcc -Wall -O2 -g0 $^ -lsfml-graphics -lsfml-window -lsfml-system -lstdc++ -lm -I. -Ibuild_pc -o $@ build_pc/tahoma12.o : data/tahoma12.nxfnt mkdir -p $(dir $@) diff --git a/common/menu.c b/common/menu.c index 552892c..0209065 100644 --- a/common/menu.c +++ b/common/menu.c @@ -47,6 +47,7 @@ static void drawImage(int x, int y, int width, int height, const uint8_t *image, uint8_t *folder_icon_small; uint8_t *switchicon_questionmark_small; +double timer; static void drawEntry(menuEntry_s* me, int off_x, int is_active) { int x, y; @@ -67,10 +68,13 @@ static void drawEntry(menuEntry_s* me, int off_x, int is_active) { int shadow_inset; color_t shadow_color; uint8_t shadow_alpha_base = 80; + float highlight_multiplier, highlight_mod; int shadow_size = 4; if (is_active) { - border_color = themeCurrent.highlightColor; + highlight_mod = timer - 1.0 * (int)(timer / 1.0); + highlight_multiplier = fmax(0.0, fabs(highlight_mod - 0.5) / 0.5); + border_color = MakeColor(themeCurrent.highlightColor.r + (255 - themeCurrent.highlightColor.r) * highlight_multiplier, themeCurrent.highlightColor.g + (255 - themeCurrent.highlightColor.g) * highlight_multiplier, themeCurrent.highlightColor.b + (255 - themeCurrent.highlightColor.b) * highlight_multiplier, 255); border_start_x = start_x-5; border_end_x = end_x+5; border_start_y = start_y-5; @@ -223,8 +227,6 @@ color_t waveBlendAdd(color_t a, color_t b, float alpha) { return MakeColor(a.r+(b.r*alpha), a.g+b.g*alpha, a.b + b.b*alpha, 255); } -double timer; - void drawWave(float timer, color_t color, float height, float phase, float speed) { int x, y; float wave_top_y, alpha; diff --git a/common/theme.c b/common/theme.c index b8d211c..7a03681 100644 --- a/common/theme.c +++ b/common/theme.c @@ -13,7 +13,7 @@ void themeStartup(ThemePreset preset) { middleWaveColor: MakeColor(100, 153, 255, 255), backWaveColor: MakeColor(154, 171, 255, 255), backgroundColor: MakeColor(233, 236, 241, 255), - highlightColor: MakeColor(129, 137, 236, 255), + highlightColor: MakeColor(91, 237, 224, 255), enableWaveBlending: 0, buttonAImage: button_a_light_bin, hbmenuLogoImage: hbmenu_logo_light_bin @@ -27,7 +27,7 @@ void themeStartup(ThemePreset preset) { middleWaveColor: MakeColor(66, 154, 159, 255), backWaveColor: MakeColor(73, 103, 169, 255), backgroundColor: MakeColor(45, 45, 50, 255), - highlightColor: MakeColor(129, 137, 236, 255), + highlightColor: MakeColor(91, 237, 224, 255), enableWaveBlending: 0, buttonAImage: button_a_dark_bin, hbmenuLogoImage: hbmenu_logo_dark_bin