Tidied up some float declarations
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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
diff --git a/include/FTFont.h b/include/FTFont.h
index 0f2c541..8867e6c 100755
--- a/include/FTFont.h
+++ b/include/FTFont.h
@@ -269,8 +269,6 @@ class FTGL_EXPORT FTFont
* @param nextChr next character
*/
inline void doRender( const unsigned int chr, const unsigned int nextChr);
-
-
};
diff --git a/include/FTLibrary.h b/include/FTLibrary.h
index cd3ee96..e895ba3 100755
--- a/include/FTLibrary.h
+++ b/include/FTLibrary.h
@@ -88,10 +88,15 @@ class FTGL_EXPORT FTLibrary
// FTC_Manager* manager;
/**
+ * Freetype library version.
+ */
+ int major, minor, patch;
+
+ /**
* Current error code. Zero means no error.
*/
FT_Error err;
-
};
+
#endif // __FTLibrary__
diff --git a/include/FTVectoriser.h b/include/FTVectoriser.h
index 392c0a7..7fe2f1d 100644
--- a/include/FTVectoriser.h
+++ b/include/FTVectoriser.h
@@ -1,8 +1,6 @@
#ifndef __FTVectoriser__
#define __FTVectoriser__
-//#include <vector>
-
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
@@ -111,7 +109,7 @@ class FTGL_EXPORT FTContour
*/
void AddPoint( const FTGL_DOUBLE x, const FTGL_DOUBLE y)
{
- ftPoint point( x, y, 0.0);
+ ftPoint point( x, y, 0.0f);
// Eliminate duplicate points.
if( pointList.empty() || ( pointList[pointList.size() - 1] != point && pointList[0] != point))
diff --git a/src/FTExtrdGlyph.cpp b/src/FTExtrdGlyph.cpp
index 418636e..3ec6226 100644
--- a/src/FTExtrdGlyph.cpp
+++ b/src/FTExtrdGlyph.cpp
@@ -208,9 +208,9 @@ float FTExtrdGlyph::Render( const FT_Vector& pen)
{
if( glList)
{
- glTranslatef( pen.x, pen.y, 0);
+ glTranslatef( pen.x, pen.y, 0.0f);
glCallList( glList);
- glTranslatef( -pen.x, -pen.y, 0);
+ glTranslatef( -pen.x, -pen.y, 0.0f);
}
return advance;
diff --git a/src/FTFont.cpp b/src/FTFont.cpp
index 377a577..7ff67c9 100755
--- a/src/FTFont.cpp
+++ b/src/FTFont.cpp
@@ -139,7 +139,7 @@ void FTFont::BBox( const char* string,
float& llx, float& lly, float& llz, float& urx, float& ury, float& urz)
{
const unsigned char* c = (unsigned char*)string;
- llx = lly = llz = urx = ury = urz = 0;
+ llx = lly = llz = urx = ury = urz = 0.0f;
FTBBox bbox;
while( *c)
@@ -175,7 +175,7 @@ void FTFont::BBox( const wchar_t* string,
float& llx, float& lly, float& llz, float& urx, float& ury, float& urz)
{
const wchar_t* c = string;
- llx = lly = llz = urx = ury = urz = 0;
+ llx = lly = llz = urx = ury = urz = 0.0f;
FTBBox bbox;
while( *c)
@@ -211,7 +211,7 @@ void FTFont::BBox( const wchar_t* string,
float FTFont::Advance( const wchar_t* string)
{
const wchar_t* c = string;
- float width = 0;
+ float width = 0.0f;
while( *c)
{
@@ -226,7 +226,7 @@ float FTFont::Advance( const wchar_t* string)
float FTFont::Advance( const char* string)
{
const unsigned char* c = (unsigned char*)string;
- float width = 0;
+ float width = 0.0f;
while( *c)
{
diff --git a/src/FTGLExtrdFont.cpp b/src/FTGLExtrdFont.cpp
index a0caee2..b897b30 100644
--- a/src/FTGLExtrdFont.cpp
+++ b/src/FTGLExtrdFont.cpp
@@ -3,7 +3,7 @@
FTGLExtrdFont::FTGLExtrdFont()
-: depth(0)
+: depth(0.0f)
{}
diff --git a/src/FTOutlineGlyph.cpp b/src/FTOutlineGlyph.cpp
index dc41e25..29dc9c9 100644
--- a/src/FTOutlineGlyph.cpp
+++ b/src/FTOutlineGlyph.cpp
@@ -77,9 +77,9 @@ float FTOutlineGlyph::Render( const FT_Vector& pen)
{
if( glList)
{
- glTranslatef( pen.x, pen.y, 0);
- glCallList( glList);
- glTranslatef( -pen.x, -pen.y, 0);
+ glTranslatef( pen.x, pen.y, 0.0f);
+ glCallList( glList);
+ glTranslatef( -pen.x, -pen.y, 0.0f);
}
return advance;
diff --git a/src/FTPolyGlyph.cpp b/src/FTPolyGlyph.cpp
index 0d17b03..676b17a 100644
--- a/src/FTPolyGlyph.cpp
+++ b/src/FTPolyGlyph.cpp
@@ -70,9 +70,9 @@ float FTPolyGlyph::Render( const FT_Vector& pen)
{
if( glList)
{
- glTranslatef( pen.x, pen.y, 0);
+ glTranslatef( pen.x, pen.y, 0.0f);
glCallList( glList);
- glTranslatef( -pen.x, -pen.y, 0);
+ glTranslatef( -pen.x, -pen.y, 0.0f);
}
return advance;
diff --git a/src/FTVectoriser.cpp b/src/FTVectoriser.cpp
index 87e1d91..d4fac13 100644
--- a/src/FTVectoriser.cpp
+++ b/src/FTVectoriser.cpp
@@ -220,8 +220,8 @@ int FTVectoriser::Conic( const int index, const int first, const int last)
next2 = first;
// create a phantom point
- float x = ( ftOutline.points[index].x + ftOutline.points[next].x) / 2;
- float y = ( ftOutline.points[index].y + ftOutline.points[next].y) / 2;
+ float x = ( ftOutline.points[index].x + ftOutline.points[next].x) * 0.5f;
+ float y = ( ftOutline.points[index].y + ftOutline.points[next].y) * 0.5f;
// process first curve
ctrlPtArray[0][0] = ftOutline.points[prev].x; ctrlPtArray[0][1] = ftOutline.points[prev].y;
@@ -321,7 +321,7 @@ void FTVectoriser::GetOutline( FTGL_DOUBLE* data)
{
data[i] = static_cast<FTGL_DOUBLE>(contour->pointList[p].x / 64.0f); // is 64 correct?
data[i + 1] = static_cast<FTGL_DOUBLE>(contour->pointList[p].y / 64.0f);
- data[i + 2] = 0.0; // static_cast<FTGL_DOUBLE>(contour->pointList[p].z / 64.0f);
+ data[i + 2] = 0.0f; // static_cast<FTGL_DOUBLE>(contour->pointList[p].z / 64.0f);
i += 3;
}
}
@@ -357,7 +357,7 @@ void FTVectoriser::MakeMesh( FTGL_DOUBLE zNormal)
gluTessProperty( tobj, GLU_TESS_TOLERANCE, 0);
- gluTessNormal( tobj, 0.0, 0.0, zNormal);
+ gluTessNormal( tobj, 0.0f, 0.0f, zNormal);
gluTessBeginPolygon( tobj, mesh);
for( size_t c = 0; c < contours(); ++c)
@@ -402,9 +402,8 @@ void FTVectoriser::GetMesh( FTGL_DOUBLE* data)
{
data[i] = tess->pointList[q].x / 64.0f; // is 64 correct?
data[i + 1] = tess->pointList[q].y / 64.0f;
- data[i + 2] = 0.0; // static_cast<FTGL_DOUBLE>(mesh->pointList[p].z / 64.0f);
+ data[i + 2] = 0.0f; // static_cast<FTGL_DOUBLE>(mesh->pointList[p].z / 64.0f);
i += 3;
-
}
}