Menu

#17 rotozoomSurfaceXY() adds color key flag to generated surfaces

v1.0 (example)
open
nobody
None
5
2023-12-11
2023-12-10
No

Hi,
the rotozoomSurfaceXY() function unconditionally sets the SDL_RLEACCEL and the SDL_SRCCOLORKEY flas on the returned surface, even if the source surface did not have either of them.

Internally, the function keeps a colorKeyAvailable flag which tells whether the source surface had a color key set, but for some reason it doesn't use it to decide whether the color key should be set on the new surface.

It may be that I have some bugs in the implementation of my SDL driver, where the presence of the SDL_SRCCOLORKEY generates some image corruption (part of the transparent pixels -- the input surfaces also have alpha -- become non-transparent) when I call SDL_DisplayFormatAlpha() on the returned surface, but, regardless of that, it doesn't look right that flags are added if the input surface didn't have them.

Please let me know if a patch is welcome.

Discussion

  • ferzkopp

    ferzkopp - 2023-12-10

    Yes, a patch is welcome. Please post here so it is public. I am not sure when I get around to apply it (as this is rather old code)

     
  • Alberto Mardegan

    Hi! Here it is :-)

     
  • ferzkopp

    ferzkopp - 2023-12-11

    Made a 2.0.27 release with this fix. Please check if that works for you.

     

    Last edit: ferzkopp 2023-12-11

Log in to post a comment.

MongoDB Logo MongoDB