diff options
Diffstat (limited to 'src/frontend/mame/ui/ui.h')
-rw-r--r-- | src/frontend/mame/ui/ui.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/frontend/mame/ui/ui.h b/src/frontend/mame/ui/ui.h index af9ad03efcc..d2fcd19d512 100644 --- a/src/frontend/mame/ui/ui.h +++ b/src/frontend/mame/ui/ui.h @@ -24,6 +24,7 @@ #include <ctime> #include <functional> #include <set> +#include <string_view> #include <utility> #include <vector> @@ -207,14 +208,14 @@ public: render_font *get_font(); float get_line_height(); float get_char_width(char32_t ch); - float get_string_width(const char *s, float text_size = 1.0f); + float get_string_width(std::string_view s, float text_size = 1.0f); void draw_outlined_box(render_container &container, float x0, float y0, float x1, float y1, rgb_t backcolor); void draw_outlined_box(render_container &container, float x0, float y0, float x1, float y1, rgb_t fgcolor, rgb_t bgcolor); - void draw_text(render_container &container, const char *buf, float x, float y); - void draw_text_full(render_container &container, const char *origs, float x, float y, float origwrapwidth, ui::text_layout::text_justify justify, ui::text_layout::word_wrapping wrap, draw_mode draw, rgb_t fgcolor, rgb_t bgcolor, float *totalwidth = nullptr, float *totalheight = nullptr, float text_size = 1.0f); - void draw_text_box(render_container &container, const char *text, ui::text_layout::text_justify justify, float xpos, float ypos, rgb_t backcolor); + void draw_text(render_container &container, std::string_view buf, float x, float y); + void draw_text_full(render_container &container, std::string_view origs, float x, float y, float origwrapwidth, ui::text_layout::text_justify justify, ui::text_layout::word_wrapping wrap, draw_mode draw, rgb_t fgcolor, rgb_t bgcolor, float *totalwidth = nullptr, float *totalheight = nullptr, float text_size = 1.0f); + void draw_text_box(render_container &container, std::string_view text, ui::text_layout::text_justify justify, float xpos, float ypos, rgb_t backcolor); void draw_text_box(render_container &container, ui::text_layout &layout, float xpos, float ypos, rgb_t backcolor); - void draw_message_window(render_container &container, const char *text); + void draw_message_window(render_container &container, std::string_view text); // load/save options to file void load_ui_options(); @@ -258,7 +259,7 @@ public: ui::text_layout create_layout(render_container &container, float width = 1.0, ui::text_layout::text_justify justify = ui::text_layout::LEFT, ui::text_layout::word_wrapping wrap = ui::text_layout::WORD); // word wrap - int wrap_text(render_container &container, const char *origs, float x, float y, float origwrapwidth, std::vector<int> &xstart, std::vector<int> &xend, float text_size = 1.0f); + int wrap_text(render_container &container, std::string_view origs, float x, float y, float origwrapwidth, std::vector<int> &xstart, std::vector<int> &xend, float text_size = 1.0f); // draw an outlined box with given line color and filled with a texture void draw_textured_box(render_container &container, float x0, float y0, float x1, float y1, rgb_t backcolor, rgb_t linecolor, render_texture *texture = nullptr, uint32_t flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); |