From 762925f409ebaed1728d1f1cd1a28e49e0d2ce76 Mon Sep 17 00:00:00 2001 From: AJR Date: Fri, 15 Sep 2017 20:49:44 -0400 Subject: Eliminate last use of auto_alloc in frontend (nw) --- src/frontend/mame/ui/ui.cpp | 6 +++--- src/frontend/mame/ui/ui.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index d81dd884383..b857d613c12 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -181,6 +181,7 @@ mame_ui_manager::mame_ui_manager(running_machine &machine) , m_showfps_end(0) , m_show_profiler(false) , m_popup_text_end(0) + , m_mouse_bitmap(32, 32) , m_mouse_arrow_texture(nullptr) , m_mouse_show(false) {} @@ -208,11 +209,10 @@ void mame_ui_manager::init() machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(&mame_ui_manager::exit, this)); // create mouse bitmap - bitmap_argb32 *ui_mouse_bitmap = auto_alloc(machine(), bitmap_argb32(32, 32)); - uint32_t *dst = &ui_mouse_bitmap->pix32(0); + uint32_t *dst = &m_mouse_bitmap.pix32(0); memcpy(dst,mouse_bitmap,32*32*sizeof(uint32_t)); m_mouse_arrow_texture = machine().render().texture_alloc(); - m_mouse_arrow_texture->set_bitmap(*ui_mouse_bitmap, ui_mouse_bitmap->cliprect(), TEXFORMAT_ARGB32); + m_mouse_arrow_texture->set_bitmap(m_mouse_bitmap, m_mouse_bitmap.cliprect(), TEXFORMAT_ARGB32); } diff --git a/src/frontend/mame/ui/ui.h b/src/frontend/mame/ui/ui.h index 239190e7a11..b124b471d9c 100644 --- a/src/frontend/mame/ui/ui.h +++ b/src/frontend/mame/ui/ui.h @@ -243,6 +243,7 @@ private: bool m_show_profiler; osd_ticks_t m_popup_text_end; std::unique_ptr m_non_char_keys_down; + bitmap_argb32 m_mouse_bitmap; render_texture * m_mouse_arrow_texture; bool m_mouse_show; ui_options m_ui_options; -- cgit v1.2.3