mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 14:43:20 +00:00
Lazily redo RLE encoding
Also stop lying about the RLE encoding state, which causes crashes if we do RLE blit operations while the surface is locked.
This commit is contained in:
parent
cc2a272d6f
commit
089dc86bcf
1 changed files with 1 additions and 10 deletions
|
|
@ -1726,8 +1726,7 @@ bool SDL_LockSurface(SDL_Surface *surface)
|
|||
// Perform the lock
|
||||
if (surface->internal_flags & SDL_INTERNAL_SURFACE_RLEACCEL) {
|
||||
SDL_UnRLESurface(surface);
|
||||
surface->internal_flags |= SDL_INTERNAL_SURFACE_RLEACCEL; // save accel'd state
|
||||
SDL_UpdateSurfaceLockFlag(surface);
|
||||
surface->flags |= SDL_SURFACE_LOCK_NEEDED;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -1754,14 +1753,6 @@ void SDL_UnlockSurface(SDL_Surface *surface)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef SDL_HAVE_RLE
|
||||
// Update RLE encoded surface with new data
|
||||
if (surface->internal_flags & SDL_INTERNAL_SURFACE_RLEACCEL) {
|
||||
surface->internal_flags &= ~SDL_INTERNAL_SURFACE_RLEACCEL; // stop lying
|
||||
SDL_RLESurface(surface);
|
||||
}
|
||||
#endif
|
||||
|
||||
surface->flags &= ~SDL_SURFACE_LOCKED;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue