Minor changes to fix some implicit type conversions
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
diff --git a/include/FTFont.h b/include/FTFont.h
index 52057b8..47406cf 100755
--- a/include/FTFont.h
+++ b/include/FTFont.h
@@ -146,7 +146,7 @@ class FTGL_EXPORT FTFont
/**
* Number of faces in this font
*/
- int numFaces;
+ unsigned int numFaces;
/**
* Current size object
diff --git a/include/FTGLTextureFont.h b/include/FTGLTextureFont.h
index a32c1c2..31f8def 100755
--- a/include/FTGLTextureFont.h
+++ b/include/FTGLTextureFont.h
@@ -28,12 +28,12 @@ class FTGL_EXPORT FTGLTextureFont : public FTFont
/**
* Get the total width of the texture that holds this font
*/
- virtual int TextureWidth() const { return textureWidth;}
+ virtual GLsizei TextureWidth() const { return textureWidth;}
/**
* Get the total height of the texture that holds this font
*/
- virtual int TextureHeight() const { return textureHeight;}
+ virtual GLsizei TextureHeight() const { return textureHeight;}
/**
* Renders a string of characters
@@ -73,7 +73,7 @@ class FTGL_EXPORT FTGLTextureFont : public FTFont
* @param textureHeight The texture height
* @param textMem A pointer to the texture memory.
*/
- unsigned int FillGlyphs( unsigned int glyphStart, int textID, int textureWidth, int textureHeight, unsigned char* textMem);
+ unsigned int FillGlyphs( unsigned int glyphStart, GLuint textID, GLsizei textureWidth, GLsizei textureHeight, unsigned char* textMem);
/**
* Get the size of a block of memory required to layout the glyphs
@@ -97,22 +97,22 @@ class FTGL_EXPORT FTGLTextureFont : public FTFont
* @param height The number of rows of bytes.
* @param data A pointer to the texture data
*/
- void CreateTexture( int id, int width, int height, unsigned char* data);
+ void CreateTexture( GLuint id, GLsizei width, GLsizei height, unsigned char* data);
/**
* The maximum texture dimension on this OpenGL implemetation
*/
- long maxTextSize;
+ GLsizei maxTextSize;
/**
* The minimum texture width required to hold the glyphs
*/
- int textureWidth;
+ GLsizei textureWidth;
/**
* The minimum texture height required to hold the glyphs
*/
- int textureHeight;
+ GLsizei textureHeight;
/**
* An array of texture ids
diff --git a/include/FTGlyphContainer.h b/include/FTGlyphContainer.h
index 6e01203..bb2cb41 100755
--- a/include/FTGlyphContainer.h
+++ b/include/FTGlyphContainer.h
@@ -31,7 +31,7 @@ class FTGL_EXPORT FTGlyphContainer
* @param p A flag to indicate preprocessing of glyphs.
* Not used.
*/
- FTGlyphContainer( FTFace* face, int numGlyphs, bool p = false);
+ FTGlyphContainer( FTFace* face, unsigned int numGlyphs, bool p = false);
/**
* Destructor
diff --git a/include/FTTextureGlyph.h b/include/FTTextureGlyph.h
index 5ae34a8..1b59d05 100755
--- a/include/FTTextureGlyph.h
+++ b/include/FTTextureGlyph.h
@@ -32,7 +32,7 @@ class FTGL_EXPORT FTTextureGlyph : public FTGlyph
* @param u The texture co-ord for this glyph
* @param v The texture co-ord for this glyph
*/
- FTTextureGlyph( FT_Glyph glyph, int id, unsigned char* data, int stride, int height, float u, float v);
+ FTTextureGlyph( FT_Glyph glyph, int id, unsigned char* data, GLsizei stride, GLsizei height, float u, float v);
/**
* Destructor
diff --git a/src/FTGLTextureFont.cpp b/src/FTGLTextureFont.cpp
index bf49b72..3537082 100755
--- a/src/FTGLTextureFont.cpp
+++ b/src/FTGLTextureFont.cpp
@@ -4,9 +4,7 @@
using namespace std;
-typedef unsigned long UInt32; // a mac thing?
-
-inline UInt32 NextPowerOf2( UInt32 in)
+inline GLuint NextPowerOf2( GLuint in)
{
in -= 1;
@@ -47,7 +45,7 @@ bool FTGLTextureFont::MakeGlyphList()
glyphWidth = ( charSize.Width()) + padding;
GetSize();
- int totalMem;
+ GLuint totalMem;
if( textureHeight > maxTextSize)
{
@@ -55,7 +53,7 @@ bool FTGLTextureFont::MakeGlyphList()
if( numTextures > 15) // FIXME
numTextures = 15;
- int heightRemain = NextPowerOf2( textureHeight % maxTextSize);
+ GLsizei heightRemain = NextPowerOf2( textureHeight % maxTextSize);
totalMem = ((maxTextSize * ( numTextures - 1)) + heightRemain) * textureWidth;
glGenTextures( numTextures, (GLuint*)&glTextureID[0]);
@@ -98,7 +96,7 @@ bool FTGLTextureFont::MakeGlyphList()
}
-unsigned int FTGLTextureFont::FillGlyphs( unsigned int glyphStart, int id, int width, int height, unsigned char* textdata)
+unsigned int FTGLTextureFont::FillGlyphs( unsigned int glyphStart, GLuint id, GLsizei width, GLsizei height, unsigned char* textdata)
{
int currentTextX = padding;
int currentTextY = padding;// + padding;
@@ -106,7 +104,6 @@ unsigned int FTGLTextureFont::FillGlyphs( unsigned int glyphStart, int id, int w
float currTextU = (float)padding / (float)width;
float currTextV = (float)padding / (float)height;
-// numGlyphs = 256; // FIXME hack
unsigned int n;
for( n = glyphStart; n <= numGlyphs; ++n)
@@ -157,14 +154,14 @@ void FTGLTextureFont::GetSize()
}
-void FTGLTextureFont::CreateTexture( int id, int width, int height, unsigned char* data)
+void FTGLTextureFont::CreateTexture( GLuint id, GLsizei width, GLsizei height, unsigned char* data)
{
glPixelStorei( GL_UNPACK_ALIGNMENT, 1); //What does this do exactly?
glBindTexture( GL_TEXTURE_2D, glTextureID[id]);
- glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
- glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D( GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, data);
}
diff --git a/src/FTGlyphContainer.cpp b/src/FTGlyphContainer.cpp
index 33ea20e..53a95f7 100755
--- a/src/FTGlyphContainer.cpp
+++ b/src/FTGlyphContainer.cpp
@@ -3,7 +3,7 @@
#include "FTFace.h"
-FTGlyphContainer::FTGlyphContainer( FTFace* f, int g, bool p)
+FTGlyphContainer::FTGlyphContainer( FTFace* f, unsigned int g, bool p)
: preCache( p),
numGlyphs( g),
face( f),
@@ -60,7 +60,7 @@ FT_Vector& FTGlyphContainer::render( unsigned int index, unsigned int next, FT_V
advance = glyphs[left]->Render( pen);
}
- kernAdvance.x = advance + kernAdvance.x; // FIXME float to long
+ kernAdvance.x = advance + kernAdvance.x;
// kernAdvance.y = advance.y + kernAdvance.y;
return kernAdvance;
}
diff --git a/src/FTTextureGlyph.cpp b/src/FTTextureGlyph.cpp
index e874dbb..30014a3 100755
--- a/src/FTTextureGlyph.cpp
+++ b/src/FTTextureGlyph.cpp
@@ -2,7 +2,7 @@
#include "FTGL.h"
-FTTextureGlyph::FTTextureGlyph( FT_Glyph glyph, int id, unsigned char* data, int stride, int height, float u, float v)
+FTTextureGlyph::FTTextureGlyph( FT_Glyph glyph, int id, unsigned char* data, GLsizei stride, GLsizei height, float u, float v)
: FTGlyph(),
destWidth(0),
destHeight(0),