diff options
author | 2016-04-15 00:11:47 -0600 | |
---|---|---|
committer | 2016-04-15 00:11:47 -0600 | |
commit | ea5897cb5e10f19e02e510ddbf68e3fa8c16df59 (patch) | |
tree | cb709f2b7d388490ee3455553716625bff6eb9b1 /src/emu/ui/ui.cpp | |
parent | 4a6bf3a4ca483a869effa955902be52007f0b040 (diff) | |
parent | 685824106cf5a490b54685582f7d97c3a97afc47 (diff) |
Merge branch 'master' of https://github.com/mamedev/mame
Diffstat (limited to 'src/emu/ui/ui.cpp')
-rw-r--r-- | src/emu/ui/ui.cpp | 44 |
1 files changed, 15 insertions, 29 deletions
diff --git a/src/emu/ui/ui.cpp b/src/emu/ui/ui.cpp index b8ad5ee7f9c..718e73bb9ef 100644 --- a/src/emu/ui/ui.cpp +++ b/src/emu/ui/ui.cpp @@ -563,7 +563,7 @@ float ui_manager::get_line_height() // if our font is small-ish, do integral scaling if (raw_font_pixel_height < 24) { - // do we want to scale smaller? only do so if we exceed the threshhold + // do we want to scale smaller? only do so if we exceed the threshold if (scale_factor <= 1.0f) { if (one_to_one_line_height < UI_MAX_FONT_HEIGHT || raw_font_pixel_height < 12) @@ -602,9 +602,9 @@ float ui_manager::get_char_width(unicode_char ch) // character string //------------------------------------------------- -float ui_manager::get_string_width(const char *s) +float ui_manager::get_string_width(const char *s, float text_size) { - return get_font()->utf8string_width(get_line_height(), machine().render().ui_aspect(), s); + return get_font()->utf8string_width(get_line_height() * text_size, machine().render().ui_aspect(), s); } @@ -2402,12 +2402,11 @@ static INT32 slider_overyoffset(running_machine &machine, void *arg, int id, std static INT32 slider_flicker(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) { - vector_device *vector = nullptr; if (newval != SLIDER_NOCHANGE) - vector->set_flicker((float)newval * 0.001f); + vector_options::s_flicker = (float)newval * 0.001f; if (str) - *str = string_format(_("%1$1.2f"), vector->get_flicker()); - return floor(vector->get_flicker() * 1000.0f + 0.5f); + *str = string_format(_("%1$1.2f"), vector_options::s_flicker); + return floor(vector_options::s_flicker * 1000.0f + 0.5f); } @@ -2418,12 +2417,11 @@ static INT32 slider_flicker(running_machine &machine, void *arg, int id, std::st static INT32 slider_beam_width_min(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) { - vector_device *vector = nullptr; if (newval != SLIDER_NOCHANGE) - vector->set_beam_width_min(MIN((float)newval * 0.01f, vector->get_beam_width_max())); + vector_options::s_beam_width_min = MIN((float)newval * 0.01f, vector_options::s_beam_width_max); if (str != nullptr) - *str = string_format(_("%1$1.2f"), vector->get_beam_width_min()); - return floor(vector->get_beam_width_min() * 100.0f + 0.5f); + *str = string_format(_("%1$1.2f"), vector_options::s_beam_width_min); + return floor(vector_options::s_beam_width_min * 100.0f + 0.5f); } @@ -2434,12 +2432,11 @@ static INT32 slider_beam_width_min(running_machine &machine, void *arg, int id, static INT32 slider_beam_width_max(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) { - vector_device *vector = nullptr; if (newval != SLIDER_NOCHANGE) - vector->set_beam_width_max(MAX((float)newval * 0.01f, vector->get_beam_width_min())); + vector_options::s_beam_width_max = MAX((float)newval * 0.01f, vector_options::s_beam_width_min); if (str != nullptr) - *str = string_format(_("%1$1.2f"), vector->get_beam_width_max()); - return floor(vector->get_beam_width_max() * 100.0f + 0.5f); + *str = string_format(_("%1$1.2f"), vector_options::s_beam_width_max); + return floor(vector_options::s_beam_width_max * 100.0f + 0.5f); } @@ -2450,12 +2447,11 @@ static INT32 slider_beam_width_max(running_machine &machine, void *arg, int id, static INT32 slider_beam_intensity_weight(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) { - vector_device *vector = nullptr; if (newval != SLIDER_NOCHANGE) - vector->set_beam_intensity_weight((float)newval * 0.001f); + vector_options::s_beam_intensity_weight = (float)newval * 0.001f; if (str != nullptr) - *str = string_format(_("%1$1.2f"), vector->get_beam_intensity_weight()); - return floor(vector->get_beam_intensity_weight() * 1000.0f + 0.5f); + *str = string_format(_("%1$1.2f"), vector_options::s_beam_intensity_weight); + return floor(vector_options::s_beam_intensity_weight * 1000.0f + 0.5f); } @@ -2685,16 +2681,6 @@ void ui_manager::draw_textured_box(render_container *container, float x0, float } //------------------------------------------------- -// get_string_width_ex - return the width of a -// character string with given text size -//------------------------------------------------- - -float ui_manager::get_string_width_ex(const char *s, float text_size) -{ - return get_font()->utf8string_width(get_line_height() * text_size, machine().render().ui_aspect(), s); -} - -//------------------------------------------------- // decode UI color options //------------------------------------------------- |