Removed some redundant members and made then local
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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
diff --git a/include/FTExtrdGlyph.h b/include/FTExtrdGlyph.h
index f5923b6..951a42a 100644
--- a/include/FTExtrdGlyph.h
+++ b/include/FTExtrdGlyph.h
@@ -11,8 +11,8 @@
class FTVectoriser;
/**
- * FTPolyGlyph is a specialisation of FTGlyph for creating tessellated
- * polygon glyphs.
+ * FTExtrdGlyph is a specialisation of FTGlyph for creating tessellated
+ * extruded polygon glyphs.
*
* @see FTGlyphContainer
* @see FTVectoriser
@@ -55,24 +55,15 @@ class FTGL_EXPORT FTExtrdGlyph : public FTGlyph
* data
*/
FTVectoriser* vectoriser;
-
- /**
- * The total number of points in the Freetype outline
- */
- int numPoints;
-
- /**
- * Pointer to the point data
- */
- FTGL_DOUBLE* frontMesh;
- FTGL_DOUBLE* backMesh;
- FTGL_DOUBLE* sidemesh;
/**
* OpenGL display list
*/
GLuint glList;
+ /**
+ * Distance to extrude the glyph
+ */
float depth;
};
diff --git a/src/FTExtrdGlyph.cpp b/src/FTExtrdGlyph.cpp
index 80cb98e..46c5fc9 100644
--- a/src/FTExtrdGlyph.cpp
+++ b/src/FTExtrdGlyph.cpp
@@ -10,10 +10,6 @@
FTExtrdGlyph::FTExtrdGlyph( FT_Glyph glyph, float d)
: FTGlyph(),
vectoriser(0),
- numPoints(0),
- frontMesh(0),
- backMesh(0),
- sidemesh(0),
glList(0),
depth(d)
{
@@ -33,14 +29,14 @@ FTExtrdGlyph::FTExtrdGlyph( FT_Glyph glyph, float d)
bBox.z2 = -depth;
advance = glyph->advance.x >> 16;
- numPoints = vectoriser->MeshPoints();
+ int numPoints = vectoriser->MeshPoints();
if ( numPoints < 3)
{
delete vectoriser;
return;
}
- frontMesh = new FTGL_DOUBLE[ numPoints * 3];
+ FTGL_DOUBLE* frontMesh = new FTGL_DOUBLE[ numPoints * 3];
vectoriser->GetMesh( frontMesh);
// Make the back polygons
@@ -54,7 +50,7 @@ FTExtrdGlyph::FTExtrdGlyph( FT_Glyph glyph, float d)
return;
}
- backMesh = new FTGL_DOUBLE[ numPoints * 3];
+ FTGL_DOUBLE* backMesh = new FTGL_DOUBLE[ numPoints * 3];
vectoriser->GetMesh( backMesh);
numPoints = vectoriser->points();
@@ -75,7 +71,7 @@ FTExtrdGlyph::FTExtrdGlyph( FT_Glyph glyph, float d)
contourLength[cn] = vectoriser->contourSize( cn);
}
- sidemesh = new FTGL_DOUBLE[ numPoints * 3];
+ FTGL_DOUBLE* sidemesh = new FTGL_DOUBLE[ numPoints * 3];
vectoriser->GetOutline( sidemesh);
delete vectoriser;
@@ -84,7 +80,8 @@ FTExtrdGlyph::FTExtrdGlyph( FT_Glyph glyph, float d)
int offset = 0;
glList = glGenLists(1);
glNewList( glList, GL_COMPILE);
- // Render Front Mesh
+
+ // Render Front Mesh
int BEPairs = static_cast<int>(frontMesh[0]);
for( int i = 0; i < BEPairs; ++i)
{
@@ -102,7 +99,7 @@ FTExtrdGlyph::FTExtrdGlyph( FT_Glyph glyph, float d)
glEnd();
}
- // Render Back Mesh
+ // Render Back Mesh
offset = 0;
BEPairs = static_cast<int>(backMesh[0]);
for( int i = 0; i < BEPairs; ++i)
@@ -127,14 +124,14 @@ FTExtrdGlyph::FTExtrdGlyph( FT_Glyph glyph, float d)
// BUT THIS DOESN'T WORK EITHER!!!!!
// bool winding = Winding( contourLength[0], sidemesh);
- // Join them together.
+ // Join them together.
// Extrude each contour to make the sides.
FTGL_DOUBLE* contour = sidemesh;
for (int c=0; c<numContours; ++c)
{
// Make a quad strip using each successive
// pair of points in this contour.
- int numPoints = contourLength[c];
+ numPoints = contourLength[c];
glBegin( GL_QUAD_STRIP);