[SDL] Question about RLEACCEL-Bug
Tim Schürmann
tischuer at web.de
Tue Jul 3 01:15:11 PDT 2007
Hi!
Thanks for the help and informations!
In fact, I'm doing collision detection, :) but due to several reasons I
would
like to avoid a seperate "collision-bitmap".
Anyway, at the moment blitting in "normal" mode is fast enough (the
framerate
without RLE is identical with the framerate with activated RLE
compression), but
I will keep the shadow-bitmap in mind.
Bye,
Tim
Torsten Giebl schrieb:
> > reading-operations. Should I avoid
> > RLEACCEL in this case too? (The game reacts now as it should :)).
>
> You should, as SDL cannot guess if
> you want read and/or write, so it always has
> to go the full circle.
[...]
David Olofson schrieb:
> If you only need to *read* pixels from the surface, you might get away
> with blitting from the surface to a "scratchpad" surface, and read
> from there. Even doing that for the full surface should be faster
> than lock/unlock with RLE, as you avoid the re-encode step - and if
> you can get away with reading only a few small rectangles, it should
> be pretty fast.
>
> Another trick is to keep a shadow surface; a plain, non-RLE copy of
> the "real", RLE encoded surface. Use the RLE accelerated surface for
> blitting, and the RGB shadow for reading.
>
> If you're doing pixel accurate collission detection, the standard
> solution is pretty much the same as the shadow surface version,
> except you use a bit map instead (one bit per pixel), to save some
> memory and/or speed things up a little further.
More information about the SDL
mailing list