X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fglyphpoints.cpp;h=856b85964e5d1c5764f1d7020d6fa0cc9baa9e0c;hb=3fe885b75511c9fbfe18a5c509260e83bb7ac136;hp=0b0575253914002506c9186279f2b0a2c37a9d1b;hpb=0c01fa32c7e0629ae61992e0419f03724fc18487;p=ttedit diff --git a/src/glyphpoints.cpp b/src/glyphpoints.cpp old mode 100755 new mode 100644 index 0b05752..856b859 --- a/src/glyphpoints.cpp +++ b/src/glyphpoints.cpp @@ -10,7 +10,7 @@ // JLH = James L. Hammons // // Who When What -// --- ---------- ------------------------------------------------------------ +// --- ---------- ----------------------------------------------------------- // JLH ??/??/200? Created this file // JLH 05/18/2004 Added pure point adding, inserting, better polygon handling // @@ -74,19 +74,6 @@ WriteLogMsg("GlyphPoints: Copy constructor. %u points, %u polys.\n", numPoints, GlyphPoints::~GlyphPoints() { FreeAllocatedMemory(); -#if 0 - if (x) - delete[] x; - - if (y) - delete[] y; - - if (onCurve) - delete[] onCurve; - - if (polyEnd) - delete[] polyEnd; -#endif } @@ -247,6 +234,7 @@ void GlyphPoints::Clear(void) void GlyphPoints::InsertPoint(uint16_t pt, int xx, int yy, bool oc) { +//wouldn't it be better to treat this case as inserting at the end? if (pt > numPoints) // > because we can insert at end...! throw GP_OUT_OF_RANGE; @@ -267,7 +255,6 @@ void GlyphPoints::InsertPoint(uint16_t pt, int xx, int yy, bool oc) //we're adding to the end of the structure: [DONE, below] int polyInsert = (pt == numPoints ? numPolys - 1 : GetPoly(pt)); for(int i=polyInsert; i= numPoints) +#ifdef DEBUG +{ +WriteLogMsg("Exception: GetXY(uint16_t). pt=%u, numPoints=%u\xD\xA", pt, numPoints); +#endif + throw GP_OUT_OF_RANGE; +#ifdef DEBUG +} +#endif + + return Vector(x[pt], y[pt]); +} + + bool GlyphPoints::GetOnCurve(uint16_t pt) { if (pt >= numPoints) @@ -735,7 +738,7 @@ IPoint GlyphPoints::GetPrevPoint(uint16_t poly, uint16_t pt) { uint16_t prevPt = GetPrev(poly, pt); - return IPoint(GetX(poly, prevPt), GetY(poly, prevPt)); + return IPoint(GetX(poly, prevPt), GetY(poly, prevPt), GetOnCurve(poly, prevPt)); } @@ -743,7 +746,7 @@ IPoint GlyphPoints::GetNextPoint(uint16_t poly, uint16_t pt) { uint16_t nextPt = GetNext(poly, pt); - return IPoint(GetX(poly, nextPt), GetY(poly, nextPt)); + return IPoint(GetX(poly, nextPt), GetY(poly, nextPt), GetOnCurve(poly, nextPt)); }