[SDL] Re: Re: 1.2 SDL_BlitSurface and colorkeying (long)
Mattias Engdegård
f91-men at nada.kth.se
Thu Jun 7 03:03:19 PDT 2001
>Okay, this is the bit that doesn't make sense to me. Why is SDL_SRCALPHA
>set if Amask != 0?
I think it was Sam who put it in so I'll let him answer. Anyway it's just
the default and you can change it later so I don't think it's a big deal.
The online docs now point this out
>In fact, why is SDL_SRCALPHA in the surface flags
>at all? It doesn't seem to be a property inherent to a surface,
>but rather a behaviour for SDL_BlitSurface. It seems like it would
>make more sense for SDL_SRCALPHA to be given in a "flags" argument to
>SDL_BlitSurface than being a surface property.
my opinion as well and one of many things I would like to change for
an API revision, but in 1.2 we're stuck with this
>Is this the officially sanctioned way of removing SDL_SRCALPHA while
>leaving the other flags alone?:
>
> SDL_SetAlpha(rgba, rgba->flags & SDL_RLEACCEL, 0);
make it
SDL_SetAlpha(rgba, rgba->flags & (SDL_RLEACCEL | SDL_RLEACCELOK), 0);
and it should work. This is another quirk: when you set SDL_RLEACCEL
(either by calling SetAlpha or SetColorKey), SDL_RLEACCEL isn't set at
once but just SDL_RLEACCELOK to mark the surface as RLE-able, and at
the next blit it will be RLE-coded and SDL_RLEACCEL will be set to
mark it as such
yes, this is another thing that should be cleaned up
More information about the SDL
mailing list