Add a reversed flag to tessAddContour()
diff --git a/Include/tesselator.h b/Include/tesselator.h
index 38e05f1..6d4aa39 100755
--- a/Include/tesselator.h
+++ b/Include/tesselator.h
@@ -192,7 +192,7 @@
// pointer - pointer to the first coordinate of the first vertex in the array.
// stride - defines offset in bytes between consecutive vertices.
// count - number of vertices in contour.
-void tessAddContour( TESStesselator *tess, int size, const void* pointer, int stride, int count );
+void tessAddContour( TESStesselator *tess, int size, const void* pointer, int stride, int count, int reversed );
// tessSetOption() - Toggles optional tessellation parameters
// Parameters:
diff --git a/Source/tess.c b/Source/tess.c
index 8059bf4..ff1fb07 100755
--- a/Source/tess.c
+++ b/Source/tess.c
@@ -911,7 +911,7 @@
}
void tessAddContour( TESStesselator *tess, int size, const void* vertices,
- int stride, int numVertices )
+ int stride, int numVertices, int reversed )
{
const unsigned char *src = (const unsigned char*)vertices;
TESShalfEdge *e;
@@ -973,8 +973,8 @@
* vertices in such an order that a CCW contour will add +1 to
* the winding number of the region inside the contour.
*/
- e->winding = 1;
- e->Sym->winding = -1;
+ e->winding = (reversed) ? -1 : 1;
+ e->Sym->winding = (reversed) ? 1 : -1;
}
}