Re: [AD] C/Asm integration (was [AD] Improvement on alphablending...) |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Sun, Aug 05, 2001 at 08:27:45PM -0400, Bob wrote:
> George Foot wrote:
> > But as I said I might be misunderstanding -- I'm not really sure
> > what these blenders are. Are they user-supplied?
>
> No, but they could be.
> Allegro comes with a few blenders, which are awefully slow. The idea
> is to be able to work with full lines of pixels at a time, instread of
> just 1 pixel at a time. This would greatly reduce the overhead of
> function calls in the blender, and also allow working with several
> pixels at a time to speed up computations.
> I wanted to open the API up so users can use their own custom line
> blenders, as well as provide backward compatibility support for pixel
> based blenders (yb using a dummy blender which calls back the pixel
> blender for every pixel). I'm not sure that's entirely doable now.
I think it's doable. Your setup code before calling the line
blenders has to copy the source into a malloced block if it's
not already in the data segment, and bmp_select the dest bitmap.
Then C blenders read direct from the source buffer using
pointers, and read/write the dest using bmp_writenn etc, and asm
blenders read direct from the source buffer but read/write the
dest in the FS segment (I think). For non-djgpp compilers we
need bmp_select to actually set FS to ES, which doesn't happen
at the moment.
George