From a75bb5341d9c39a84e6aecab10b734bafc1d6d9d Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 6 Aug 2024 14:18:40 +0200 Subject: [PATCH] ui: be consistent with custom_render passed variable names --- src/frontend/mame/ui/about.h | 2 +- src/frontend/mame/ui/analogipt.cpp | 16 ++++++++-------- src/frontend/mame/ui/analogipt.h | 2 +- src/frontend/mame/ui/auditmenu.cpp | 4 ++-- src/frontend/mame/ui/auditmenu.h | 2 +- src/frontend/mame/ui/confswitch.cpp | 8 ++++---- src/frontend/mame/ui/confswitch.h | 2 +- src/frontend/mame/ui/custui.h | 6 +++--- src/frontend/mame/ui/datmenu.h | 2 +- src/frontend/mame/ui/dirmenu.cpp | 4 ++-- src/frontend/mame/ui/filecreate.h | 2 +- src/frontend/mame/ui/filemngr.h | 2 +- src/frontend/mame/ui/filesel.h | 2 +- src/frontend/mame/ui/inputdevices.cpp | 20 ++++++++++---------- src/frontend/mame/ui/inputmap.cpp | 10 +++++----- src/frontend/mame/ui/inputmap.h | 2 +- src/frontend/mame/ui/menu.cpp | 2 +- src/frontend/mame/ui/menu.h | 2 +- src/frontend/mame/ui/selector.h | 2 +- src/frontend/mame/ui/selmenu.cpp | 2 +- src/frontend/mame/ui/selmenu.h | 2 +- src/frontend/mame/ui/simpleselgame.h | 2 +- src/frontend/mame/ui/sliders.cpp | 10 +++++----- src/frontend/mame/ui/sliders.h | 2 +- src/frontend/mame/ui/state.h | 2 +- src/frontend/mame/ui/submenu.h | 2 +- src/frontend/mame/ui/textbox.cpp | 4 ++-- src/frontend/mame/ui/textbox.h | 2 +- 28 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/frontend/mame/ui/about.h b/src/frontend/mame/ui/about.h index 90e9d738fa3..05026b318f6 100644 --- a/src/frontend/mame/ui/about.h +++ b/src/frontend/mame/ui/about.h @@ -30,7 +30,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual void populate_text(std::optional &layout, float &width, int &lines) override; diff --git a/src/frontend/mame/ui/analogipt.cpp b/src/frontend/mame/ui/analogipt.cpp index aa6ffa5a07f..14b09f9c23d 100644 --- a/src/frontend/mame/ui/analogipt.cpp +++ b/src/frontend/mame/ui/analogipt.cpp @@ -113,7 +113,7 @@ void menu_analog::recompute_metrics(uint32_t width, uint32_t height, float aspec } -void menu_analog::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) +void menu_analog::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { // work out how much space to use for field names float const extrawidth(0.4F + (((ui().box_lr_border() * 2.0F) + ui().get_line_height()) * x_aspect())); @@ -133,19 +133,19 @@ void menu_analog::custom_render(uint32_t flags, void *selectedref, float top, fl m_prompt = util::string_format(_("menu-analoginput", "Press %s to show settings"), ui().get_general_input_setting(IPT_UI_ON_SCREEN_DISPLAY)); draw_text_box( &m_prompt, &m_prompt + 1, - m_box_left, m_box_right, y - top, y - top + line_height() + (tb_border() * 2.0F), + m_box_left, m_box_right, origy1 - top, origy1 - top + line_height() + (tb_border() * 2.0F), text_layout::text_justify::CENTER, text_layout::word_wrapping::TRUNCATE, false, fgcolor, ui().colors().background_color()); - m_box_top = y - top + line_height() + (tb_border() * 3.0F); - firstliney = y - top + line_height() + (tb_border() * 4.0F); - m_visible_fields = std::min(m_field_data.size(), int((y2 + bottom - tb_border() - firstliney) / line_height())); + m_box_top = origy1 - top + line_height() + (tb_border() * 3.0F); + firstliney = origy1 - top + line_height() + (tb_border() * 4.0F); + m_visible_fields = std::min(m_field_data.size(), int((origy2 + bottom - tb_border() - firstliney) / line_height())); m_box_bottom = firstliney + (line_height() * m_visible_fields) + tb_border(); } else { - m_box_top = y2 + tb_border(); - m_box_bottom = y2 + bottom; - firstliney = y2 + (tb_border() * 2.0F); + m_box_top = origy2 + tb_border(); + m_box_bottom = origy2 + bottom; + firstliney = origy2 + (tb_border() * 2.0F); m_visible_fields = m_bottom_fields; } ui().draw_outlined_box(container(), m_box_left, m_box_top, m_box_right, m_box_bottom, ui().colors().background_color()); diff --git a/src/frontend/mame/ui/analogipt.h b/src/frontend/mame/ui/analogipt.h index ee59954911c..8caba0e8f7d 100644 --- a/src/frontend/mame/ui/analogipt.h +++ b/src/frontend/mame/ui/analogipt.h @@ -31,7 +31,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual std::tuple custom_pointer_updated(bool changed, ui_event const &uievt) override; virtual void menu_activated() override; diff --git a/src/frontend/mame/ui/auditmenu.cpp b/src/frontend/mame/ui/auditmenu.cpp index 180c3005b73..22d4eb9e8c2 100644 --- a/src/frontend/mame/ui/auditmenu.cpp +++ b/src/frontend/mame/ui/auditmenu.cpp @@ -83,7 +83,7 @@ void menu_audit::recompute_metrics(uint32_t width, uint32_t height, float aspect } -void menu_audit::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) +void menu_audit::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { switch (m_phase) { @@ -92,7 +92,7 @@ void menu_audit::custom_render(uint32_t flags, void *selectedref, float top, flo { draw_text_box( &m_prompt, &m_prompt + 1, - x, x2, y2 + tb_border(), y2 + bottom, + origx1, origx2, origy2 + tb_border(), origy2 + bottom, text_layout::text_justify::CENTER, text_layout::word_wrapping::NEVER, false, ui().colors().text_color(), UI_GREEN_COLOR); } diff --git a/src/frontend/mame/ui/auditmenu.h b/src/frontend/mame/ui/auditmenu.h index 3a1c236549d..7341340804a 100644 --- a/src/frontend/mame/ui/auditmenu.h +++ b/src/frontend/mame/ui/auditmenu.h @@ -30,7 +30,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual bool custom_ui_back() override; private: diff --git a/src/frontend/mame/ui/confswitch.cpp b/src/frontend/mame/ui/confswitch.cpp index 9c17d39fdee..cf69bb7cfbb 100644 --- a/src/frontend/mame/ui/confswitch.cpp +++ b/src/frontend/mame/ui/confswitch.cpp @@ -348,7 +348,7 @@ void menu_settings_dip_switches::recompute_metrics(uint32_t width, uint32_t heig } -void menu_settings_dip_switches::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2) +void menu_settings_dip_switches::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { // catch if no DIP locations have to be drawn if (!m_visible_switch_groups) @@ -371,9 +371,9 @@ void menu_settings_dip_switches::custom_render(uint32_t flags, void *selectedref } // draw extra menu area - float const boxwidth((std::max)(width + (lr_border() * 2.0f), x2 - x1)); + float const boxwidth((std::max)(width + (lr_border() * 2.0f), origx2 - origx1)); float const boxleft((1.0f - boxwidth) * 0.5f); - ui().draw_outlined_box(container(), boxleft, y2 + tb_border(), boxleft + boxwidth, y2 + bottom, ui().colors().background_color()); + ui().draw_outlined_box(container(), boxleft, origy2 + tb_border(), boxleft + boxwidth, origy2 + bottom, ui().colors().background_color()); // calculate centred layout float const nameleft((1.0f - width) * 0.5f); @@ -404,7 +404,7 @@ void menu_settings_dip_switches::custom_render(uint32_t flags, void *selectedref } // draw the name - float const liney(y2 + (tb_border() * 2.0f) + (line_height() * (DIP_SWITCH_HEIGHT + DIP_SWITCH_SPACING) * line)); + float const liney(origy2 + (tb_border() * 2.0f) + (line_height() * (DIP_SWITCH_HEIGHT + DIP_SWITCH_SPACING) * line)); draw_text_normal( group.name, nameleft, liney + (line_height() * (DIP_SWITCH_HEIGHT - 1.0f) / 2.0f), namewidth, diff --git a/src/frontend/mame/ui/confswitch.h b/src/frontend/mame/ui/confswitch.h index 4c04a18c601..3a3aba3c97e 100644 --- a/src/frontend/mame/ui/confswitch.h +++ b/src/frontend/mame/ui/confswitch.h @@ -84,7 +84,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual std::tuple custom_pointer_updated(bool changed, ui_event const &uievt) override; private: diff --git a/src/frontend/mame/ui/custui.h b/src/frontend/mame/ui/custui.h index be9df136f7e..0a916b82f2a 100644 --- a/src/frontend/mame/ui/custui.h +++ b/src/frontend/mame/ui/custui.h @@ -60,7 +60,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual void menu_dismissed() override; private: @@ -96,7 +96,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual void menu_dismissed() override; private: @@ -145,7 +145,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; private: enum diff --git a/src/frontend/mame/ui/datmenu.h b/src/frontend/mame/ui/datmenu.h index e8e7cea2887..a55f659a84d 100644 --- a/src/frontend/mame/ui/datmenu.h +++ b/src/frontend/mame/ui/datmenu.h @@ -44,7 +44,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual std::tuple custom_pointer_updated(bool changed, ui_event const &uievt) override; virtual void populate_text(std::optional &layout, float &width, int &lines) override; diff --git a/src/frontend/mame/ui/dirmenu.cpp b/src/frontend/mame/ui/dirmenu.cpp index 083dfbeba79..fba8f7fcb0c 100644 --- a/src/frontend/mame/ui/dirmenu.cpp +++ b/src/frontend/mame/ui/dirmenu.cpp @@ -165,7 +165,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual bool custom_ui_back() override { return !m_search.empty(); } @@ -447,7 +447,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; private: enum diff --git a/src/frontend/mame/ui/filecreate.h b/src/frontend/mame/ui/filecreate.h index a5f1ab92857..aeb6bcfb159 100644 --- a/src/frontend/mame/ui/filecreate.h +++ b/src/frontend/mame/ui/filecreate.h @@ -48,7 +48,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual bool custom_ui_back() override; private: diff --git a/src/frontend/mame/ui/filemngr.h b/src/frontend/mame/ui/filemngr.h index a8c68ceb211..ba031a0ab21 100644 --- a/src/frontend/mame/ui/filemngr.h +++ b/src/frontend/mame/ui/filemngr.h @@ -32,7 +32,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; private: virtual void populate() override; diff --git a/src/frontend/mame/ui/filesel.h b/src/frontend/mame/ui/filesel.h index 6ca9cafbe68..8c19100259c 100644 --- a/src/frontend/mame/ui/filesel.h +++ b/src/frontend/mame/ui/filesel.h @@ -56,7 +56,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual bool custom_ui_back() override { return !m_filename.empty(); } virtual std::tuple custom_pointer_updated(bool changed, ui_event const &uievt) override; virtual void menu_activated() override; diff --git a/src/frontend/mame/ui/inputdevices.cpp b/src/frontend/mame/ui/inputdevices.cpp index 1ee03ad5c81..8f006ea55e7 100644 --- a/src/frontend/mame/ui/inputdevices.cpp +++ b/src/frontend/mame/ui/inputdevices.cpp @@ -44,7 +44,7 @@ protected: set_custom_space(0.0F, (line_height() * (m_have_analog ? 2.0F : 1.0F)) + (tb_border() * 3.0F)); } - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override { if (selectedref) { @@ -57,20 +57,20 @@ protected: // measure the name of the token string float const tokenwidth = (std::min)(get_string_width(token) + (gutter_width() * 2.0F), 1.0F); - float const boxwidth = (std::max)(tokenwidth, x2 - x); + float const boxwidth = (std::max)(tokenwidth, origx2 - origx1); rgb_t const fgcolor(ui().colors().text_color()); // draw the outer box ui().draw_outlined_box( container(), - (1.0F - boxwidth) * 0.5F, y2 + tb_border(), - (1.0F + boxwidth) * 0.5F, y2 + bottom, + (1.0F - boxwidth) * 0.5F, origy2 + tb_border(), + (1.0F + boxwidth) * 0.5F, origy2 + bottom, ui().colors().background_color()); // show the token draw_text_normal( token, - (1.0F - boxwidth) * 0.5F, y2 + (tb_border() * 2.0F), boxwidth, + (1.0F - boxwidth) * 0.5F, origy2 + (tb_border() * 2.0F), boxwidth, text_layout::text_justify::CENTER, text_layout::word_wrapping::TRUNCATE, fgcolor); @@ -81,11 +81,11 @@ protected: case ITEM_CLASS_RELATIVE: { // draw the indicator - float const indleft = x + gutter_width(); - float const indright = x2 - gutter_width(); - float const indtop = y2 + (tb_border() * 2.0F) + (line_height() * 1.2F); - float const indbottom = y2 + (tb_border() * 2.0F) + (line_height() * 1.8F); - float const indcentre = (x + x2) * 0.5F; + float const indleft = origx1 + gutter_width(); + float const indright = origx2 - gutter_width(); + float const indtop = origy2 + (tb_border() * 2.0F) + (line_height() * 1.2F); + float const indbottom = origy2 + (tb_border() * 2.0F) + (line_height() * 1.8F); + float const indcentre = (origx1 + origx2) * 0.5F; s32 const value = (input.itemclass() == ITEM_CLASS_ABSOLUTE) ? input.read_as_absolute(ITEM_MODIFIER_NONE) : input.read_as_relative(ITEM_MODIFIER_NONE); if (0 < value) { diff --git a/src/frontend/mame/ui/inputmap.cpp b/src/frontend/mame/ui/inputmap.cpp index d8a4d9656f4..b135780a08f 100644 --- a/src/frontend/mame/ui/inputmap.cpp +++ b/src/frontend/mame/ui/inputmap.cpp @@ -322,7 +322,7 @@ void menu_input::recompute_metrics(uint32_t width, uint32_t height, float aspect } -void menu_input::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2) +void menu_input::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { if (pollingitem) { @@ -330,7 +330,7 @@ void menu_input::custom_render(uint32_t flags, void *selectedref, float top, flo char const *const text[] = { seqname.c_str() }; draw_text_box( std::begin(text), std::end(text), - x1, x2, y2 + tb_border(), y2 + bottom, + origx1, origx2, origy2 + tb_border(), origy2 + bottom, text_layout::text_justify::CENTER, text_layout::word_wrapping::NEVER, false, ui().colors().text_color(), ui().colors().background_color()); } @@ -347,7 +347,7 @@ void menu_input::custom_render(uint32_t flags, void *selectedref, float top, flo char const *const text[] = { errormsg.c_str() }; draw_text_box( std::begin(text), std::end(text), - x1, x2, y2 + tb_border(), y2 + bottom, + origx1, origx2, origy2 + tb_border(), origy2 + bottom, text_layout::text_justify::CENTER, text_layout::word_wrapping::NEVER, false, ui().colors().text_color(), UI_RED_COLOR); } @@ -359,7 +359,7 @@ void menu_input::custom_render(uint32_t flags, void *selectedref, float top, flo char const *const text[] = { _("Pressed") }; draw_text_box( std::begin(text), std::end(text), - x1, x2, y2 + tb_border(), y2 + bottom, + origx1, origx2, origy2 + tb_border(), origy2 + bottom, text_layout::text_justify::CENTER, text_layout::word_wrapping::NEVER, false, ui().colors().text_color(), ui().colors().background_color()); } @@ -370,7 +370,7 @@ void menu_input::custom_render(uint32_t flags, void *selectedref, float top, flo (!item.seq.empty() || item.defseq->empty()) ? clearprompt.c_str() : defaultprompt.c_str() }; draw_text_box( std::begin(text), std::end(text), - x1, x2, y2 + tb_border(), y2 + bottom, + origx1, origx2, origy2 + tb_border(), origy2 + bottom, text_layout::text_justify::CENTER, text_layout::word_wrapping::NEVER, false, ui().colors().text_color(), ui().colors().background_color()); } diff --git a/src/frontend/mame/ui/inputmap.h b/src/frontend/mame/ui/inputmap.h index 585d8002a8c..e27e58e67fc 100644 --- a/src/frontend/mame/ui/inputmap.h +++ b/src/frontend/mame/ui/inputmap.h @@ -65,7 +65,7 @@ protected: menu_input(mame_ui_manager &mui, render_container &container); virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; void populate_sorted(); void toggle_none_default(input_seq &selected_seq, input_seq &original_seq, const input_seq &selected_defseq); diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp index 00710e073a9..d6b6d29fccf 100644 --- a/src/frontend/mame/ui/menu.cpp +++ b/src/frontend/mame/ui/menu.cpp @@ -978,7 +978,7 @@ void menu::recompute_metrics(uint32_t width, uint32_t height, float aspect) } -void menu::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) +void menu::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { } diff --git a/src/frontend/mame/ui/menu.h b/src/frontend/mame/ui/menu.h index 14031fb2c08..b59913df1a7 100644 --- a/src/frontend/mame/ui/menu.h +++ b/src/frontend/mame/ui/menu.h @@ -338,7 +338,7 @@ protected: // draw additional menu content virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect); - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2); + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2); // access to pointer state bool have_pointer() const noexcept { return m_global_state.have_pointer(); } diff --git a/src/frontend/mame/ui/selector.h b/src/frontend/mame/ui/selector.h index 58b93c5185a..d52c081da05 100644 --- a/src/frontend/mame/ui/selector.h +++ b/src/frontend/mame/ui/selector.h @@ -39,7 +39,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual bool custom_ui_back() override { return !m_search.empty(); } private: diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp index db16681e247..75631742a0b 100644 --- a/src/frontend/mame/ui/selmenu.cpp +++ b/src/frontend/mame/ui/selmenu.cpp @@ -797,7 +797,7 @@ void menu_select_launch::recompute_metrics(uint32_t width, uint32_t height, floa // perform our special rendering //------------------------------------------------- -void menu_select_launch::custom_render(u32 flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) +void menu_select_launch::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { std::string tempbuf[4]; diff --git a/src/frontend/mame/ui/selmenu.h b/src/frontend/mame/ui/selmenu.h index 29c8e2b94cd..3d1409ab68e 100644 --- a/src/frontend/mame/ui/selmenu.h +++ b/src/frontend/mame/ui/selmenu.h @@ -137,7 +137,7 @@ protected: void launch_system(game_driver const &driver, ui_software_info const &swinfo, std::string const &part) { launch_system(ui(), driver, &swinfo, &part, nullptr); } virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(u32 flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual void menu_activated() override; virtual void menu_deactivated() override; diff --git a/src/frontend/mame/ui/simpleselgame.h b/src/frontend/mame/ui/simpleselgame.h index fcfe94e6109..5b278450d7f 100644 --- a/src/frontend/mame/ui/simpleselgame.h +++ b/src/frontend/mame/ui/simpleselgame.h @@ -32,7 +32,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual bool custom_ui_back() override { return !m_search.empty(); } virtual std::tuple custom_pointer_updated(bool changed, ui_event const &uievt) override; diff --git a/src/frontend/mame/ui/sliders.cpp b/src/frontend/mame/ui/sliders.cpp index 1cbec4e3528..218b4f5c1ea 100644 --- a/src/frontend/mame/ui/sliders.cpp +++ b/src/frontend/mame/ui/sliders.cpp @@ -258,7 +258,7 @@ void menu_sliders::recompute_metrics(uint32_t width, uint32_t height, float aspe // custom_render - perform our special rendering //------------------------------------------------- -void menu_sliders::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2) +void menu_sliders::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { const slider_state *curslider = (const slider_state *)selectedref; if (curslider != nullptr) @@ -280,10 +280,10 @@ void menu_sliders::custom_render(uint32_t flags, void *selectedref, float top, f tempstring.insert(0, " ").insert(0, curslider->description); // move us to the bottom of the screen, and expand to full width - y2 = 1.0f - tb_border(); - y1 = y2 - bottom; - x1 = lr_border(); - x2 = 1.0f - lr_border(); + float x1 = lr_border(); + float x2 = 1.0f - lr_border(); + float y1 = origy2 - bottom; + float y2 = 1.0f - tb_border(); // draw extra menu area ui().draw_outlined_box(container(), x1, y1, x2, y2, ui().colors().background_color()); diff --git a/src/frontend/mame/ui/sliders.h b/src/frontend/mame/ui/sliders.h index b3c8ae3aca7..a705204d082 100644 --- a/src/frontend/mame/ui/sliders.h +++ b/src/frontend/mame/ui/sliders.h @@ -26,7 +26,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual void menu_activated() override; virtual void menu_deactivated() override; diff --git a/src/frontend/mame/ui/state.h b/src/frontend/mame/ui/state.h index 1bbdd1396ae..cff9f3013ff 100644 --- a/src/frontend/mame/ui/state.h +++ b/src/frontend/mame/ui/state.h @@ -38,7 +38,7 @@ protected: bool one_shot); virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual bool handle_keys(uint32_t flags, int &iptkey) override; virtual std::tuple custom_pointer_updated(bool changed, ui_event const &uievt) override; virtual void populate() override; diff --git a/src/frontend/mame/ui/submenu.h b/src/frontend/mame/ui/submenu.h index 80c836e67e8..7ad92467d46 100644 --- a/src/frontend/mame/ui/submenu.h +++ b/src/frontend/mame/ui/submenu.h @@ -61,7 +61,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; private: virtual void populate() override; diff --git a/src/frontend/mame/ui/textbox.cpp b/src/frontend/mame/ui/textbox.cpp index 33319047bd8..223af5e67cf 100644 --- a/src/frontend/mame/ui/textbox.cpp +++ b/src/frontend/mame/ui/textbox.cpp @@ -492,12 +492,12 @@ void menu_fixed_textbox::recompute_metrics(uint32_t width, uint32_t height, floa } -void menu_fixed_textbox::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2) +void menu_fixed_textbox::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) { std::string_view const toptext[] = { m_heading }; draw_text_box( std::begin(toptext), std::end(toptext), - x1, x2, y1 - top, y1 - tb_border(), + origx1, origx2, origy1 - top, origy1 - tb_border(), text_layout::text_justify::CENTER, text_layout::word_wrapping::NEVER, false, ui().colors().text_color(), UI_GREEN_COLOR); } diff --git a/src/frontend/mame/ui/textbox.h b/src/frontend/mame/ui/textbox.h index 3a123980c83..ff8c7a62930 100644 --- a/src/frontend/mame/ui/textbox.h +++ b/src/frontend/mame/ui/textbox.h @@ -84,7 +84,7 @@ public: protected: virtual void recompute_metrics(uint32_t width, uint32_t height, float aspect) override; - virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + virtual void custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) override; virtual void populate_text(std::optional &layout, float &width, int &lines) override;