Commit 82ec4afe430411d00131e2e505b69eebf0789d28

henry 2001-10-29T20:09:59

Minor changes to fix some implicit type conversions

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),