Re: [AD] Renamed API second draft

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Sven Sandberg wrote:

[snip]

Most operations (except draw_sprite()) can't be implemented efficiently
on cmp/rle. We are not talking about slow as in e.g. "reading from video
memory", but about slow as in "depending on the width of the bitmap". So
getpixel()/putpixel() can't even be done in constant time on cmp/rle.
This is because of fundamental properties of the representation that
can't be overcome.


Yes, however if the rle/cmp sprites keep a non-rle/cmp bitmap around, these operations can still be done mostly quickly.

Therefore, there are two kinds of users who will draw
onto compiled or rle sprites: Users for which it actually makes sense
and clueless users who think it makes sense but in fact it just slows
their program down. I think it is very rare to have a situation where it
is actually useful to draw onto cmp/rle, given that it is so slow.
Meanwhile, in those very rare cases, it is trivial to blit the cmp/rle
to a temporary bitmap, do your operations on it and convert back to
cmp/rle. Doing this conversion also makes it visible to the person
reading the code how slow the operation actually is, rather than hiding
it under an innocent-looking putpixel() call.


And I agree completely. Hmm, guess I should re-evaluate this.
Perhaps simply merge all the sprite types into SPRITE? But then, what do we do about trans rle drawing?



--
- Robert J Ohannessian
"Microsoft code is probably O(n^20)" (my CS prof)
http://pages.infinit.net/voidstar/



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/