Stefan Dösinger : wined3d: Use the proper drawable size when clearing.
Alexandre Julliard
julliard at winehq.org
Tue Dec 4 13:25:20 CST 2007
Module: wine
Branch: master
Commit: 1ac109e5a02551bb739a23385c6c27edabec7efc
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1ac109e5a02551bb739a23385c6c27edabec7efc
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Sat Dec 1 15:52:08 2007 +0100
wined3d: Use the proper drawable size when clearing.
---
dlls/wined3d/device.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index b0e8dc4..1e53bcc 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4789,6 +4789,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Coun
WINED3DRECT curRect;
RECT vp_rect;
WINED3DVIEWPORT *vp = &This->stateBlock->viewport;
+ UINT drawable_width, drawable_height;
TRACE("(%p) Count (%d), pRects (%p), Flags (%x), Color (0x%08x), Z (%f), Stencil (%d)\n", This,
Count, pRects, Flags, Color, Z, Stencil);
@@ -4826,6 +4827,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Coun
}
}
+ target->get_drawable_size(target, &drawable_width, &drawable_height);
+
/* This is for offscreen rendering as well as for multithreading, thus activate the set render target
* and not the last active one.
*/
@@ -4873,7 +4876,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Coun
This->stateBlock->viewport.Height);
} else {
glScissor(This->stateBlock->viewport.X,
- (((IWineD3DSurfaceImpl *)This->render_targets[0])->currentDesc.Height -
+ (drawable_height -
(This->stateBlock->viewport.Y + This->stateBlock->viewport.Height)),
This->stateBlock->viewport.Width,
This->stateBlock->viewport.Height);
@@ -4912,7 +4915,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Coun
glScissor(curRect.x1, curRect.y1,
curRect.x2 - curRect.x1, curRect.y2 - curRect.y1);
} else {
- glScissor(curRect.x1, target->currentDesc.Height - curRect.y2,
+ glScissor(curRect.x1, drawable_height - curRect.y2,
curRect.x2 - curRect.x1, curRect.y2 - curRect.y1);
}
checkGLcall("glScissor");
More information about the wine-cvs
mailing list