Re: [Super-tux-devel] LevelEditor Progress...
Brought to you by:
wkendrick
From: Tobias <tob...@gm...> - 2004-05-07 23:30:42
|
Sorry, it's not all that easy. Such a blitting method takes up to 300 lines of code, believe me. (Because you have to do it by hand, since SDL DOESN'T support it) Read it in the SDL documentation, if you don't believe me. ;) Alpha on Alpha surface blitting just doesn't work out of the box. http://sdldoc.csn.ul.ie/sdlsetalpha.php [quote] Note: Note that RGBA->RGBA blits (with SDL_SRCALPHA set) keep the alpha of the destination surface. This means that you cannot compose two arbitrary RGBA surfaces this way and get the result you would expect from "overlaying" them; the destination alpha will work as a mask. Also note that per-pixel and per-surface alpha cannot be combined; the per-pixel alpha is always used if available [/quote] Greetz... Tobias Gläßer Am Sa, den 08.05.2004 schrieb Ricardo Cruz um 1:07: > Anyway, it was working, couldn't we just port it again? It was working? No, it wasn't. And I'm quite sure here. > AFAIK, you just need to create another surface, blit the surface you want to > blit into the screen into this one, apply alpha to the temp surf and then > just blit the temp surf into the screen. It is nothing from another world :) > I have made the current code, and I dunno why it isn't working... > > In case it is too slow, we can allways get rid of it... > > And this code that can be found at draw_bg, draw_part or draw_stretched: > if(alpha != 255) > SDL_SetAlpha(sdl_surface ,SDL_SRCALPHA,alpha); > will make the surface to have that alpha forever. This code should be removed. > > Ricardo Cruz > > Em Sábado, 8 de Maio de 2004 00:03, o Tobias Gläßer escreveu: > > Am Sa, den 08.05.2004 schrieb Tobias Gläßer um 0:57: > > > Am Sa, den 08.05.2004 schrieb Ricardo Cruz um 0:03: > > > > Those are great news. > > > > There is only this issue that I think that should get priority: > > > > - the SDL frontend doesn't seem to support Alpha when blitting > > > > surfaces. i think this worked before... anyway, when looking at > > > > Background, for instance, the Foreground and Active stuff just > > > > dissapears... > > > > > > > > Ricardo Cruz > > > > > > Actually, as I stated in another mail, SDL software rendering isn't able > > > to do alpha on alpha surface blitting. :( > > > For the same reason the minimap is a OpenGL only feature, too. > > > > > > Greetz... > > > > > > Tobias Gläßer > > > > Before another one comes up with it now. Yes, you could write your > > own blitting method for this purpose. But on the on hand it's pretty > > tough to write it. (Or wouldn't the SDL folks provide it in their renderer, > > if it was easy to implement?) And on the other hand the resulting > > blitting method would be a very slow one. > > > > Can someone think of an alternative solution for the editor? > > > > Greetz... > > > > Tobias Gläßer > > > > -- |