diff options
author | 2016-07-10 22:10:44 +1000 | |
---|---|---|
committer | 2016-07-10 22:10:59 +1000 | |
commit | 3258d3feef7ecba3067bde2ed527849811297020 (patch) | |
tree | 82295081a7c83835fe8d42a3ddd3d71a854059b1 /src/frontend/mame/ui/selector.cpp | |
parent | 9bbf1208e309370371d54b620077c5e2c993bbe3 (diff) |
UI refactoring: [Vas Crabb]
* std::bind - accept no substitutes
* pointer -> reference conversion
* make more menu members private or protected
* don't play so fast and loose with integer types
* reduce some vector copying
* make more static constants const
Diffstat (limited to 'src/frontend/mame/ui/selector.cpp')
-rw-r--r-- | src/frontend/mame/ui/selector.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/frontend/mame/ui/selector.cpp b/src/frontend/mame/ui/selector.cpp index 236ce06f672..0aa6798d849 100644 --- a/src/frontend/mame/ui/selector.cpp +++ b/src/frontend/mame/ui/selector.cpp @@ -21,7 +21,7 @@ namespace ui { // ctor / dtor //------------------------------------------------- -menu_selector::menu_selector(mame_ui_manager &mui, render_container *container, std::vector<std::string> const &s_sel, UINT16 &s_actual, int category, int _hover) +menu_selector::menu_selector(mame_ui_manager &mui, render_container &container, std::vector<std::string> const &s_sel, UINT16 &s_actual, int category, int _hover) : menu(mui, container) , m_selector(s_actual) , m_category(category) @@ -33,7 +33,7 @@ menu_selector::menu_selector(mame_ui_manager &mui, render_container *container, m_searchlist[0] = nullptr; } -menu_selector::menu_selector(mame_ui_manager &mui, render_container *container, std::vector<std::string> &&s_sel, UINT16 &s_actual, int category, int _hover) +menu_selector::menu_selector(mame_ui_manager &mui, render_container &container, std::vector<std::string> &&s_sel, UINT16 &s_actual, int category, int _hover) : menu(mui, container) , m_selector(s_actual) , m_category(category) @@ -167,7 +167,7 @@ void menu_selector::custom_render(void *selectedref, float top, float bottom, fl std::string tempbuf = std::string(_("Selection List - Search: ")).append(m_search).append("_"); // get the size of the text - ui().draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE, + ui().draw_text_full(container(), tempbuf.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.0f * UI_BOX_LR_BORDER) + 0.01f; float maxwidth = MAX(width, origx2 - origx1); @@ -179,7 +179,7 @@ void menu_selector::custom_render(void *selectedref, float top, float bottom, fl float y2 = origy1 - UI_BOX_TB_BORDER; // draw a box - ui().draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR); + ui().draw_outlined_box(container(), x1, y1, x2, y2, UI_GREEN_COLOR); // take off the borders x1 += UI_BOX_LR_BORDER; @@ -187,7 +187,7 @@ void menu_selector::custom_render(void *selectedref, float top, float bottom, fl y1 += UI_BOX_TB_BORDER; // draw the text within it - ui().draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE, + ui().draw_text_full(container(), tempbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); // bottom text @@ -195,7 +195,7 @@ void menu_selector::custom_render(void *selectedref, float top, float bottom, fl std::string ui_select_text = machine().input().seq_name(machine().ioport().type_seq(IPT_UI_SELECT, 0, SEQ_TYPE_STANDARD)); tempbuf = string_format(_("Double click or press %1$s to select"), ui_select_text); - ui().draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER, + ui().draw_text_full(container(), tempbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(maxwidth, width); @@ -207,7 +207,7 @@ void menu_selector::custom_render(void *selectedref, float top, float bottom, fl y2 = origy2 + bottom; // draw a box - ui().draw_outlined_box(container, x1, y1, x2, y2, UI_RED_COLOR); + ui().draw_outlined_box(container(), x1, y1, x2, y2, UI_RED_COLOR); // take off the borders x1 += UI_BOX_LR_BORDER; @@ -215,7 +215,7 @@ void menu_selector::custom_render(void *selectedref, float top, float bottom, fl y1 += UI_BOX_TB_BORDER; // draw the text within it - ui().draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER, + ui().draw_text_full(container(), tempbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } |