From 6cf052b3f2fe83da4778fefb93475a8bb2c836c8 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Mon, 6 Apr 2020 19:45:15 +0100 Subject: [PATCH] [d3d9] Cleanup ResetWindowProc --- src/d3d9/d3d9_swapchain.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/d3d9/d3d9_swapchain.cpp b/src/d3d9/d3d9_swapchain.cpp index 6a22b0de4..d1c7d4e2d 100644 --- a/src/d3d9/d3d9_swapchain.cpp +++ b/src/d3d9/d3d9_swapchain.cpp @@ -1498,10 +1498,11 @@ namespace dxvk { ? (WNDPROC)GetWindowLongPtrW(m_window, GWLP_WNDPROC) : (WNDPROC)GetWindowLongPtrA(m_window, GWLP_WNDPROC); - if (proc == D3D9WindowProc && it->second.unicode) - SetWindowLongPtrW(m_window, GWLP_WNDPROC, (LONG_PTR)it->second.proc); - else if (proc == D3D9WindowProc && !it->second.unicode) - SetWindowLongPtrA(m_window, GWLP_WNDPROC, (LONG_PTR)it->second.proc); + if (proc == D3D9WindowProc) { + it->second.unicode + ? SetWindowLongPtrW(m_window, GWLP_WNDPROC, (LONG_PTR)it->second.proc) + : SetWindowLongPtrA(m_window, GWLP_WNDPROC, (LONG_PTR)it->second.proc); + } g_windowProcMap.erase(m_window); }