summaryrefslogtreecommitdiffstats
path: root/src/frontend/mame/ui/inputmap.cpp
diff options
context:
space:
mode:
author npwoods <npwoods@mess.org>2019-06-28 17:30:09 -0400
committer R. Belmont <rb6502@users.noreply.github.com>2019-06-28 17:30:09 -0400
commit697ff7bd7149d635a838543b65409dd42d739087 (patch)
tree23d49d81fd2b87ed565fac5c758b73b678fa7ad2 /src/frontend/mame/ui/inputmap.cpp
parentcec557538d0d55b11780e83ac60e0fef68b37e0d (diff)
Changed the various usages of UI_*COLOR to be calls to src/frontend/mame/ui/moptions.h (#5282)
* Changed the various usages of UI_*COLOR to be calls to src/frontend/mame/ui/moptions.h The various UI_*COLOR macros were implemented as calls to decode_ui_color, which cached the values for the various options in a static array, which was obviously a gross hack. This refactoring is strategic because I am trying to confine awareness of mame_ui_manager to code in src/frontend/mame/ui, and the implementation of decode_ui_color() relied on the ability to access mame_ui_manager as a singleton from outside this code. * Created a ui_colors object, so that queries for UI RGB values would not always require parsing strings * Converted a few more options().zyx_color() to colors().zyx_color() * A few more misses from earlier
Diffstat (limited to 'src/frontend/mame/ui/inputmap.cpp')
-rw-r--r--src/frontend/mame/ui/inputmap.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/frontend/mame/ui/inputmap.cpp b/src/frontend/mame/ui/inputmap.cpp
index 0aa0dc8dcd2..0170dc1d09d 100644
--- a/src/frontend/mame/ui/inputmap.cpp
+++ b/src/frontend/mame/ui/inputmap.cpp
@@ -644,7 +644,7 @@ void menu_settings_dip_switches::custom_render(void *selectedref, float top, flo
y2 = y1 + bottom;
// draw extra menu area
- ui().draw_outlined_box(container(), x1, y1, x2, y2, UI_BACKGROUND_COLOR);
+ ui().draw_outlined_box(container(), x1, y1, x2, y2, ui().colors().background_color());
y1 += (float)DIP_SWITCH_SPACING;
// iterate over DIP switches
@@ -698,7 +698,7 @@ void menu_settings_dip_switches::custom_render_one(float x1, float y1, float x2,
ui::text_layout::RIGHT,
ui::text_layout::NEVER,
mame_ui_manager::NORMAL,
- UI_TEXT_COLOR,
+ ui().colors().text_color(),
PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA),
nullptr ,
nullptr);
@@ -714,7 +714,7 @@ void menu_settings_dip_switches::custom_render_one(float x1, float y1, float x2,
float innerx1;
/* first outline the switch */
- ui().draw_outlined_box(container(), x1, y1, x1 + switch_field_width, y2, UI_BACKGROUND_COLOR);
+ ui().draw_outlined_box(container(), x1, y1, x1 + switch_field_width, y2, ui().colors().background_color());
/* compute x1/x2 for the inner filled in switch */
innerx1 = x1 + (switch_field_width - switch_width) / 2;
@@ -724,13 +724,13 @@ void menu_settings_dip_switches::custom_render_one(float x1, float y1, float x2,
{
float innery1 = (dip->state & (1 << toggle)) ? y1_on : y1_off;
container().add_rect(innerx1, innery1, innerx1 + switch_width, innery1 + SINGLE_TOGGLE_SWITCH_HEIGHT,
- (selectedmask & (1 << toggle)) ? UI_DIPSW_COLOR : UI_TEXT_COLOR,
+ (selectedmask & (1 << toggle)) ? ui().colors().dipsw_color() : ui().colors().text_color(),
PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
}
else
{
container().add_rect(innerx1, y1_off, innerx1 + switch_width, y1_on + SINGLE_TOGGLE_SWITCH_HEIGHT,
- UI_UNAVAILABLE_COLOR,
+ ui().colors().unavailable_color(),
PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
}