From: Martijn F. <fa...@ve...> - 2000-04-20 20:28:07
|
Eric Jacobs wrote: > > > > > Wow! Not only did that make the PNG and BMP times the same, it cut > > them by about 40%! Very nice. Thanks for your help. > > I second that wow! However, I'm having a little problem. Whenever I > call either convert() or convert_display(), the alpha channel seems > to be lost. This is coming off of PNGs. If I don't call the convert, > the blit is much slower, but the alpha is preserved. Any ideas? Browsing the SDL and PySDL documentation and the PySDL sources, I think you can use convert() and pass sdl.SRCALPHA as the second (flag) argument. For convert_display() the situation is a bit more tricky; the SDL_DisplayFormat (used internally by PySDL) documentation says that: If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and alpha value before calling this function. But presumably these would already be set in your PNG image, as you say that without conversion the alpha blitting is being preserved, right? So that would indicate a bug somewhere. I browsed a bit through PySDL but I couldn't find any bug there (doesn't mean it isn't there, of course :). So that could indicate an SDL bug. Could you do some more testing? Also there doesn't seem to be any obvious SDL function to use to indicate that a surface should use alpha blitting, except during surface creation. Perhaps the documentation means you should go poke in the structure directly, then? (but there isn't any obvious structure member to manipulate, either). Hmm. Regards, Martijn |