Tiles . . . vs File Types

Thx David :wink:
(you make me remember Super Mario Bros …
Mario itself is composed of MANY tiles…
and the bricks too… and with many tiles,
it’s easy to fake a “brick explosion”)

but I wanna know something again :wink:

Did you know if using specefic files types
can alter your graphics performances ?
(I’m using SDL_Image to load somes .xpm (GIMP’s file)
with transparency included . . .)

And if I’ve understand, it’s better to not take
much transparency !? Just make it with more tiles
to avoid transparency ? (Way too slow if you want to
detect and mask pixel by pixel (for a transparency hole in the
middle of a tile ?? ).

I’ll have a lot of work to do this weekend ;))

And soon you’ll be able to go to our Internet site.
http://dawn.linux-site.net

(I’ll do that this weekend - Lynx compatible. :wink: )

I’ll try to put the “C++ squeletton” example.
(By the way, I don’t remember who propose me to send
his Makefile.am … It’ll help ;)) hEhe )

Thx!

/------\

| |—\

------/ | => What you do with this tile ?

   \------/

Did you liked my ASCII ART !?? HeHeh :wink:
Good day all :wink:

Thx David :wink:
(you make me remember Super Mario Bros …
Mario itself is composed of MANY tiles…
and the bricks too… and with many tiles,
it’s easy to fake a “brick explosion”)

but I wanna know something again :wink:

Did you know if using specefic files types
can alter your graphics performances ?
(I’m using SDL_Image to load somes .xpm (GIMP’s file)
with transparency included . . .)

Well, whatever you load becomes an SDL_Surface, so the only thing that
affects performance is the actual image, not the file format.

Now, images with alpha channels will of course result in RGBA surfaces,
that will have to be alpha blended to look right. Colorkeyed images (like
transparent GIF89a) will become colorkeyed SDL surfaces.

And if I’ve understand, it’s better to not take
much transparency !? Just make it with more tiles
to avoid transparency ? (Way too slow if you want to
detect and mask pixel by pixel (for a transparency hole in the
middle of a tile ?? ).

Actually, no, that’s not the case with SDL, if you do things right!

Use SDL_DisplayFormat() with the SDL_RLEACCEL flag, and your surfaces
will be run-length encoded - which means that transparent areas are
simply skipped. All colorkey testing is done when the surface is encoded,
so there’s virtually no overhead while blitting.

This applies to alpha as well; transparent runs are skipped, opaque runs
are just copied, rows of pixels with constant alpha are treated as runs
and 50% alpha runs are blitted using a faster special case blitter.

Using Kobo Deluxe as an example as usual; when using the scaling filters
(other resolutions than 320x240), all surfaces become 32 bit RGBA (as
the filtering plugins support only that format) before they eventually
get SDL_DisplayFormatAlphaed, with RLE acceleration.

Noticed the frame with the rounded corners around the game window? It’s a
single RGBA surface which covers the corners with opaque pixels, alpha
blends a soft, dark edge and some highlights in, and the leaves the
"playfield" area open, using fully transparent pixels. The RLE
acceleratio makes this cheaper than trying to chop the frame up into
smaller surfaces.

(The only reason to split the frame surface up would be that glSDL
doesn’t optimize transparent areas at all. But then again, your average
3D card will give you 200+ fps, despite the full window alpha blending
overhead… :slight_smile:

[…]

/------\

| |—\

------/ | => What you do with this tile ?

   \------/

Did you liked my ASCII ART !?? HeHeh :wink:

Well, it served it’s purpose - but the quoting code of my mail program
seems to dislike ASCII art in general, as you can see… heh (Vertical
bars seem to have some special meaning.)

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Friday 01 February 2002 14:49, Gerard wrote: