Remove a workaround for pre-SDL2.0.5 bug in SDL_BlitSurface()

display::scroll() method has a workaround for a bug in
SDL_BlitSurface(). This SDL2 functions was not working correctly
with overlapping source and destination surfaces.

The bug has been fixed in SDL2.0.5 by this commit:
aae28e3ec1

This workaround is not required after SDL2 version bump to 2.0.8.
This commit is contained in:
Grzegorz Halat 2021-04-26 20:29:53 +02:00 committed by Iris Morelle
parent 452ebd01af
commit 70d8df7c9e

View file

@ -1965,12 +1965,9 @@ bool display::scroll(int xmove, int ymove, bool force)
srcrect.x -= diff_x;
srcrect.y -= diff_y;
// This is a workaround for a SDL2 bug when blitting on overlapping surfaces. The bug
// only strikes during scrolling, but will then duplicate textures across the entire map.
surface screen_copy = screen.clone();
SDL_SetSurfaceBlendMode(screen_copy, SDL_BLENDMODE_NONE);
SDL_BlitSurface(screen_copy, &srcrect, screen, &dstrect);
SDL_SetSurfaceBlendMode(screen, SDL_BLENDMODE_NONE);
SDL_BlitSurface(screen, &srcrect, screen, &dstrect);
SDL_SetSurfaceBlendMode(screen, SDL_BLENDMODE_BLEND);
}
if(diff_y != 0) {