mirror of https://github.com/encounter/SDL.git
Fixed bug 3096 - SDL_BlitSurface with overlapping source and destination
This commit is contained in:
parent
564c790f33
commit
aae28e3ec1
|
@ -109,10 +109,20 @@ SDL_BlitCopy(SDL_BlitInfo * info)
|
||||||
overlap = (src < (dst + h*dstskip));
|
overlap = (src < (dst + h*dstskip));
|
||||||
}
|
}
|
||||||
if (overlap) {
|
if (overlap) {
|
||||||
while (h--) {
|
if ( dst < src ) {
|
||||||
SDL_memmove(dst, src, w);
|
while ( h-- ) {
|
||||||
src += srcskip;
|
SDL_memmove(dst, src, w);
|
||||||
dst += dstskip;
|
src += srcskip;
|
||||||
|
dst += dstskip;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
src += ((h-1) * srcskip);
|
||||||
|
dst += ((h-1) * dstskip);
|
||||||
|
while ( h-- ) {
|
||||||
|
SDL_memmove(dst, src, w);
|
||||||
|
src -= srcskip;
|
||||||
|
dst -= dstskip;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue