I think there’s an RLE bug in SDL with SDL_SetSurfaceRLE
.
Functions like SDL_LockSurface, and SDL_MUSTLOCK use surface->flags
. However SDL_SetSurfaceRLE
doesn’t update surface->flags
, only the internal surface->map->info.flags
.
SDL_SetSurfaceRLE(surf, SDL_TRUE);
assert (SDL_MUSTLOCK(surf)); // fails here, because SDL_MUSTLOCK(surf) should be true, but isn't.
Should SDL_SetSurfaceRLE
(and therefore its callers SDL_SetColorKey+SDL_ConvertSurface) call SDL_RLESurface(surface)? This would set up the surface->flags correctly.
I added a bug report here: https://bugzilla.libsdl.org/show_bug.cgi?id=5304