Commit 3bb1ea3d authored by Luis Javier Merino's avatar Luis Javier Merino Committed by Alexandre Julliard

wined3d: BltFast dealing correctly with overlapping src and dest.

parent 03f18eb4
......@@ -1613,13 +1613,28 @@ IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface,
else
{
int width = w * bpp;
INT sbufpitch, dbufpitch;
TRACE("NO color key copy\n");
/* Handle overlapping surfaces */
if (sbuf < dbuf)
{
sbuf += (h - 1) * slock.Pitch;
dbuf += (h - 1) * dlock.Pitch;
sbufpitch = -slock.Pitch;
dbufpitch = -dlock.Pitch;
}
else
{
sbufpitch = slock.Pitch;
dbufpitch = dlock.Pitch;
}
for (y = 0; y < h; y++)
{
/* This is pretty easy, a line for line memcpy */
memcpy(dbuf, sbuf, width);
sbuf += slock.Pitch;
dbuf += dlock.Pitch;
memmove(dbuf, sbuf, width);
sbuf += sbufpitch;
dbuf += dbufpitch;
}
TRACE("Copy done\n");
}
......
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