Re: [AD] al_draw_polygon_with_holes, etc.

[ Thread Index | Date Index | More Archives ]

On 04/14/2013 09:45 AM, Peter Wang wrote:
How about:

   * al_draw_polygon_with_holes => al_draw_multiple_polygons
     The current name is just wrong.

I think it should just be removed, as it does indeed appear to simply draw multiple polygons (despite the obvious semantic difference brought up by Trent).

   * al_draw_filled_polygon_with_holes => al_draw_cutout_polygon
     I think you can't cut out a polygon unless it is filled,
     though it breaks the "filled" pattern.

The old name is pretty self-explanatory, even if a bit redundant. I certainly don't think "cutout" explains what it does...

Furthermore, wouldn't it be simpler to understand if the 'holes' array
is replaced by an array of the number of vertices in each respective
polygon?  This also affects al_triangulate_polygon.

The 'holes' array is a horrible name for what it represents (as it also contains the polygon outline). al_triangulate_polygon uses 'splits' which is marginally better. Also it is redundant with the 'vertex_count' attribute which will always equal the last entry in the 'holes' array.

I'd prefer for 'vertex_count' to be gone and 'holes' given a better name. Whether it contains relative (number of vertices per outline) or absolute (current behavior) doesn't matter to me much... the relative indexing semantic is more consistent with most of Allegro's API (e.g. creating sub bitmaps takes width and height, and not the bottom right corner), but the absolute indexing semantic is not without precedent either (al_draw_prim/rectangle/line ... my bad there for deviating from the rest of the API when I made those functions).

Is there a real need for the split_stride parameter to
al_triangulate_polygon?  I suggest to drop it.

Seems a bit excessive, yes.


Mail converted by MHonArc 2.6.19+