trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
|
Re: Re: Re: Creature and object shadows (0)
Schik wrote:
I assume libSDL supports PNG files completely? I'm too lazy to check. Would we have to change what blits we're calling to alpha-aware blits? Or do they all use alpha if it's there?
ErikH2000 wrote:
I would be happy to switch over to PNG. I don't believe SDL supports the format by itself, but there's code out there that will easily do it ("SDL_Image" comes to mind).
Right. SDL itself doesn't support loading PNG directly like BMP, so we'll have to use another library for that. SDL_image works fine and is made ready for use with SDL, or we could simply use libpng directly if that's the only format it'll use - SDL_image would be an extra library requirement, and it would require libpng anyway, but it's nice for supporting a larger range of formats. Up to you
I've found that alpha blits can be pretty slow on low-end computers like mine (333mhz, an unspecial video card), so I think there are some tricks that should be used. But that can be looked at later. It would be simpler to just load in a bunch RGBA surfaces and perform SDL blits with the alpha option, but this makes things much slower.
Is this with RLE acceleration enabled ? That can boost things up considerably.
StuartK wrote:
Just to make clear (hopefully, if it isn't already) this topic was intended for a seperate issue to the wall/object shadows. In this case, certain creatures and objects have a flag colour which is used to indicate that a 'shadow' is there, at that individual pixel position. When a non-floor square is underneath it does not blend correctly with the shadow (e.g. instead of shadowed tar, or shadowed wall, we always get shadowed floor)
Sorry, i didn't mean to hijack your topic. But, if the shadow tiles are converted to PNG (or anything else with an alpha channel, really), this problem would magically go away
- Gerry
|