[SDL] Truetype vs bitmapped fonts? Opinions?
johns98 at gmx.net
Wed Apr 12 10:12:06 PDT 2000
Mattias Engdegård wrote:
> >> Even with a separate paint_clipped_sprite()?
> >Mmmm, no. :)
> >Hmm, want to improve SDL_RLEaccel.c? :)
> If I get some time, I might :-) But I'd have to do some extensive timing
> to make sure it's worth it.
> Also I observed that SDL interleaves pixel data and opcodes in the same byte
> stream. In my code I put the opcodes in a separate sequence, so that the
> pixel data will always be aligned. It probably eats another register when
> decoding, but I figured the raw data copy would be faster. I need to do more
> timing I guess :-)
I think there are many ways todo RL encoded sprites.
I use no opcodes. I store only lengths:
[SKIP-LENGTH] [COPY-LENGHT] [DATA...] [SKIP-LENGTH] [COPY-LENGHT] [DATA...]
It saves the space and the test of the opcodes.
If you have more then 255 bytes of transparent just make an empty copy area.
The pixels data is always aligned. But an extra test is needed to detect the
end of line.
It would be nice to see more ideas or implementations.
Become famous, earn no money, create graphics for FreeCraft.
http://FreeCraft.Org - A free fantasy real-time strategy game engine
http://fgp.cjb.net - The FreeCraft Graphics Project
More information about the SDL