[AD] RE: [AD] RE: [AD] RLE clipping speedup patch |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
> I looked at your patch again, and now I'm thinking it's
> _criminal_ to do
> without the lines array ;-) O(n) to find the first line...
:) I had this on the back burner for years, literally, but it
never showed up that much on my profiles, so I left it until
now. However, I don't have any ideas for speeding left clip
(other than a huge table which would basically be a BITMAP).
If you have any ... :)
> > (eg if building RLE sprites by hand for some reason) ?
>
> Does anyone do this?
You never know. I have custom versions of BITMAP structures,
for instance :) So I can "reallocate" them without reallocating
the memory, it just adds some memory in a different place and
redirects the lines ptr over the different chunks. Very fast
and handy when you don't know the height of the BITMAP you need
in the first place (like when you do an HTML renderer).
> AFAICS the code under the "Clip right." comments are still O(n).
> Am I missing something?
Hmm, it should read something like:
if (src->lines) {
s = src->lines[sybeg+y+1];
}
else {
/* scan */
}
So if lines is not NULL, it's O(1) now. Unless I've missed a case.
Unless you're talking about the asm version, which I did not change.
--
Vincent Penquerc'h
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |