Commit 4fcbcd3c839d1e6665597b0a58dd0bb6bcb85295

henry 2001-08-08T01:30:04

Changes to the charmap handling and fixed TextureSize()

diff --git a/include/FTGLTextureFont.h b/include/FTGLTextureFont.h
index a623cad..2cf0f1b 100755
--- a/include/FTGLTextureFont.h
+++ b/include/FTGLTextureFont.h
@@ -1,5 +1,5 @@
-#ifndef		__FTGLTextureFont__
-#define		__FTGLTextureFont__
+#ifndef		__FTGLTextureFont
+#define		__FTGLTextureFont
 #include	"FTFont.h"
 
 #include "FTGL.h"
@@ -13,7 +13,7 @@ class	FTGLTextureFont : public FTFont
 		FTGLTextureFont();
 		~FTGLTextureFont();
 		
-		bool TextureSize() const { return textureSize;}
+		int TextureSize() const { return textureSize;}
 		
 		void render( const char* string);
 
@@ -22,12 +22,10 @@ class	FTGLTextureFont : public FTFont
 		// attributes
 		FTTextureGlyph* tempGlyph;
 		
-//		long maxTextSize;
-		int maxTextSize; // For IRIX
+		long maxTextSize;
 		int textureSize;
 		
-//		unsigned long glTextureID;
-		unsigned int glTextureID; // For IRIX
+		unsigned long glTextureID;
 		unsigned char* textMem;
 		
 		int glyphHeight;
@@ -44,4 +42,4 @@ class	FTGLTextureFont : public FTFont
 		
 		
 };
-#endif    //    __FTGLTextureFont__
+#endif
diff --git a/src/FTGLTextureFont.cpp b/src/FTGLTextureFont.cpp
index cd1dffe..1bb994e 100755
--- a/src/FTGLTextureFont.cpp
+++ b/src/FTGLTextureFont.cpp
@@ -57,16 +57,11 @@ bool FTGLTextureFont::MakeGlyphList()
 	float currTextU = (float)padding / (float)textureSize;
 	float currTextV = (float)padding / (float)textureSize;
 	
-	int glyphIndex;
-	
-	numGlyphs = 256; // FIXME hack
+//	numGlyphs = 256; // FIXME hack
 	
 	for( int n = 0; n <= numGlyphs; ++n)
 	{
-		glyphIndex = FT_Get_Char_Index( *ftFace, n);
-		
-		err = FT_Load_Glyph( *ftFace, glyphIndex, FT_LOAD_DEFAULT);
-
+		err = FT_Load_Glyph( *ftFace, n, FT_LOAD_DEFAULT);
 		FT_Glyph ftGlyph;
 		
 		err = FT_Get_Glyph( (*ftFace)->glyph, &ftGlyph);
@@ -75,7 +70,7 @@ bool FTGLTextureFont::MakeGlyphList()
 		
 		currTextU = (float)currentTextX / (float)textureSize;
 		
-		tempGlyph = new FTTextureGlyph( ftGlyph, glyphIndex, data, textureSize, currTextU, currTextV);
+		tempGlyph = new FTTextureGlyph( ftGlyph, n, data, textureSize, currTextU, currTextV);
 		glyphList->Add( tempGlyph);
 		
 		currentTextX += glyphWidth;