From 04a5484b49bc648c93c6e4d22912456b147c37d4 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 11 Jan 2016 10:21:21 +0100 Subject: [PATCH] change initialization order, removes need for additional checks (nw) --- src/emu/machine.cpp | 6 +++--- src/osd/windows/window.cpp | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index c9b72fde6e4..24bc712de15 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -224,6 +224,9 @@ void running_machine::start() // allocate a soft_reset timer m_soft_reset_timer = m_scheduler.timer_alloc(timer_expired_delegate(FUNC(running_machine::soft_reset), this)); + // intialize UI input + m_ui_input = std::make_unique(*this); + // init the osd layer m_manager.osd().init(*this); @@ -241,9 +244,6 @@ void running_machine::start() if (newbase != 0) m_base_time = newbase; - // intialize UI input - m_ui_input = std::make_unique(*this); - // initialize the streams engine before the sound devices start m_sound = std::make_unique(*this); diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp index d1dcefd7045..6111859a255 100644 --- a/src/osd/windows/window.cpp +++ b/src/osd/windows/window.cpp @@ -1292,18 +1292,15 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR // input events case WM_MOUSEMOVE: - if (window->machine().phase() != MACHINE_PHASE_RUNNING) break; window->machine().ui_input().push_mouse_move_event(window->m_target, GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)); break; case WM_MOUSELEAVE: - if (window->machine().phase() != MACHINE_PHASE_RUNNING) break; window->machine().ui_input().push_mouse_leave_event(window->m_target); break; case WM_LBUTTONDOWN: { - if (window->machine().phase() != MACHINE_PHASE_RUNNING) break; DWORD ticks = GetTickCount(); window->machine().ui_input().push_mouse_down_event(window->m_target, GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)); @@ -1325,12 +1322,10 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR } case WM_LBUTTONUP: - if (window->machine().phase() != MACHINE_PHASE_RUNNING) break; window->machine().ui_input().push_mouse_up_event(window->m_target, GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)); break; case WM_CHAR: - if (window->machine().phase() != MACHINE_PHASE_RUNNING) break; window->machine().ui_input().push_char_event(window->m_target, (unicode_char) wparam); break;