Re: [AD] al_draw_tinted_rotated_scaled_bitmap

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


On Sat, 2010-08-14 at 18:41 +0200, Elias Pschernig wrote:
> Um, why is the order of parameters in
> al_draw_tinted_rotated_scaled_bitmap not first rotation and then scale
> parameters, as in the function name? I suggest we rename it to
> al_draw_tinted_scaled_rotated_bitmap so the name matches the parameters
> (better than just fixing the parameter order as you wouldn't notice the
> change in existing code).

Ok, committed that, it just must have been an unfortunate typo/word
swap.

> I also think we should have a function
> 
> void al_draw_tinted_scaled_rotated_bitmap_region(ALLEGRO_BITMAP *bitmap,
>    ALLEGRO_COLOR tint, float cx, float cy,
>    float xscale, float yscale, float angle,
>    float sx, float sy, float sw, float sh, float dx, float dy,
>    int flags)
> 
> It's the only one missing from all the various combinations we already
> have and there's no reason to allow all possibilities but force the use
> of transformations for just this one.

On the other hand, that function somehow has too many parameters. Also,
it's not clear if the cx/cy is relative to the region or whole bitmap.
So not sure what to do. I think I could live with just leaving it out
and require the use of transformations.


Also, I found another inconsistency:

void al_draw_scaled_bitmap(ALLEGRO_BITMAP *bitmap,
   float sx, float sy, float sw, float sh,
   float dx, float dy, float dw, float dh, int flags)

Why does this not use xscale/yscale parameters like the other functions?
The way the parameters are I think we should rename this to
al_draw_scaled_bitmap_region al_draw_stretched_bitmap_region. I prefer
the latter name to make clear that it does *not* use scaling factors
like the other _scaled_ variants. And the _region because this actually
draws a region of the bitmap (like al_draw_bitmap_region) and *not* the
whole bitmap like all the other bitmap drawing functions.

-- 
Elias Pschernig <elias.pschernig@xxxxxxxxxx>





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