Fold kconfig_draw gr_string label calls
This commit is contained in:
parent
94202ff782
commit
e05603b0d7
|
@ -853,6 +853,14 @@ static int get_item_height(const kc_item &item, const kc_mitem &mitem)
|
|||
return h;
|
||||
}
|
||||
|
||||
static void kc_gr_2y_string(const char *const s, const font_y_scaled_float y, const font_x_scaled_float x0, const font_x_scaled_float x1)
|
||||
{
|
||||
int w, h;
|
||||
gr_get_string_size(s, &w, &h, nullptr);
|
||||
gr_string(x0, y, s, w, h);
|
||||
gr_string(x1, y, s, w, h);
|
||||
}
|
||||
|
||||
static void kconfig_draw(kc_menu *menu)
|
||||
{
|
||||
grs_canvas * save_canvas = grd_curcanv;
|
||||
|
@ -896,9 +904,7 @@ static void kconfig_draw(kc_menu *menu)
|
|||
gr_rect(fspacx253, fspacy42, fspacx253, fspacy44, color); // vert/left
|
||||
gr_rect(fspacx283, fspacy42, fspacx283, fspacy44, color); // vert/right
|
||||
|
||||
const auto &&fspacy40 = fspacy(40);
|
||||
gr_string(fspacx(109), fspacy40, "OR");
|
||||
gr_string(fspacx(264), fspacy40, "OR");
|
||||
kc_gr_2y_string("OR", fspacy(40), fspacx(109), fspacx(264));
|
||||
}
|
||||
#if DXX_MAX_JOYSTICKS
|
||||
else if ( menu->items == kc_joystick )
|
||||
|
@ -911,10 +917,8 @@ static void kconfig_draw(kc_menu *menu)
|
|||
const auto &&fspacy145 = fspacy(145);
|
||||
gr_string(0x8000, fspacy(137), TXT_AXES);
|
||||
gr_set_fontcolor( BM_XRGB(28,28,28), -1 );
|
||||
gr_string(fspacx( 81), fspacy145, TXT_AXIS);
|
||||
gr_string(fspacx(230), fspacy145, TXT_AXIS);
|
||||
gr_string(fspacx(111), fspacy145, TXT_INVERT);
|
||||
gr_string(fspacx(260), fspacy145, TXT_INVERT);
|
||||
kc_gr_2y_string(TXT_AXIS, fspacy145, fspacx(81), fspacx(230));
|
||||
kc_gr_2y_string(TXT_INVERT, fspacy145, fspacx(111), fspacx(260));
|
||||
#endif
|
||||
gr_set_fontcolor( BM_XRGB(31,27,6), -1 );
|
||||
|
||||
|
@ -937,8 +941,7 @@ static void kconfig_draw(kc_menu *menu)
|
|||
gr_rect(fspacx291, fspacy40, fspacx291, fspacy42, color); // vert/right
|
||||
|
||||
const auto &&fspacy38 = fspacy(38);
|
||||
gr_string(fspacx(126), fspacy38, "OR");
|
||||
gr_string(fspacx(272), fspacy38, "OR");
|
||||
kc_gr_2y_string("OR", fspacy38, fspacx(126), fspacx(272));
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -949,10 +952,8 @@ static void kconfig_draw(kc_menu *menu)
|
|||
gr_string(0x8000, fspacy(137), TXT_AXES);
|
||||
gr_set_fontcolor( BM_XRGB(28,28,28), -1 );
|
||||
const auto &&fspacy145 = fspacy(145);
|
||||
gr_string(fspacx( 87), fspacy145, TXT_AXIS);
|
||||
gr_string(fspacx(242), fspacy145, TXT_AXIS);
|
||||
gr_string(fspacx(120), fspacy145, TXT_INVERT);
|
||||
gr_string(fspacx(274), fspacy145, TXT_INVERT);
|
||||
kc_gr_2y_string(TXT_AXIS, fspacy145, fspacx( 87), fspacx(242));
|
||||
kc_gr_2y_string(TXT_INVERT, fspacy145, fspacx(120), fspacx(274));
|
||||
}
|
||||
else if ( menu->items == kc_rebirth )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue