Commit ba82a01b7473327a90e26acb52bd7e24cc93a9c0

henry 2002-11-27T06:20:15

Tidied up some float declarations

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;
-        
         }
 
     }