diff options
author | smf- <smf-@users.noreply.github.com> | 2016-05-23 12:33:32 +0100 |
---|---|---|
committer | smf- <smf-@users.noreply.github.com> | 2016-05-23 12:36:00 +0100 |
commit | ca0c90ad4f8223368c58a2bc84d38dbe0c1d56f6 (patch) | |
tree | 6359ce70192124e68182b2337bd234f6b8198dcc /src/osd/windows/window.cpp | |
parent | bb23c0d7a9783dc220b33780e85823cc555d8224 (diff) |
remove some dead threading code (nw)
Diffstat (limited to 'src/osd/windows/window.cpp')
-rw-r--r-- | src/osd/windows/window.cpp | 137 |
1 files changed, 6 insertions, 131 deletions
diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp index d253f827efa..61de2f537bd 100644 --- a/src/osd/windows/window.cpp +++ b/src/osd/windows/window.cpp @@ -74,7 +74,6 @@ using namespace Windows::UI::Core; #define MIN_WINDOW_DIM 200 // custom window messages -#define WM_USER_SELF_TERMINATE (WM_USER + 1) #define WM_USER_REDRAW (WM_USER + 2) #define WM_USER_SET_FULLSCREEN (WM_USER + 3) #define WM_USER_SET_MAXSIZE (WM_USER + 4) @@ -114,7 +113,6 @@ static DWORD window_threadid; static DWORD last_update_time; static HANDLE ui_pause_event; -static HANDLE window_thread_ready_event; @@ -296,10 +294,6 @@ void windows_osd_interface::window_exit() // kill the UI pause event if (ui_pause_event) CloseHandle(ui_pause_event); - - // kill the window thread ready event - if (window_thread_ready_event) - CloseHandle(window_thread_ready_event); } win_window_info::win_window_info( @@ -812,7 +806,7 @@ void win_window_info::destroy() // destroy the window if (platform_window<HWND>() != nullptr) - SendMessage(platform_window<HWND>(), WM_USER_SELF_TERMINATE, 0, 0); + DestroyWindow(platform_window<HWND>()); // free the render target machine().render().target_free(m_target); @@ -977,11 +971,11 @@ void win_window_info::set_starting_view(int index, const char *defview, const ch //============================================================ -// winwindow_ui_pause_from_main_thread +// winwindow_ui_pause // (main thread) //============================================================ -void winwindow_ui_pause_from_main_thread(running_machine &machine, int pause) +void winwindow_ui_pause(running_machine &machine, int pause) { int old_temp_pause = ui_temp_pause; @@ -1017,34 +1011,7 @@ void winwindow_ui_pause_from_main_thread(running_machine &machine, int pause) } if (LOG_TEMP_PAUSE) - osd_printf_verbose("winwindow_ui_pause_from_main_thread(): %d --> %d\n", old_temp_pause, ui_temp_pause); -} - - - -//============================================================ -// winwindow_ui_pause_from_window_thread -// (window thread) -//============================================================ - -void winwindow_ui_pause_from_window_thread(running_machine &machine, int pause) -{ - assert(GetCurrentThreadId() == window_threadid); - winwindow_ui_pause_from_main_thread(machine, pause); -} - - - -//============================================================ -// winwindow_ui_exec_on_main_thread -// (window thread) -//============================================================ - -void winwindow_ui_exec_on_main_thread(void (*func)(void *), void *param) -{ - assert(GetCurrentThreadId() == window_threadid); - - (*func)(param); + osd_printf_verbose("winwindow_ui_pause(): %d --> %d\n", old_temp_pause, ui_temp_pause); } @@ -1090,93 +1057,6 @@ int win_window_info::wnd_extra_height() return rect_height(&temprect) - 100; } -//============================================================ -// thread_entry -// (window thread) -//============================================================ - -unsigned __stdcall win_window_info::thread_entry(void *param) -{ - MSG message; - windows_osd_interface *osd = static_cast<windows_osd_interface*>(param); - - // make a bogus user call to make us a message thread - PeekMessage(&message, nullptr, 0, 0, PM_NOREMOVE); - - // attach our input to the main thread - AttachThreadInput(main_threadid, window_threadid, TRUE); - - // signal to the main thread that we are ready to receive events - SetEvent(window_thread_ready_event); - - // run the message pump - while (GetMessage(&message, nullptr, 0, 0)) - { - int dispatch = TRUE; - - if ((message.hwnd == nullptr) || is_mame_window(message.hwnd)) - { - switch (message.message) - { - // ignore input messages here - case WM_SYSKEYUP: - case WM_SYSKEYDOWN: - dispatch = FALSE; - break; - - // forward mouse button downs to the input system - case WM_LBUTTONDOWN: - dispatch = !handle_mouse_button(osd, 0, TRUE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); - break; - - case WM_RBUTTONDOWN: - dispatch = !handle_mouse_button(osd, 1, TRUE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); - break; - - case WM_MBUTTONDOWN: - dispatch = !handle_mouse_button(osd, 2, TRUE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); - break; - - case WM_XBUTTONDOWN: - dispatch = !handle_mouse_button(osd, 3, TRUE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); - break; - - // forward mouse button ups to the input system - case WM_LBUTTONUP: - dispatch = !handle_mouse_button(osd, 0, FALSE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); - break; - - case WM_RBUTTONUP: - dispatch = !handle_mouse_button(osd, 1, FALSE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); - break; - - case WM_MBUTTONUP: - dispatch = !handle_mouse_button(osd, 2, FALSE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); - break; - - case WM_XBUTTONUP: - dispatch = !handle_mouse_button(osd, 3, FALSE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); - break; - - // a terminate message to the thread posts a quit - case WM_USER_SELF_TERMINATE: - PostQuitMessage(0); - dispatch = FALSE; - break; - } - } - - // dispatch if necessary - if (dispatch) - { - TranslateMessage(&message); - DispatchMessage(&message); - } - } - return 0; -} - - //============================================================ // complete_create @@ -1369,14 +1249,14 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR case WM_ENTERSIZEMOVE: window->m_resize_state = RESIZE_STATE_RESIZING; case WM_ENTERMENULOOP: - winwindow_ui_pause_from_window_thread(window->machine(), TRUE); + winwindow_ui_pause(window->machine(), TRUE); break; // unpause the system when we stop a menu or resize and force a redraw case WM_EXITSIZEMOVE: window->m_resize_state = RESIZE_STATE_PENDING; case WM_EXITMENULOOP: - winwindow_ui_pause_from_window_thread(window->machine(), FALSE); + winwindow_ui_pause(window->machine(), FALSE); InvalidateRect(wnd, nullptr, FALSE); break; @@ -1458,11 +1338,6 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR break; } - // self destruct - case WM_USER_SELF_TERMINATE: - DestroyWindow(window->platform_window<HWND>()); - break; - // fullscreen set case WM_USER_SET_FULLSCREEN: window->set_fullscreen(wparam); |