Commit 1bf36a3f authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Implement ddraw_surface7_BltFast() on top of wined3d_surface_blt().

parent 5193f670
...@@ -3700,6 +3700,8 @@ static HRESULT WINAPI ddraw_surface7_BltFast(IDirectDrawSurface7 *iface, DWORD d ...@@ -3700,6 +3700,8 @@ static HRESULT WINAPI ddraw_surface7_BltFast(IDirectDrawSurface7 *iface, DWORD d
IDirectDrawSurfaceImpl *src = unsafe_impl_from_IDirectDrawSurface7(Source); IDirectDrawSurfaceImpl *src = unsafe_impl_from_IDirectDrawSurface7(Source);
DWORD src_w, src_h, dst_w, dst_h; DWORD src_w, src_h, dst_w, dst_h;
HRESULT hr = DD_OK; HRESULT hr = DD_OK;
DWORD flags = 0;
RECT dst_rect;
TRACE("iface %p, dst_x %u, dst_y %u, src_surface %p, src_rect %s, flags %#x.\n", TRACE("iface %p, dst_x %u, dst_y %u, src_surface %p, src_rect %s, flags %#x.\n",
iface, dstx, dsty, Source, wine_dbgstr_rect(rsrc), trans); iface, dstx, dsty, Source, wine_dbgstr_rect(rsrc), trans);
...@@ -3728,17 +3730,24 @@ static HRESULT WINAPI ddraw_surface7_BltFast(IDirectDrawSurface7 *iface, DWORD d ...@@ -3728,17 +3730,24 @@ static HRESULT WINAPI ddraw_surface7_BltFast(IDirectDrawSurface7 *iface, DWORD d
return DDERR_INVALIDRECT; return DDERR_INVALIDRECT;
} }
SetRect(&dst_rect, dstx, dsty, dstx + src_w, dsty + src_h);
if (trans & DDBLTFAST_SRCCOLORKEY)
flags |= WINEDDBLT_KEYSRC;
if (trans & DDBLTFAST_DESTCOLORKEY)
flags |= WINEDDBLT_KEYDEST;
if (trans & DDBLTFAST_WAIT)
flags |= WINEDDBLT_WAIT;
if (trans & DDBLTFAST_DONOTWAIT)
flags |= WINEDDBLT_DONOTWAIT;
EnterCriticalSection(&ddraw_cs); EnterCriticalSection(&ddraw_cs);
if (src->surface_desc.ddsCaps.dwCaps & DDSCAPS_FRONTBUFFER) if (src->surface_desc.ddsCaps.dwCaps & DDSCAPS_FRONTBUFFER)
hr = ddraw_surface_update_frontbuffer(src, rsrc, TRUE); hr = ddraw_surface_update_frontbuffer(src, rsrc, TRUE);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
hr = wined3d_surface_bltfast(This->wined3d_surface, dstx, dsty, hr = wined3d_surface_blt(This->wined3d_surface, &dst_rect,
src->wined3d_surface, rsrc, trans); src->wined3d_surface, rsrc, flags, NULL, WINED3DTEXF_POINT);
if (SUCCEEDED(hr) && (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_FRONTBUFFER)) if (SUCCEEDED(hr) && (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_FRONTBUFFER))
{
RECT dst_rect = {dstx, dsty, dstx + src_w, dsty + src_h};
hr = ddraw_surface_update_frontbuffer(This, &dst_rect, FALSE); hr = ddraw_surface_update_frontbuffer(This, &dst_rect, FALSE);
}
LeaveCriticalSection(&ddraw_cs); LeaveCriticalSection(&ddraw_cs);
switch(hr) switch(hr)
{ {
......
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