summaryrefslogtreecommitdiffstats
path: root/src/frontend/mame/ui/selector.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2016-10-23 00:22:00 +0200
committer AJR <ajrhacker@users.noreply.github.com>2016-10-22 18:45:04 -0400
commit7d41a1f619f0e03eeaf7acc2edde6c2671779e03 (patch)
tree4b8e1df6b0bd371b296c55f55f17ef7159543284 /src/frontend/mame/ui/selector.cpp
parentf1dcd36b73aa0a8afd9a0053c97c668acc3e0319 (diff)
Improvements to rgb_t (nw)
- Make most class methods constexpr - Make color constants (white, black, etc.) into constexpr factory methods, in order to fix a static initialization problem discussed on the MAMEWorld forums. (Note that while C++14 allows constexpr member variables to be initialized outside classes, current compilers' support for C++14 constexpr rules has proven to be lamentably deficient.) - Create bitmap_rgb32::erase to simplify syntax in update handlers
Diffstat (limited to 'src/frontend/mame/ui/selector.cpp')
-rw-r--r--src/frontend/mame/ui/selector.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/frontend/mame/ui/selector.cpp b/src/frontend/mame/ui/selector.cpp
index d94c7085792..f2944791dbd 100644
--- a/src/frontend/mame/ui/selector.cpp
+++ b/src/frontend/mame/ui/selector.cpp
@@ -154,7 +154,7 @@ void menu_selector::custom_render(void *selectedref, float top, float bottom, fl
// 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,
- mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
+ mame_ui_manager::NONE, rgb_t::white(), rgb_t::black(), &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
float maxwidth = std::max(width, origx2 - origx1);
@@ -182,7 +182,7 @@ void menu_selector::custom_render(void *selectedref, float top, float bottom, fl
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,
- mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
+ mame_ui_manager::NONE, rgb_t::white(), rgb_t::black(), &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = std::max(maxwidth, width);