Re: [AD] blender operations SRC and DST |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2011-06-08, Jon Rafkind <workmin@xxxxxxxxxx> wrote:
> On 06/08/2011 07:26 PM, Peter Wang wrote:
> >
> > Obviously we should be specialising the current default blender mode
> > as well. Can you make that as a separate change first? Then your
> > patch should be okay (with style/docs fixups).
> >
> Ok sure I can make _al_blend_add_alpha_inversealpha_inline or something
> but that would be a new blender.
That shouldn't be necessary.
> That is I don't think there is a
> blender optimized for ADD/ALPHA/INVERSE, all the calls from
> scanline_drawers.c were just calling al_blend_inline.
>
> It looks like scanline_drawers.c only calls either ADD/ALPHA/INVERSE and
> ADD/ONE/ONE, so maybe I should make both specialized blenders?
I just meant add another case to make_scanline_drawers.py, which calls
_al_blend_alpha_inline for hardcoded values of ADD/ALPHA/INVERSE. The
compiler will hopefully evaluate the switches in _al_blend_alpha_inline
at compile time and eliminate the unused cases. I can make the change
later if you don't do it first.
> (BTW, when I ran make_scanline_drawers.py the indentation got all messed
> up, at least the generated file didn't look like src/scanline_drawers.c.
> Was scanline_drawers.c manually fixed up after generation? In my own
> python-generating-c++ things I tend to have an indent() function that
> takes care of this stuff, I can try to add it to
> make_scanline_drawers.py if you like..)
See the comment at the top of make_scanline_drawers.py.
This way the generator is not cluttered up with style issues.
Peter