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:
parent
452ebd01af
commit
70d8df7c9e
1 changed files with 3 additions and 6 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue