From 25c07dc86ccba1dd95e2b2dd95ad7ae344dfc37d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 4 Aug 2008 14:16:49 -0500 Subject: [PATCH] wined3d: Remove the ddraw_window device member. --- dlls/wined3d/device.c | 35 ++++++++++++++++------------------ dlls/wined3d/surface.c | 4 ++-- dlls/wined3d/swapchain_gdi.c | 2 +- dlls/wined3d/wined3d_private.h | 1 - 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 91da15a803a..43837b28d3b 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1432,13 +1432,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic if (!object->win_handle) { object->win_handle = This->createParms.hFocusWindow; } - if(!This->ddraw_window) { - if(!pPresentationParameters->Windowed && object->win_handle) { - IWineD3DDeviceImpl_SetupFullscreenWindow(iface, object->win_handle, - pPresentationParameters->BackBufferWidth, - pPresentationParameters->BackBufferHeight); - } - This->ddraw_window = object->win_handle; + if(!pPresentationParameters->Windowed && object->win_handle) { + IWineD3DDeviceImpl_SetupFullscreenWindow(iface, object->win_handle, + pPresentationParameters->BackBufferWidth, + pPresentationParameters->BackBufferHeight); } hDc = GetDC(object->win_handle); @@ -6652,8 +6649,8 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED if(buffer == GL_FRONT) { RECT windowsize; UINT h; - ClientToScreen(This->ddraw_window, &offset); - GetClientRect(This->ddraw_window, &windowsize); + ClientToScreen(((IWineD3DSwapChainImpl *)src_swapchain)->win_handle, &offset); + GetClientRect(((IWineD3DSwapChainImpl *)src_swapchain)->win_handle, &windowsize); h = windowsize.bottom - windowsize.top; src_rect->x1 -= offset.x; src_rect->x2 -=offset.x; src_rect->y1 = offset.y + h - src_rect->y1; @@ -6693,8 +6690,8 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED if(buffer == GL_FRONT) { RECT windowsize; UINT h; - ClientToScreen(This->ddraw_window, &offset); - GetClientRect(This->ddraw_window, &windowsize); + ClientToScreen(((IWineD3DSwapChainImpl *)dst_swapchain)->win_handle, &offset); + GetClientRect(((IWineD3DSwapChainImpl *)dst_swapchain)->win_handle, &windowsize); h = windowsize.bottom - windowsize.top; dst_rect->x1 -= offset.x; dst_rect->x2 -=offset.x; dst_rect->y1 = offset.y + h - dst_rect->y1; @@ -7397,21 +7394,21 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE IWineD3DDevice_SetDisplayMode(iface, 0, &mode); - if(This->ddraw_window && !pPresentationParameters->Windowed) { + if(swapchain->win_handle && !pPresentationParameters->Windowed) { if(swapchain->presentParms.Windowed) { /* switch from windowed to fs */ - IWineD3DDeviceImpl_SetupFullscreenWindow(iface, This->ddraw_window, + IWineD3DDeviceImpl_SetupFullscreenWindow(iface, swapchain->win_handle, pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight); } else { /* Fullscreen -> fullscreen mode change */ - MoveWindow(This->ddraw_window, 0, 0, - pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight, - TRUE); + MoveWindow(swapchain->win_handle, 0, 0, + pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight, + TRUE); } - } else if(This->ddraw_window && !swapchain->presentParms.Windowed) { + } else if(swapchain->win_handle && !swapchain->presentParms.Windowed) { /* Fullscreen -> windowed switch */ - IWineD3DDeviceImpl_RestoreWindow(iface, This->ddraw_window); + IWineD3DDeviceImpl_RestoreWindow(iface, swapchain->win_handle); } swapchain->presentParms.Windowed = pPresentationParameters->Windowed; } else if(!pPresentationParameters->Windowed) { @@ -7422,7 +7419,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE */ This->style = 0; This->exStyle = 0; - IWineD3DDeviceImpl_SetupFullscreenWindow(iface, This->ddraw_window, + IWineD3DDeviceImpl_SetupFullscreenWindow(iface, swapchain->win_handle, pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight); This->style = style; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index dff833ed527..3c56d4c944f 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -3451,8 +3451,8 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * RECT windowsize; POINT offset = {0,0}; UINT h; - ClientToScreen(myDevice->ddraw_window, &offset); - GetClientRect(myDevice->ddraw_window, &windowsize); + ClientToScreen(dstSwapchain->win_handle, &offset); + GetClientRect(dstSwapchain->win_handle, &windowsize); h = windowsize.bottom - windowsize.top; rect.x1 -= offset.x; rect.x2 -=offset.x; rect.y1 -= offset.y; rect.y2 -=offset.y; diff --git a/dlls/wined3d/swapchain_gdi.c b/dlls/wined3d/swapchain_gdi.c index 41a5475e209..7aa81c2a518 100644 --- a/dlls/wined3d/swapchain_gdi.c +++ b/dlls/wined3d/swapchain_gdi.c @@ -93,7 +93,7 @@ void x11_copy_to_screen(IWineD3DSwapChainImpl *This, LPRECT rc) { hSurfaceDC = front->hDC; - hDisplayWnd = front->resource.wineD3DDevice->ddraw_window; + hDisplayWnd = This->win_handle; hDisplayDC = GetDCEx(hDisplayWnd, 0, DCX_CLIPSIBLINGS|DCX_CACHE); if(rc) { TRACE(" copying rect (%d,%d)->(%d,%d), offset (%d,%d)\n", diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index ee1e1e8d209..6f1479032b3 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -920,7 +920,6 @@ struct IWineD3DDeviceImpl BOOL softwareVertexProcessing; /* DirectDraw stuff */ - HWND ddraw_window; DWORD ddraw_width, ddraw_height; WINED3DFORMAT ddraw_format;