summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui/sliders.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/sliders.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/sliders.cpp')
-rw-r--r--src/frontend/mame/ui/sliders.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/frontend/mame/ui/sliders.cpp b/src/frontend/mame/ui/sliders.cpp
index 579a0cbc640..560dd1096a5 100644
--- a/src/frontend/mame/ui/sliders.cpp
+++ b/src/frontend/mame/ui/sliders.cpp
@@ -230,7 +230,7 @@ void menu_sliders::custom_render(void *selectedref, float top, float bottom, flo
x2 = 1.0f - UI_BOX_LR_BORDER;
// 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 += UI_BOX_TB_BORDER;
// determine the text height
@@ -250,19 +250,19 @@ void menu_sliders::custom_render(void *selectedref, float top, float bottom, flo
current_x = bar_left + bar_width * percentage;
// fill in the percentage
- container().add_rect(bar_left, bar_top, current_x, bar_bottom, UI_SLIDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
+ container().add_rect(bar_left, bar_top, current_x, bar_bottom, ui().colors().slider_color(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
// draw the top and bottom lines
- container().add_line(bar_left, bar_top, bar_left + bar_width, bar_top, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
- container().add_line(bar_left, bar_bottom, bar_left + bar_width, bar_bottom, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
+ container().add_line(bar_left, bar_top, bar_left + bar_width, bar_top, UI_LINE_WIDTH, ui().colors().border_color(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
+ container().add_line(bar_left, bar_bottom, bar_left + bar_width, bar_bottom, UI_LINE_WIDTH, ui().colors().border_color(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
// draw default marker
- container().add_line(default_x, bar_area_top, default_x, bar_top, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
- container().add_line(default_x, bar_bottom, default_x, bar_area_top + bar_area_height, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
+ container().add_line(default_x, bar_area_top, default_x, bar_top, UI_LINE_WIDTH, ui().colors().border_color(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
+ container().add_line(default_x, bar_bottom, default_x, bar_area_top + bar_area_height, UI_LINE_WIDTH, ui().colors().border_color(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
// draw the actual text
ui().draw_text_full(container(), tempstring.c_str(), x1 + UI_BOX_LR_BORDER, y1 + line_height, x2 - x1 - 2.0f * UI_BOX_LR_BORDER,
- ui::text_layout::CENTER, ui::text_layout::WORD, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, &text_height);
+ ui::text_layout::CENTER, ui::text_layout::WORD, mame_ui_manager::NORMAL, ui().colors().text_color(), ui().colors().text_bg_color(), nullptr, &text_height);
}
}