Made return values const
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 73 74 75 76 77 78 79 80 81 82 83 84
diff --git a/include/FTVectoriser.h b/include/FTVectoriser.h
index e5ca95c..dc751bc 100644
--- a/include/FTVectoriser.h
+++ b/include/FTVectoriser.h
@@ -87,7 +87,7 @@ class FTGL_EXPORT FTMesh
unsigned int TesselationCount() const { return tesselationList.size();}
- FTTesselation* Tesselation( unsigned int index) const { return tesselationList[index];}
+ const FTTesselation* const Tesselation( unsigned int index) const;
/**
* Get the GL ERROR returned by the glu tesselator
@@ -160,7 +160,7 @@ class FTGL_EXPORT FTVectoriser
/**
* Get the current mesh.
*/
- FTMesh* GetMesh() const { return mesh;}
+ const FTMesh* const GetMesh() const { return mesh;}
/**
* Get the total count of points in this outline
@@ -177,11 +177,11 @@ class FTGL_EXPORT FTVectoriser
size_t ContourCount() const { return ftContourCount;}
/**
- * Get the count of contours in this outline
+ * Return a contour at index
*
* @return the number of contours
*/
- FTContour* Contour( unsigned int index) const { return contourList[index];}
+ const FTContour* const Contour( unsigned int index) const;
/**
* Get the number of points in a specific contour in this outline
diff --git a/src/FTVectoriser.cpp b/src/FTVectoriser.cpp
index e7ce135..982cd9e 100644
--- a/src/FTVectoriser.cpp
+++ b/src/FTVectoriser.cpp
@@ -52,7 +52,8 @@ void CALLBACK ftglCombine( FTGL_DOUBLE coords[3], void* vertex_data[4], GLfloat
FTMesh::FTMesh()
-: err(0)
+: currentTesselation(0),
+ err(0)
{
tesselationList.reserve( 16);
tempPointList.reserve( 128);
@@ -89,6 +90,11 @@ void FTMesh::End()
}
+const FTTesselation* const FTMesh::Tesselation( unsigned int index) const
+{
+ return ( index < tesselationList.size()) ? tesselationList[index] : NULL;
+}
+
FTVectoriser::FTVectoriser( const FT_Glyph glyph)
: contourList(0),
mesh(0),
@@ -149,7 +155,7 @@ void FTVectoriser::ProcessContours()
size_t FTVectoriser::PointCount()
{
- int s = 0;
+ size_t s = 0;
for( size_t c = 0; c < ContourCount(); ++c)
{
s += contourList[c]->PointCount();
@@ -159,6 +165,12 @@ size_t FTVectoriser::PointCount()
}
+const FTContour* const FTVectoriser::Contour( unsigned int index) const
+{
+ return ( index < ContourCount()) ? contourList[index] : NULL;
+}
+
+
void FTVectoriser::MakeMesh( FTGL_DOUBLE zNormal)
{
if( mesh)