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,11 +109,21 @@ SDL_BlitCopy(SDL_BlitInfo * info)
|
|||
overlap = (src < (dst + h*dstskip));
|
||||
}
|
||||
if (overlap) {
|
||||
if ( dst < src ) {
|
||||
while ( h-- ) {
|
||||
SDL_memmove(dst, src, w);
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue