diff options
Diffstat (limited to 'src/frontend/mame/ui/videoopt.cpp')
-rw-r--r-- | src/frontend/mame/ui/videoopt.cpp | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/src/frontend/mame/ui/videoopt.cpp b/src/frontend/mame/ui/videoopt.cpp index 8d5ccbca88c..60d2b25c66b 100644 --- a/src/frontend/mame/ui/videoopt.cpp +++ b/src/frontend/mame/ui/videoopt.cpp @@ -67,12 +67,11 @@ void menu_video_targets::populate(float &customtop, float &custombottom) menu -------------------------------------------------*/ -void menu_video_targets::handle() +void menu_video_targets::handle(event const *ev) { - event const *const menu_event = process(0); - if (menu_event && (menu_event->iptkey == IPT_UI_SELECT)) + if (ev && (ev->iptkey == IPT_UI_SELECT)) { - render_target *const target = reinterpret_cast<render_target *>(menu_event->itemref); + render_target *const target = reinterpret_cast<render_target *>(ev->itemref); menu::stack_push<menu_video_options>( ui(), container(), @@ -223,25 +222,24 @@ void menu_video_options::populate(float &customtop, float &custombottom) menu -------------------------------------------------*/ -void menu_video_options::handle() +void menu_video_options::handle(event const *ev) { auto const lockout_popup([this] () { machine().popmessage(_("Cannot change options while recording!")); }); bool const snap_lockout(m_snapshot && machine().video().is_recording()); bool changed(false); // process the menu - event const *const menu_event(process(0)); - if (menu_event && uintptr_t(menu_event->itemref)) + if (ev && uintptr_t(ev->itemref)) { - switch (reinterpret_cast<uintptr_t>(menu_event->itemref)) + switch (reinterpret_cast<uintptr_t>(ev->itemref)) { // rotate adds rotation depending on the direction case ITEM_ROTATE: - if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) + if (ev->iptkey == IPT_UI_LEFT || ev->iptkey == IPT_UI_RIGHT) { if (snap_lockout) return lockout_popup(); - int const delta((menu_event->iptkey == IPT_UI_LEFT) ? ROT270 : ROT90); + int const delta((ev->iptkey == IPT_UI_LEFT) ? ROT270 : ROT90); m_target.set_orientation(orientation_add(delta, m_target.orientation())); if (m_target.is_ui_target()) { @@ -255,18 +253,18 @@ void menu_video_options::handle() // layer config bitmasks handle left/right keys the same (toggle) case ITEM_ZOOM: - if ((menu_event->iptkey == IPT_UI_LEFT) || (menu_event->iptkey == IPT_UI_RIGHT)) + if ((ev->iptkey == IPT_UI_LEFT) || (ev->iptkey == IPT_UI_RIGHT)) { if (snap_lockout) return lockout_popup(); - m_target.set_zoom_to_screen(menu_event->iptkey == IPT_UI_RIGHT); + m_target.set_zoom_to_screen(ev->iptkey == IPT_UI_RIGHT); changed = true; } break; // non-integer scaling: rotate through options case ITEM_UNEVENSTRETCH: - if (menu_event->iptkey == IPT_UI_LEFT) + if (ev->iptkey == IPT_UI_LEFT) { if (snap_lockout) return lockout_popup(); @@ -294,7 +292,7 @@ void menu_video_options::handle() } changed = true; } - else if (menu_event->iptkey == IPT_UI_RIGHT) + else if (ev->iptkey == IPT_UI_RIGHT) { if (snap_lockout) return lockout_popup(); @@ -326,34 +324,34 @@ void menu_video_options::handle() // keep aspect handles left/right keys the same (toggle) case ITEM_KEEPASPECT: - if ((menu_event->iptkey == IPT_UI_LEFT) || (menu_event->iptkey == IPT_UI_RIGHT)) + if ((ev->iptkey == IPT_UI_LEFT) || (ev->iptkey == IPT_UI_RIGHT)) { if (snap_lockout) return lockout_popup(); - m_target.set_keepaspect(menu_event->iptkey == IPT_UI_RIGHT); + m_target.set_keepaspect(ev->iptkey == IPT_UI_RIGHT); changed = true; } break; // anything else is a view item default: - if (reinterpret_cast<uintptr_t>(menu_event->itemref) >= ITEM_VIEW_FIRST) + if (reinterpret_cast<uintptr_t>(ev->itemref) >= ITEM_VIEW_FIRST) { if (snap_lockout) return lockout_popup(); - if (menu_event->iptkey == IPT_UI_SELECT) + if (ev->iptkey == IPT_UI_SELECT) { - m_target.set_view(reinterpret_cast<uintptr_t>(menu_event->itemref) - ITEM_VIEW_FIRST); + m_target.set_view(reinterpret_cast<uintptr_t>(ev->itemref) - ITEM_VIEW_FIRST); changed = true; } } - else if (reinterpret_cast<uintptr_t>(menu_event->itemref) >= ITEM_TOGGLE_FIRST) + else if (reinterpret_cast<uintptr_t>(ev->itemref) >= ITEM_TOGGLE_FIRST) { if (snap_lockout) return lockout_popup(); - if ((menu_event->iptkey == IPT_UI_LEFT) || (menu_event->iptkey == IPT_UI_RIGHT)) + if ((ev->iptkey == IPT_UI_LEFT) || (ev->iptkey == IPT_UI_RIGHT)) { - m_target.set_visibility_toggle(reinterpret_cast<uintptr_t>(menu_event->itemref) - ITEM_TOGGLE_FIRST, menu_event->iptkey == IPT_UI_RIGHT); + m_target.set_visibility_toggle(reinterpret_cast<uintptr_t>(ev->itemref) - ITEM_TOGGLE_FIRST, ev->iptkey == IPT_UI_RIGHT); changed = true; } } |