1
0
Fork 0
forked from len0rd/rockbox

sysfont: Fix buffering debug screen, cube plugin, and vu_meter plugin

Instead of being hardcoded to expect 8px sysfont, make them scale properly

Change-Id: I02cc6cb53eebbd8241a142964bff305a1c5e535a
This commit is contained in:
Solomon Peachy 2025-03-04 13:39:23 -05:00
parent d5db4202ab
commit f3ce792af8
3 changed files with 20 additions and 20 deletions

View file

@ -555,7 +555,7 @@ int screen_foreground;
#define MAX_PEAK 0x8000
/* gap at the top for left/right etc */
#define NEEDLE_TOP 25
#define NEEDLE_TOP SYSFONT_HEIGHT*3+1
/* pow(M_E, 5) * 65536 */
#define E_POW_5 9726404
@ -740,28 +740,28 @@ static bool vu_meter_menu(void)
}
static void draw_analog_minimeters(void) {
rb->lcd_mono_bitmap(sound_speaker, quarter_width-28, 12, 4, 8);
rb->lcd_mono_bitmap(sound_speaker, quarter_width-28, SYSFONT_HEIGHT+4, 4, 8);
rb->lcd_set_drawmode(DRMODE_FG);
if(analog_mini_1<left_needle_top_x)
rb->lcd_mono_bitmap(sound_low_level, quarter_width-23, 12, 2, 8);
rb->lcd_mono_bitmap(sound_low_level, quarter_width-23, SYSFONT_HEIGHT+4, 2, 8);
if(analog_mini_2<left_needle_top_x)
rb->lcd_mono_bitmap(sound_med_level, quarter_width-21, 12, 2, 8);
rb->lcd_mono_bitmap(sound_med_level, quarter_width-21, SYSFONT_HEIGHT+4, 2, 8);
if(analog_mini_3<left_needle_top_x)
rb->lcd_mono_bitmap(sound_high_level, quarter_width-19, 12, 2, 8);
rb->lcd_mono_bitmap(sound_high_level, quarter_width-19, SYSFONT_HEIGHT+4, 2, 8);
if(analog_mini_4<left_needle_top_x)
rb->lcd_mono_bitmap(sound_max_level, quarter_width-16, 12, 3, 8);
rb->lcd_mono_bitmap(sound_max_level, quarter_width-16, SYSFONT_HEIGHT+4, 3, 8);
rb->lcd_set_drawmode(DRMODE_SOLID);
rb->lcd_mono_bitmap(sound_speaker, quarter_width+half_width-30, 12, 4, 8);
rb->lcd_mono_bitmap(sound_speaker, quarter_width+half_width-30, SYSFONT_HEIGHT+4, 4, 8);
rb->lcd_set_drawmode(DRMODE_FG);
if(analog_mini_1<(right_needle_top_x-half_width))
rb->lcd_mono_bitmap(sound_low_level, quarter_width+half_width-25, 12, 2, 8);
rb->lcd_mono_bitmap(sound_low_level, quarter_width+half_width-25, SYSFONT_HEIGHT+4, 2, 8);
if(analog_mini_2<(right_needle_top_x-half_width))
rb->lcd_mono_bitmap(sound_med_level, quarter_width+half_width-23, 12, 2, 8);
rb->lcd_mono_bitmap(sound_med_level, quarter_width+half_width-23, SYSFONT_HEIGHT+4, 2, 8);
if(analog_mini_3<(right_needle_top_x-half_width))
rb->lcd_mono_bitmap(sound_high_level, quarter_width+half_width-21, 12, 2, 8);
rb->lcd_mono_bitmap(sound_high_level, quarter_width+half_width-21, SYSFONT_HEIGHT+4, 2, 8);
if(analog_mini_4<(right_needle_top_x-half_width))
rb->lcd_mono_bitmap(sound_max_level, quarter_width+half_width-18, 12, 3, 8);
rb->lcd_mono_bitmap(sound_max_level, quarter_width+half_width-18, SYSFONT_HEIGHT+4, 3, 8);
rb->lcd_set_drawmode(DRMODE_SOLID);
}
@ -844,12 +844,12 @@ static void analog_meter(void) {
rb->lcd_set_drawmode(DRMODE_SOLID);
/* Show Left/Right */
rb->lcd_putsxy(quarter_width-12, 12, "Left");
rb->lcd_putsxy(half_width+quarter_width-12, 12, "Right");
rb->lcd_putsxy(quarter_width-12, SYSFONT_HEIGHT+4, "Left");
rb->lcd_putsxy(half_width+quarter_width-12, SYSFONT_HEIGHT+4, "Right");
/* Line above/below the Left/Right text */
rb->lcd_hline(0,LCD_WIDTH-1,9);
rb->lcd_hline(0,LCD_WIDTH-1,21);
rb->lcd_hline(0,LCD_WIDTH-1,SYSFONT_HEIGHT+1);
rb->lcd_hline(0,LCD_WIDTH-1,SYSFONT_HEIGHT*2+5);
for(i=0; i<half_width; i++) {
rb->lcd_drawpixel(i, (y_values[i])-2);