Refactored variables in Process() Changed Process to void Test in FTVectoriser c_stor
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
diff --git a/include/FTVectoriser.h b/include/FTVectoriser.h
index e489c34..304bb33 100644
--- a/include/FTVectoriser.h
+++ b/include/FTVectoriser.h
@@ -219,10 +219,8 @@ class FTGL_EXPORT FTVectoriser
/**
* Process the freetype outline data into contours of points
- *
- * @return <code>true</code> on success
*/
- bool Process();
+ void Process();
/**
* Copy the outline data into a block of <code>FTGL_DOUBLEs</code>
diff --git a/src/FTVectoriser.cpp b/src/FTVectoriser.cpp
index 5e0a486..cc4898f 100644
--- a/src/FTVectoriser.cpp
+++ b/src/FTVectoriser.cpp
@@ -92,7 +92,7 @@ int FTMesh::size() const
for( size_t t = 0; t < tesselationList.size(); ++t)
{
s += tesselationList[t]->size();
-// FIXME What the hell is this for?
+// FIXME What the hell is this for? Data in FTPolyglyph
++s;
}
return s;
@@ -108,10 +108,13 @@ FTVectoriser::FTVectoriser( const FT_Glyph glyph)
contourFlag(0),
kBSTEPSIZE( 0.2f)
{
- FT_OutlineGlyph outline = (FT_OutlineGlyph)glyph;
- ftOutline = outline->outline;
+ if( glyph)
+ {
+ FT_OutlineGlyph outline = (FT_OutlineGlyph)glyph;
+ ftOutline = outline->outline;
- contourList.reserve( ftOutline.n_contours);
+ contourList.reserve( ftOutline.n_contours);
+ }
}
@@ -141,13 +144,13 @@ int FTVectoriser::points()
}
-bool FTVectoriser::Process()
+void FTVectoriser::Process()
{
short first = 0;
short last;
- const short cont = ftOutline.n_contours;
+ const short contourCount = ftOutline.n_contours;
- for( short c = 0; c < cont; ++c)
+ for( short c = 0; c < contourCount; ++c)
{
contour = new FTContour;
contourFlag = ftOutline.flags;
@@ -172,8 +175,6 @@ bool FTVectoriser::Process()
contourList.push_back( contour);
first = last + 1;
}
-
- return true;
}