+void GlyphPoints::InvertPolyDrawSequence(const uint16 poly)
+{
+ if (poly >= numPolys)
+ throw GP_OUT_OF_RANGE;
+
+ uint16 pointNum1 = GetPolyStart(poly);
+ uint16 pointNum2 = GetPolyEnd(poly);
+
+ // Algorithm: Step through points in the polygon, swapping 1st and last, then
+ // 2nd and (last - 1), 3rd and (last - 2), etc. We only do this for half the
+ // points, as doing it for all would undo the swapping we did in the 1st half.
+ for(uint16 i=0; i<GetNumPoints(poly)/2; i++)
+ {
+ IPoint point1 = GetPoint(pointNum1 + i);
+ IPoint point2 = GetPoint(pointNum2 - i);
+ SetPoint(pointNum2 - i, point1);
+ SetPoint(pointNum1 + i, point2);
+ }
+}
+
+