diff options
Diffstat (limited to 'src/frontend/mame/ui/datmenu.cpp')
-rw-r--r-- | src/frontend/mame/ui/datmenu.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/src/frontend/mame/ui/datmenu.cpp b/src/frontend/mame/ui/datmenu.cpp index 7df7d2fe4b9..52e7416a43e 100644 --- a/src/frontend/mame/ui/datmenu.cpp +++ b/src/frontend/mame/ui/datmenu.cpp @@ -136,8 +136,8 @@ void menu_dats_view::populate(float &customtop, float &custombottom) (m_issoft == true) ? get_data_sw() : get_data(); item_append(menu_item_type::SEPARATOR, (FLAG_UI_DATS | FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW)); - customtop = 2.0f * ui().get_line_height() + 4.0f * ui().box_tb_border(); - custombottom = ui().get_line_height() + 3.0f * ui().box_tb_border(); + customtop = 2.0f * ui().get_line_height() + 4.0f * UI_BOX_TB_BORDER; + custombottom = ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; if (!paused) machine().resume(); @@ -152,7 +152,7 @@ void menu_dats_view::draw(uint32_t flags) float const line_height = ui().get_line_height(); float const ud_arrow_width = line_height * machine().render().ui_aspect(); float const gutter_width = 0.52f * line_height * machine().render().ui_aspect(); - float const visible_width = 1.0f - (2.0f * ui().box_lr_border()); + float const visible_width = 1.0f - (2.0f * UI_BOX_LR_BORDER); float const visible_left = (1.0f - visible_width) * 0.5f; float const extra_height = 2.0f * line_height; float const visible_extra_menu_height = get_customtop() + get_custombottom() + extra_height; @@ -166,7 +166,7 @@ void menu_dats_view::draw(uint32_t flags) map_mouse(); // account for extra space at the top and bottom - float visible_main_menu_height = 1.0f - 2.0f * ui().box_tb_border() - visible_extra_menu_height; + float visible_main_menu_height = 1.0f - 2.0f * UI_BOX_TB_BORDER - visible_extra_menu_height; m_visible_lines = int(std::trunc(visible_main_menu_height / line_height)); visible_main_menu_height = float(m_visible_lines) * line_height; @@ -175,12 +175,12 @@ void menu_dats_view::draw(uint32_t flags) // compute left box size float x1 = visible_left; - float y1 = visible_top - ui().box_tb_border(); + float y1 = visible_top - UI_BOX_TB_BORDER; float x2 = x1 + visible_width; - float y2 = visible_top + visible_main_menu_height + ui().box_tb_border() + extra_height; + float y2 = visible_top + visible_main_menu_height + UI_BOX_TB_BORDER + extra_height; float line = visible_top + float(m_visible_lines) * line_height; - ui().draw_outlined_box(container(), x1, y1, x2, y2, ui().colors().background_color()); + ui().draw_outlined_box(container(), x1, y1, x2, y2, UI_BACKGROUND_COLOR); m_visible_lines = (std::min)(visible_items, m_visible_lines); top_line = (std::max)(0, top_line); @@ -200,16 +200,16 @@ void menu_dats_view::draw(uint32_t flags) float const line_x1 = x2 - 0.5f * UI_LINE_WIDTH; float const line_y1 = line_y + line_height; - rgb_t fgcolor = ui().colors().text_color(); - rgb_t bgcolor = ui().colors().text_bg_color(); + rgb_t fgcolor = UI_TEXT_COLOR; + rgb_t bgcolor = UI_TEXT_BG_COLOR; if (!linenum && top_line) { // if we're on the top line, display the up arrow if (mouse_in_rect(line_x0, line_y0, line_x1, line_y1)) { - fgcolor = ui().colors().mouseover_color(); - bgcolor = ui().colors().mouseover_bg_color(); + fgcolor = UI_MOUSEOVER_COLOR; + bgcolor = UI_MOUSEOVER_BG_COLOR; highlight(line_x0, line_y0, line_x1, line_y1, bgcolor); set_hover(HOVER_ARROW_UP); } @@ -223,8 +223,8 @@ void menu_dats_view::draw(uint32_t flags) // if we're on the bottom line, display the down arrow if (mouse_in_rect(line_x0, line_y0, line_x1, line_y1)) { - fgcolor = ui().colors().mouseover_color(); - bgcolor = ui().colors().mouseover_bg_color(); + fgcolor = UI_MOUSEOVER_COLOR; + bgcolor = UI_MOUSEOVER_BG_COLOR; highlight(line_x0, line_y0, line_x1, line_y1, bgcolor); set_hover(HOVER_ARROW_DOWN); } @@ -253,8 +253,8 @@ void menu_dats_view::draw(uint32_t flags) float const line_y0 = line; float const line_x1 = x2 - 0.5f * UI_LINE_WIDTH; float const line_y1 = line + line_height; - rgb_t const fgcolor = ui().colors().selected_color(); - rgb_t const bgcolor = ui().colors().selected_bg_color(); + rgb_t const fgcolor = UI_SELECTED_COLOR; + rgb_t const bgcolor = UI_SELECTED_BG_COLOR; if (mouse_in_rect(line_x0, line_y0, line_x1, line_y1) && is_selectable(pitem)) set_hover(count); @@ -263,7 +263,7 @@ void menu_dats_view::draw(uint32_t flags) { container().add_line( visible_left, line + 0.5f * line_height, visible_left + visible_width, line + 0.5f * line_height, - UI_LINE_WIDTH, ui().colors().text_color(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); + UI_LINE_WIDTH, UI_TEXT_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); } else { @@ -297,25 +297,25 @@ void menu_dats_view::custom_render(void *selectedref, float top, float bottom, f ui().draw_text_full(container(), driver.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NONE, rgb_t::white(), rgb_t::black(), &width, nullptr); - width += 2 * ui().box_lr_border(); + width += 2 * UI_BOX_LR_BORDER; maxwidth = std::max(maxwidth, width); // compute our bounds float x1 = 0.5f - 0.5f * maxwidth; float x2 = x1 + maxwidth; float y1 = origy1 - top; - float y2 = origy1 - 2.0f * ui().box_tb_border() - ui().get_line_height(); + float y2 = origy1 - 2.0f * UI_BOX_TB_BORDER - ui().get_line_height(); // draw a box ui().draw_outlined_box(container(), x1, y1, x2, y2, UI_GREEN_COLOR); // take off the borders - x1 += ui().box_lr_border(); - x2 -= ui().box_lr_border(); - y1 += ui().box_tb_border(); + x1 += UI_BOX_LR_BORDER; + x2 -= UI_BOX_LR_BORDER; + y1 += UI_BOX_TB_BORDER; ui().draw_text_full(container(), driver.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER, - mame_ui_manager::NORMAL, ui().colors().text_color(), ui().colors().text_bg_color(), nullptr, nullptr); + mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); maxwidth = 0; for (auto & elem : m_items_list) @@ -328,27 +328,27 @@ void menu_dats_view::custom_render(void *selectedref, float top, float bottom, f float space = (1.0f - maxwidth) / (m_items_list.size() * 2); // compute our bounds - x1 -= ui().box_lr_border(); - x2 += ui().box_lr_border(); - y1 = y2 + ui().box_tb_border(); - y2 += ui().get_line_height() + 2.0f * ui().box_tb_border(); + x1 -= UI_BOX_LR_BORDER; + x2 += UI_BOX_LR_BORDER; + y1 = y2 + UI_BOX_TB_BORDER; + y2 += ui().get_line_height() + 2.0f * UI_BOX_TB_BORDER; // draw a box - ui().draw_outlined_box(container(), x1, y1, x2, y2, ui().colors().background_color()); + ui().draw_outlined_box(container(), x1, y1, x2, y2, UI_BACKGROUND_COLOR); // take off the borders - y1 += ui().box_tb_border(); + y1 += UI_BOX_TB_BORDER; // draw the text within it int x = 0; for (auto & elem : m_items_list) { x1 += space; - rgb_t fcolor = (m_actual == x) ? rgb_t(0xff, 0xff, 0xff, 0x00) : ui().colors().text_color(); - rgb_t bcolor = (m_actual == x) ? rgb_t(0xff, 0xff, 0xff, 0xff) : ui().colors().text_bg_color(); + rgb_t fcolor = (m_actual == x) ? rgb_t(0xff, 0xff, 0xff, 0x00) : UI_TEXT_COLOR; + rgb_t bcolor = (m_actual == x) ? rgb_t(0xff, 0xff, 0xff, 0xff) : UI_TEXT_BG_COLOR; ui().draw_text_full(container(), elem.label.c_str(), x1, y1, 1.0f, ui::text_layout::LEFT, ui::text_layout::NEVER, mame_ui_manager::NONE, fcolor, bcolor, &width, nullptr); - if (bcolor != ui().colors().text_bg_color()) + if (bcolor != UI_TEXT_BG_COLOR) ui().draw_textured_box(container(), x1 - (space / 2), y1, x1 + width + (space / 2), y2, bcolor, rgb_t(255, 43, 43, 43), hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(1)); @@ -361,26 +361,26 @@ void menu_dats_view::custom_render(void *selectedref, float top, float bottom, f std::string revision; revision.assign(_("Revision: ")).append(m_items_list[m_actual].revision); ui().draw_text_full(container(), revision.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NONE, rgb_t::white(), rgb_t::black(), &width, nullptr); - width += 2 * ui().box_lr_border(); + width += 2 * UI_BOX_LR_BORDER; maxwidth = std::max(origx2 - origx1, width); // compute our bounds x1 = 0.5f - 0.5f * maxwidth; x2 = x1 + maxwidth; - y1 = origy2 + ui().box_tb_border(); + y1 = origy2 + UI_BOX_TB_BORDER; y2 = origy2 + bottom; // draw a box ui().draw_outlined_box(container(), x1, y1, x2, y2, UI_GREEN_COLOR); // take off the borders - x1 += ui().box_lr_border(); - x2 -= ui().box_lr_border(); - y1 += ui().box_tb_border(); + x1 += UI_BOX_LR_BORDER; + x2 -= UI_BOX_LR_BORDER; + y1 += UI_BOX_TB_BORDER; // draw the text within it ui().draw_text_full(container(), revision.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE, - mame_ui_manager::NORMAL, ui().colors().text_color(), ui().colors().text_bg_color(), nullptr, nullptr); + mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } //------------------------------------------------- @@ -395,7 +395,7 @@ void menu_dats_view::get_data() float const line_height = ui().get_line_height(); float const gutter_width = 0.52f * line_height * machine().render().ui_aspect(); - float const visible_width = 1.0f - (2.0f * ui().box_lr_border()); + float const visible_width = 1.0f - (2.0f * UI_BOX_LR_BORDER); float const effective_width = visible_width - 2.0f * gutter_width; auto lines = ui().wrap_text(container(), buffer.c_str(), 0.0f, 0.0f, effective_width, xstart, xend); @@ -417,7 +417,7 @@ void menu_dats_view::get_data_sw() else mame_machine_manager::instance()->lua()->call_plugin("data", m_items_list[m_actual].option - 1, buffer); - auto lines = ui().wrap_text(container(), buffer.c_str(), 0.0f, 0.0f, 1.0f - (4.0f * ui().box_lr_border()), xstart, xend); + auto lines = ui().wrap_text(container(), buffer.c_str(), 0.0f, 0.0f, 1.0f - (4.0f * UI_BOX_LR_BORDER), xstart, xend); for (int x = 0; x < lines; ++x) { std::string tempbuf(buffer.substr(xstart[x], xend[x] - xstart[x])); |