Henri Verbeet : wined3d: Get rid of WINED3DRECT.
Alexandre Julliard
julliard at winehq.org
Tue Aug 31 11:15:54 CDT 2010
Module: wine
Branch: master
Commit: 4005eb2a18e93d61b1bb3ea3d258e58078921f2c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4005eb2a18e93d61b1bb3ea3d258e58078921f2c
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Mon Aug 30 20:29:47 2010 +0200
wined3d: Get rid of WINED3DRECT.
---
dlls/d3d8/device.c | 3 +--
dlls/d3d9/device.c | 5 ++---
dlls/ddraw/device.c | 3 +--
dlls/wined3d/device.c | 25 ++++++++++++-------------
dlls/wined3d/surface.c | 2 +-
include/wine/wined3d.idl | 12 ++----------
6 files changed, 19 insertions(+), 31 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index f889564..cafe27d 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -1069,9 +1069,8 @@ static HRESULT WINAPI IDirect3DDevice8Impl_Clear(LPDIRECT3DDEVICE8 iface, DWORD
TRACE("iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %u.\n",
iface, Count, pRects, Flags, Color, Z, Stencil);
- /* Note: D3DRECT is compatible with WINED3DRECT */
wined3d_mutex_lock();
- hr = IWineD3DDevice_Clear(This->WineD3DDevice, Count, (CONST WINED3DRECT*) pRects, Flags, Color, Z, Stencil);
+ hr = IWineD3DDevice_Clear(This->WineD3DDevice, Count, (const RECT *)pRects, Flags, Color, Z, Stencil);
wined3d_mutex_unlock();
return hr;
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index f5bcbaa..6b66bb2 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -1044,8 +1044,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(IDirect3DDevice9Ex *iface,
}
/* Colorfill can only be used on rendertarget surfaces, or offscreen plain surfaces in D3DPOOL_DEFAULT */
- /* Note: D3DRECT is compatible with WINED3DRECT */
- hr = IWineD3DDevice_ColorFill(This->WineD3DDevice, surface->wineD3DSurface, (const WINED3DRECT *)pRect, &c);
+ hr = IWineD3DDevice_ColorFill(This->WineD3DDevice, surface->wineD3DSurface, pRect, &c);
wined3d_mutex_unlock();
@@ -1214,7 +1213,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_Clear(LPDIRECT3DDEVICE9EX iface, DW
/* Note: D3DRECT is compatible with WINED3DRECT */
wined3d_mutex_lock();
- hr = IWineD3DDevice_Clear(This->WineD3DDevice, Count, (CONST WINED3DRECT*) pRects, Flags, Color, Z, Stencil);
+ hr = IWineD3DDevice_Clear(This->WineD3DDevice, Count, (const RECT *)pRects, Flags, Color, Z, Stencil);
wined3d_mutex_unlock();
return hr;
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 4677f6e..7837dcd 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -5220,9 +5220,8 @@ IDirect3DDeviceImpl_7_Clear(IDirect3DDevice7 *iface,
TRACE("iface %p, count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %#x.\n",
iface, Count, Rects, Flags, Color, Z, Stencil);
- /* Note; D3DRECT is compatible with WINED3DRECT */
EnterCriticalSection(&ddraw_cs);
- hr = IWineD3DDevice_Clear(This->wineD3DDevice, Count, (WINED3DRECT*) Rects, Flags, Color, Z, Stencil);
+ hr = IWineD3DDevice_Clear(This->wineD3DDevice, Count, (RECT *)Rects, Flags, Color, Z, Stencil);
LeaveCriticalSection(&ddraw_cs);
return hr;
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index a90ad80..9b4965d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4576,28 +4576,27 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Present(IWineD3DDevice *iface,
return WINED3D_OK;
}
-static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Count,
- const WINED3DRECT *pRects, DWORD Flags, WINED3DCOLOR color, float Z, DWORD Stencil)
+static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD rect_count,
+ const RECT *rects, DWORD flags, WINED3DCOLOR color, float depth, DWORD stencil)
{
const WINED3DCOLORVALUE c = {D3DCOLOR_R(color), D3DCOLOR_G(color), D3DCOLOR_B(color), D3DCOLOR_A(color)};
- IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
+ IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface;
RECT draw_rect;
- TRACE("(%p) Count (%d), pRects (%p), Flags (%x), color (0x%08x), Z (%f), Stencil (%d)\n", This,
- Count, pRects, Flags, color, Z, Stencil);
+ TRACE("iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, depth %.8e, stencil %u.\n",
+ iface, rect_count, rects, flags, color, depth, stencil);
- if (Flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL) && !This->depth_stencil)
+ if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL) && !device->depth_stencil)
{
WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n");
/* TODO: What about depth stencil buffers without stencil bits? */
return WINED3DERR_INVALIDCALL;
}
- device_get_draw_rect(This, &draw_rect);
+ device_get_draw_rect(device, &draw_rect);
- return device_clear_render_targets(This, This->adapter->gl_info.limits.buffers,
- This->render_targets, Count, (const RECT *)pRects, &draw_rect, Flags,
- &c, Z, Stencil);
+ return device_clear_render_targets(device, device->adapter->gl_info.limits.buffers,
+ device->render_targets, rect_count, rects, &draw_rect, flags, &c, depth, stencil);
}
/*****
@@ -5497,12 +5496,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DeletePatch(IWineD3DDevice *iface, UINT
}
static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface,
- IWineD3DSurface *surface, const WINED3DRECT *pRect, const WINED3DCOLORVALUE *color)
+ IWineD3DSurface *surface, const RECT *rect, const WINED3DCOLORVALUE *color)
{
IWineD3DSurfaceImpl *s = (IWineD3DSurfaceImpl *)surface;
TRACE("iface %p, surface %p, rect %s, color {%.8e, %.8e, %.8e, %.8e}.\n",
- iface, surface, wine_dbgstr_rect((const RECT *)pRect),
+ iface, surface, wine_dbgstr_rect(rect),
color->r, color->g, color->b, color->a);
if (s->resource.pool != WINED3DPOOL_DEFAULT && s->resource.pool != WINED3DPOOL_SYSTEMMEM)
@@ -5511,7 +5510,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface,
return WINED3DERR_INVALIDCALL;
}
- return surface_color_fill(s, (const RECT *)pRect, color);
+ return surface_color_fill(s, rect, color);
}
static void WINAPI IWineD3DDeviceImpl_ClearRendertargetView(IWineD3DDevice *iface,
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 0731fb8..1cc5dbd 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3790,7 +3790,7 @@ static HRESULT IWineD3DSurfaceImpl_BltZ(IWineD3DSurfaceImpl *This, const RECT *D
ERR("Unexpected format for depth fill: %s.\n", debug_d3dformat(This->resource.format_desc->id));
}
- return IWineD3DDevice_Clear((IWineD3DDevice *)device, DestRect ? 1 : 0, (const WINED3DRECT *)DestRect,
+ return IWineD3DDevice_Clear((IWineD3DDevice *)device, DestRect ? 1 : 0, DestRect,
WINED3DCLEAR_ZBUFFER, 0x00000000, depth, 0x00000000);
}
diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl
index 62810db..7f88b3a 100644
--- a/include/wine/wined3d.idl
+++ b/include/wine/wined3d.idl
@@ -1573,14 +1573,6 @@ typedef struct _WINED3DMATRIX
} DUMMYUNIONNAME;
} WINED3DMATRIX;
-typedef struct _WINED3DRECT
-{
- LONG x1;
- LONG y1;
- LONG x2;
- LONG y2;
-} WINED3DRECT;
-
typedef struct _WINED3DLIGHT
{
WINED3DLIGHTTYPE Type;
@@ -3305,7 +3297,7 @@ interface IWineD3DDevice : IWineD3DBase
);
HRESULT Clear(
[in] DWORD rect_count,
- [in] const WINED3DRECT *rects,
+ [in] const RECT *rects,
[in] DWORD flags,
[in] WINED3DCOLOR color,
[in] float z,
@@ -3367,7 +3359,7 @@ interface IWineD3DDevice : IWineD3DBase
);
HRESULT ColorFill(
[in] IWineD3DSurface *surface,
- [in] const WINED3DRECT *rect,
+ [in] const RECT *rect,
[in] const WINED3DCOLORVALUE *color
);
HRESULT UpdateTexture(
More information about the wine-cvs
mailing list