Commit 25c07dc8 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Remove the ddraw_window device member.

parent 376944eb
...@@ -1432,14 +1432,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic ...@@ -1432,14 +1432,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
if (!object->win_handle) { if (!object->win_handle) {
object->win_handle = This->createParms.hFocusWindow; object->win_handle = This->createParms.hFocusWindow;
} }
if(!This->ddraw_window) {
if(!pPresentationParameters->Windowed && object->win_handle) { if(!pPresentationParameters->Windowed && object->win_handle) {
IWineD3DDeviceImpl_SetupFullscreenWindow(iface, object->win_handle, IWineD3DDeviceImpl_SetupFullscreenWindow(iface, object->win_handle,
pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferWidth,
pPresentationParameters->BackBufferHeight); pPresentationParameters->BackBufferHeight);
} }
This->ddraw_window = object->win_handle;
}
hDc = GetDC(object->win_handle); hDc = GetDC(object->win_handle);
TRACE("Using hDc %p\n", hDc); TRACE("Using hDc %p\n", hDc);
...@@ -6652,8 +6649,8 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED ...@@ -6652,8 +6649,8 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
if(buffer == GL_FRONT) { if(buffer == GL_FRONT) {
RECT windowsize; RECT windowsize;
UINT h; UINT h;
ClientToScreen(This->ddraw_window, &offset); ClientToScreen(((IWineD3DSwapChainImpl *)src_swapchain)->win_handle, &offset);
GetClientRect(This->ddraw_window, &windowsize); GetClientRect(((IWineD3DSwapChainImpl *)src_swapchain)->win_handle, &windowsize);
h = windowsize.bottom - windowsize.top; h = windowsize.bottom - windowsize.top;
src_rect->x1 -= offset.x; src_rect->x2 -=offset.x; src_rect->x1 -= offset.x; src_rect->x2 -=offset.x;
src_rect->y1 = offset.y + h - src_rect->y1; src_rect->y1 = offset.y + h - src_rect->y1;
...@@ -6693,8 +6690,8 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED ...@@ -6693,8 +6690,8 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
if(buffer == GL_FRONT) { if(buffer == GL_FRONT) {
RECT windowsize; RECT windowsize;
UINT h; UINT h;
ClientToScreen(This->ddraw_window, &offset); ClientToScreen(((IWineD3DSwapChainImpl *)dst_swapchain)->win_handle, &offset);
GetClientRect(This->ddraw_window, &windowsize); GetClientRect(((IWineD3DSwapChainImpl *)dst_swapchain)->win_handle, &windowsize);
h = windowsize.bottom - windowsize.top; h = windowsize.bottom - windowsize.top;
dst_rect->x1 -= offset.x; dst_rect->x2 -=offset.x; dst_rect->x1 -= offset.x; dst_rect->x2 -=offset.x;
dst_rect->y1 = offset.y + h - dst_rect->y1; dst_rect->y1 = offset.y + h - dst_rect->y1;
...@@ -7397,21 +7394,21 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE ...@@ -7397,21 +7394,21 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
IWineD3DDevice_SetDisplayMode(iface, 0, &mode); IWineD3DDevice_SetDisplayMode(iface, 0, &mode);
if(This->ddraw_window && !pPresentationParameters->Windowed) { if(swapchain->win_handle && !pPresentationParameters->Windowed) {
if(swapchain->presentParms.Windowed) { if(swapchain->presentParms.Windowed) {
/* switch from windowed to fs */ /* switch from windowed to fs */
IWineD3DDeviceImpl_SetupFullscreenWindow(iface, This->ddraw_window, IWineD3DDeviceImpl_SetupFullscreenWindow(iface, swapchain->win_handle,
pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferWidth,
pPresentationParameters->BackBufferHeight); pPresentationParameters->BackBufferHeight);
} else { } else {
/* Fullscreen -> fullscreen mode change */ /* Fullscreen -> fullscreen mode change */
MoveWindow(This->ddraw_window, 0, 0, MoveWindow(swapchain->win_handle, 0, 0,
pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight, pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight,
TRUE); TRUE);
} }
} else if(This->ddraw_window && !swapchain->presentParms.Windowed) { } else if(swapchain->win_handle && !swapchain->presentParms.Windowed) {
/* Fullscreen -> windowed switch */ /* Fullscreen -> windowed switch */
IWineD3DDeviceImpl_RestoreWindow(iface, This->ddraw_window); IWineD3DDeviceImpl_RestoreWindow(iface, swapchain->win_handle);
} }
swapchain->presentParms.Windowed = pPresentationParameters->Windowed; swapchain->presentParms.Windowed = pPresentationParameters->Windowed;
} else if(!pPresentationParameters->Windowed) { } else if(!pPresentationParameters->Windowed) {
...@@ -7422,7 +7419,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE ...@@ -7422,7 +7419,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
*/ */
This->style = 0; This->style = 0;
This->exStyle = 0; This->exStyle = 0;
IWineD3DDeviceImpl_SetupFullscreenWindow(iface, This->ddraw_window, IWineD3DDeviceImpl_SetupFullscreenWindow(iface, swapchain->win_handle,
pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferWidth,
pPresentationParameters->BackBufferHeight); pPresentationParameters->BackBufferHeight);
This->style = style; This->style = style;
......
...@@ -3451,8 +3451,8 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * ...@@ -3451,8 +3451,8 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
RECT windowsize; RECT windowsize;
POINT offset = {0,0}; POINT offset = {0,0};
UINT h; UINT h;
ClientToScreen(myDevice->ddraw_window, &offset); ClientToScreen(dstSwapchain->win_handle, &offset);
GetClientRect(myDevice->ddraw_window, &windowsize); GetClientRect(dstSwapchain->win_handle, &windowsize);
h = windowsize.bottom - windowsize.top; h = windowsize.bottom - windowsize.top;
rect.x1 -= offset.x; rect.x2 -=offset.x; rect.x1 -= offset.x; rect.x2 -=offset.x;
rect.y1 -= offset.y; rect.y2 -=offset.y; rect.y1 -= offset.y; rect.y2 -=offset.y;
......
...@@ -93,7 +93,7 @@ void x11_copy_to_screen(IWineD3DSwapChainImpl *This, LPRECT rc) { ...@@ -93,7 +93,7 @@ void x11_copy_to_screen(IWineD3DSwapChainImpl *This, LPRECT rc) {
hSurfaceDC = front->hDC; hSurfaceDC = front->hDC;
hDisplayWnd = front->resource.wineD3DDevice->ddraw_window; hDisplayWnd = This->win_handle;
hDisplayDC = GetDCEx(hDisplayWnd, 0, DCX_CLIPSIBLINGS|DCX_CACHE); hDisplayDC = GetDCEx(hDisplayWnd, 0, DCX_CLIPSIBLINGS|DCX_CACHE);
if(rc) { if(rc) {
TRACE(" copying rect (%d,%d)->(%d,%d), offset (%d,%d)\n", TRACE(" copying rect (%d,%d)->(%d,%d), offset (%d,%d)\n",
......
...@@ -920,7 +920,6 @@ struct IWineD3DDeviceImpl ...@@ -920,7 +920,6 @@ struct IWineD3DDeviceImpl
BOOL softwareVertexProcessing; BOOL softwareVertexProcessing;
/* DirectDraw stuff */ /* DirectDraw stuff */
HWND ddraw_window;
DWORD ddraw_width, ddraw_height; DWORD ddraw_width, ddraw_height;
WINED3DFORMAT ddraw_format; WINED3DFORMAT ddraw_format;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment