wined3d: Get rid of WINED3DRECT.
This commit is contained in:
parent
1bf25cfe3f
commit
4005eb2a18
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue