Thread: [Super-tux-devel] LevelEditor Progress...
Brought to you by:
wkendrick
From: Tobias <tob...@gm...> - 2004-05-07 20:52:40
|
Heeeya, I just commited major internal changes to the editor. It makes use of the World-class now, which solves several problems at once. The object automatic badguy repositioning (if it lands in a wall) for example is working now and the leveleditor can be started from command-line. Some things are for sure broken currently. I'm going to fix em and then this should be release ready. What do you think? Greetz... Tobias Gläßer -- |
From: Ricardo C. <ri...@ae...> - 2004-05-07 22:16:42
|
Those are great news. There is only this issue that I think that should get priority: =2D the SDL frontend doesn't seem to support Alpha when blitting surfaces. = i=20 think this worked before... anyway, when looking at Background, for instanc= e,=20 the Foreground and Active stuff just dissapears... Ricardo Cruz Em Sexta, 7 de Maio de 2004 21:56, o Tobias Gl=C3=A4=C3=9Fer escreveu: > Heeeya, > > I just commited major internal changes to the editor. It > makes use of the World-class now, which solves several problems > at once. The object automatic badguy repositioning (if it lands > in a wall) for example is working now and the leveleditor > can be started from command-line. > > Some things are for sure broken currently. I'm going to > fix em and then this should be release ready. What do you think? > > Greetz... > > Tobias Gl=C3=A4=C3=9Fer =2D-=20 Leave no stone unturned. -- Euripides |
From: Tobias <tob...@gm...> - 2004-05-07 22:52:54
|
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 |
From: Tobias <tob...@gm...> - 2004-05-07 22:59:30
|
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 |
From: Ricardo C. <ri...@ae...> - 2004-05-07 23:20:04
|
Anyway, it was working, couldn't we just port it again? AFAIK, you just need to create another surface, blit the surface you want = to=20 blit into the screen into this one, apply alpha to the temp surf and then=20 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 !=3D 255) SDL_SetAlpha(sdl_surface ,SDL_SRCALPHA,alpha); will make the surface to have that alpha forever. This code should be remov= ed. Ricardo Cruz Em S=C3=A1bado, 8 de Maio de 2004 00:03, o Tobias Gl=C3=A4=C3=9Fer escreveu: > 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 rendere= r, > 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 The intelligence of any discussion diminishes with the square of the number of participants. -- Adam Walinsky |
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 > > > > -- |
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 |
From: Ricardo C. <ri...@ae...> - 2004-05-09 01:19:16
|
Well, I've just tried my idea... and guess what... It worked :D It looks like we don't need the 300 lines afterall ;) I'll extend that support for the others draw_part() and alike functions. But it seems to have this problem; when an image has an alpha value betwee= n 0=20 and 255, the colorkey also gets with alpha in that pixel and therefore it=20 blits that pixel into the screen. Not sure how this will be solved, anyway= =20 this is really a small issue (at least for now...). Just one thing, regarding the level editor, I think that bad guys (and eve= n=20 Tux) should get semi-transparent when Foreground and Background is selected= =2E=20 It shouldn't be also possible to apply them then. Ricardo Cruz Em S=C3=A1bado, 8 de Maio de 2004 00:07, o Ricardo Cruz escreveu: > Anyway, it was working, couldn't we just port it again? > > 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 !=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 escrev= eu: > > 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 "Yo baby yo baby yo." =2D- Eddie Murphy |