3535#define UI_SPARKLE_CYCLE_TICKS ((int)500 * TICKS_PER_MS)
3636
3737static color_t UI_DARK_COLOR = {0 };
38+ static color_t UI_DIM_COLOR = {0 };
3839static color_t UI_LIGHT_COLOR = {0 };
3940static color_t UI_FLASH_COLOR = {0 };
4041
@@ -46,6 +47,7 @@ static color_t UI_FLASH_COLOR = {0};
4647static inline void ui_init_colors (void )
4748{
4849 UI_DARK_COLOR = RGBA32 (0x57 , 0x37 , 0x47 , 0xFF );
50+ UI_DIM_COLOR = RGBA32 (0x88 , 0x68 , 0x78 , 0xFF );
4951 UI_LIGHT_COLOR = RGBA32 (0xFF , 0xFF , 0xFF , 0xFF );
5052 UI_FLASH_COLOR = RGBA32 (0xFF , 0xFF , 0xFF , 0xFF );
5153}
@@ -215,13 +217,13 @@ static void ui_set_time_mode(ui_t *ui, bg_time_mode_t time_mode)
215217 {
216218 rdpq_font_style (font_1x , UI_STYLE_SHADOW , & (rdpq_fontstyle_t ){ .color = ui -> shadow_color });
217219 rdpq_font_style (font_1x , UI_STYLE_TEXT , & (rdpq_fontstyle_t ){ .color = ui -> text_color });
218- rdpq_font_style (font_1x , UI_STYLE_DIM , & (rdpq_fontstyle_t ){ .color = UI_DARK_COLOR });
220+ rdpq_font_style (font_1x , UI_STYLE_DIM , & (rdpq_fontstyle_t ){ .color = UI_DIM_COLOR });
219221 }
220222 if (font_2x )
221223 {
222224 rdpq_font_style (font_2x , UI_STYLE_SHADOW , & (rdpq_fontstyle_t ){ .color = ui -> shadow_color });
223225 rdpq_font_style (font_2x , UI_STYLE_TEXT , & (rdpq_fontstyle_t ){ .color = ui -> text_color });
224- rdpq_font_style (font_2x , UI_STYLE_DIM , & (rdpq_fontstyle_t ){ .color = UI_DARK_COLOR });
226+ rdpq_font_style (font_2x , UI_STYLE_DIM , & (rdpq_fontstyle_t ){ .color = UI_DIM_COLOR });
225227 }
226228}
227229
@@ -436,42 +438,35 @@ static void ui_logo_draw(const ui_t *ui)
436438 .scale_y = gfx -> scale ,
437439 });
438440
439- /* Select font and character width based on resolution */
441+ /* Select font based on resolution */
440442 const int font_id = gfx -> highres ? FONT_AT01_2X : FONT_AT01 ;
441- const int char_w = gfx -> highres ? 10 : 5 ;
442- const int shadow_offset = gfx -> highres ? 2 : 1 ;
443+ const int shadow_offset = GFX_SCALE ( 1 ) ;
444+ const int line_h = GFX_SCALE ( 16 ) ;
443445
444- const char * const credit1_str = "Game by .GEARS" ;
445- const int credit1_w = strlen (credit1_str ) * char_w ;
446- const int credit1_x = center_x - (credit1_w / 2 );
447- const int credit1_y = gfx -> height - GFX_SCALE (80 );
446+ /* Credits positioned at right side, right-aligned */
447+ const int credits_x = gfx -> width / 2 ;
448+ const int credits_w = gfx -> width / 2 - GFX_SCALE (32 );
449+ const int credit1_y = gfx -> height / 2 + GFX_SCALE (5 ) + line_h ;
450+ const int credit2_y = credit1_y + line_h ;
451+ const int version_y = credit2_y + line_h ;
448452
453+ const char * const credit1_str = "Game by .GEARS" ;
449454 const char * const credit2_str = "N64 Port by Meeq" ;
450- const int credit2_w = strlen (credit2_str ) * char_w ;
451- const int credit2_x = center_x - (credit2_w / 2 );
452- const int credit2_y = gfx -> height - GFX_SCALE (62 );
453-
454455 const char * const version_str = ROM_VERSION ;
455- const int version_w = strlen (version_str ) * char_w ;
456- const int version_x = gfx -> width - GFX_SCALE (32 ) - version_w ;
457- const int version_y = gfx -> height - GFX_SCALE (32 );
458456
459- /* Draw a shadow under the text */
460- rdpq_textparms_t shadow_parms = { .style_id = UI_STYLE_SHADOW };
461- rdpq_text_print (& shadow_parms , font_id , credit1_x + shadow_offset , credit1_y + shadow_offset , credit1_str );
462- rdpq_text_print (& shadow_parms , font_id , credit2_x + shadow_offset , credit2_y + shadow_offset , credit2_str );
463- if (version_w )
464- {
465- rdpq_text_print (& shadow_parms , font_id , version_x + shadow_offset , version_y + shadow_offset , version_str );
466- }
457+ /* Draw shadows then text for credits (right-aligned) */
458+ rdpq_textparms_t shadow_parms = { .style_id = UI_STYLE_SHADOW , .width = credits_w , .align = ALIGN_RIGHT };
459+ rdpq_textparms_t text_parms = { .style_id = UI_STYLE_TEXT , .width = credits_w , .align = ALIGN_RIGHT };
467460
468- /* Draw the same text on top of the shadow */
469- rdpq_textparms_t text_parms = { .style_id = UI_STYLE_TEXT };
470- rdpq_text_print (& text_parms , font_id , credit1_x , credit1_y , credit1_str );
471- rdpq_text_print (& text_parms , font_id , credit2_x , credit2_y , credit2_str );
472- if (version_w )
461+ rdpq_text_print (& shadow_parms , font_id , credits_x + shadow_offset , credit1_y + shadow_offset , credit1_str );
462+ rdpq_text_print (& shadow_parms , font_id , credits_x + shadow_offset , credit2_y + shadow_offset , credit2_str );
463+ rdpq_text_print (& text_parms , font_id , credits_x , credit1_y , credit1_str );
464+ rdpq_text_print (& text_parms , font_id , credits_x , credit2_y , credit2_str );
465+
466+ if (version_str [0 ])
473467 {
474- rdpq_text_print (& text_parms , font_id , version_x , version_y , version_str );
468+ rdpq_text_print (& shadow_parms , font_id , credits_x + shadow_offset , version_y + shadow_offset , version_str );
469+ rdpq_text_print (& text_parms , font_id , credits_x , version_y , version_str );
475470 }
476471}
477472
@@ -768,12 +763,10 @@ void ui_menu_tick(ui_t *ui, bird_t *bird, const joypad_buttons_t *buttons)
768763static void ui_menu_draw (const ui_t * ui )
769764{
770765 const int font_id = gfx -> highres ? FONT_AT01_2X : FONT_AT01 ;
771- const int char_w = gfx -> highres ? 10 : 5 ;
772- const int line_h = gfx -> highres ? 16 : 8 ;
773- const int shadow_offset = gfx -> highres ? 2 : 1 ;
766+ const int line_h = GFX_SCALE (16 );
767+ const int shadow_offset = GFX_SCALE (1 );
774768
775- const int center_x = gfx -> width / 2 ;
776- const int start_y = gfx -> height / 2 - GFX_SCALE (10 );
769+ const int start_y = gfx -> height / 2 + GFX_SCALE (5 );
777770
778771 /* Get current values */
779772 const char * color_str = MENU_COLOR_NAMES [ui -> bird_color ];
@@ -799,8 +792,7 @@ static void ui_menu_draw(const ui_t *ui)
799792 char line [40 ];
800793 snprintf (line , sizeof (line ), "%s%s" , prefix , rows [i ]);
801794
802- const int text_w = strlen (line ) * char_w ;
803- const int x = center_x - (text_w / 2 );
795+ const int x = GFX_SCALE (32 );
804796 const int y = start_y + (i * line_h );
805797
806798 /* Draw shadow then text (dim if not focused) */
0 commit comments