Unfortunately, the current stable release version 2.0.12 of the SDL
library used by R'n'D has a critical bug that causes all transparent
images in R'n'D to be opaque, which hurts the game graphics at various
places.
The cause of this bug is in SDL_ConvertSurface(), which does not copy
the color key anymore.
The bug is documented in the SDL bug tracking system as follows:
https://bugzilla.libsdl.org/show_bug.cgi?id=2979
The bug will be fixed in the next stable release of the SDL library.
This workaround checks if a converted surface should have a color key,
and explicitly sets it if it is missing in the newly created surface.
if (new_surface == NULL)
Error(ERR_EXIT, "SDL_ConvertSurface() failed: %s", SDL_GetError());
+ // workaround for a bug in SDL 2.0.12 (which does not convert the color key)
+ if (SDLHasColorKey(surface) && !SDLHasColorKey(new_surface))
+ SDL_SetColorKey(new_surface, SET_TRANSPARENT_PIXEL,
+ SDLGetColorKey(surface));
+
return new_surface;
}