Re: [Super-tux-devel] LevelEditor Progress...
Brought to you by:
wkendrick
From: Ricardo C. <ri...@ae...> - 2004-05-08 10:28:19
|
Oh, all my stuff make use of colorkey, instead of images with alpha, so I'= ve=20 never noticed that... One solution would be to transform alpha from all our images into a specif= ic=20 color. It would be pretty trivial, we just needed to make program for that= =20 propose. Anyway, I don't think this was ideal... Maybe this would work; make a temp surface (without an alpha mask), fill i= t=20 with a specific color, make that color as colorkey, blit the surface into t= he=20 temp one, apply alpha to the temp and blit it into the screen. Do you think this would work? Anyway, maybe we could get that code from somewhere... Wouldn't be pretty = if=20 it would be slow :( Ricardo Cruz Em S=C3=A1bado, 8 de Maio de 2004 00:34, o Tobias Gl=C3=A4=C3=9Fer escreveu: > 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=C3=A4=C3=9Fer > > 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_stretche= d: > > if(alpha !=3D 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=C3=A1bado, 8 de Maio de 2004 00:03, o Tobias Gl=C3=A4=C3=9Fer escr= eveu: > > > Am Sa, den 08.05.2004 schrieb Tobias Gl=C3=A4=C3=9Fer 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=C3=A4=C3=9Fer > > > > > > 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=C3=A4=C3=9Fer =2D-=20 "Data is a lot like humans: It is born. Matures. Gets married to other=20 data, divorced. Gets old. One thing that it doesn't do is die. It has to be=20 killed." =2D- Arthur Miller |