summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorleo2006-01-25 01:42:22 +0000
committerleo2006-01-25 01:42:22 +0000
commit8f22ec2b03a54cf94b274d31893a9b581b8052ca (patch)
tree21f15fa06b2f22e5c73dd29a11c4eb9cb35c82ec /common
parent323c942d9c7fbe246b76b39c1430f287e2bd81fa (diff)
Fixed compiler warnings on osx.
git-svn-id: http://svn.leocad.org/trunk@462 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common')
-rw-r--r--common/texfont.cpp40
-rw-r--r--common/texfont.h2
2 files changed, 22 insertions, 20 deletions
diff --git a/common/texfont.cpp b/common/texfont.cpp
index 7c61359..b3b7213 100644
--- a/common/texfont.cpp
+++ b/common/texfont.cpp
@@ -99,7 +99,7 @@ void TexFont::GetStringDimensions(int* cx, int* cy, const char* Text) const
while (*Text != 0)
{
- *cx += m_Glyphs[*Text].width;
+ *cx += m_Glyphs[(int)(*Text)].width;
Text++;
}
}
@@ -110,41 +110,43 @@ void TexFont::PrintText(float Left, float Top, float ScaleX, float ScaleY, const
while (*Text != 0)
{
- glTexCoord2f(m_Glyphs[*Text].left, m_Glyphs[*Text].top);
+ int ch = *Text;
+ glTexCoord2f(m_Glyphs[ch].left, m_Glyphs[ch].top);
glVertex2f(Left, Top);
- glTexCoord2f(m_Glyphs[*Text].left, m_Glyphs[*Text].bottom);
+ glTexCoord2f(m_Glyphs[ch].left, m_Glyphs[ch].bottom);
glVertex2f(Left, Top - Height);
- glTexCoord2f(m_Glyphs[*Text].right, m_Glyphs[*Text].bottom);
- glVertex2f(Left + m_Glyphs[*Text].width * ScaleX, Top - Height);
- glTexCoord2f(m_Glyphs[*Text].right, m_Glyphs[*Text].top);
- glVertex2f(Left + m_Glyphs[*Text].width * ScaleX, Top);
+ glTexCoord2f(m_Glyphs[ch].right, m_Glyphs[ch].bottom);
+ glVertex2f(Left + m_Glyphs[ch].width * ScaleX, Top - Height);
+ glTexCoord2f(m_Glyphs[ch].right, m_Glyphs[ch].top);
+ glVertex2f(Left + m_Glyphs[ch].width * ScaleX, Top);
- Left += m_Glyphs[*Text].width * ScaleX;
+ Left += m_Glyphs[ch].width * ScaleX;
Text++;
}
}
// Old function, should probably be removed.
-void TexFont::PrintText(float Left, float Top, float Z, const char* text) const
+void TexFont::PrintText(float Left, float Top, float Z, const char* Text) const
{
- while (*text != 0)
+ while (*Text != 0)
{
- glTexCoord2f(m_Glyphs[*text].left, m_Glyphs[*text].top);
+ int ch = *Text;
+ glTexCoord2f(m_Glyphs[ch].left, m_Glyphs[ch].top);
glVertex3f(Left, Top, Z);
- glTexCoord2f(m_Glyphs[*text].left, m_Glyphs[*text].bottom);
+ glTexCoord2f(m_Glyphs[ch].left, m_Glyphs[ch].bottom);
glVertex3f(Left, Top - m_nFontHeight, Z);
- glTexCoord2f(m_Glyphs[*text].right, m_Glyphs[*text].bottom);
- glVertex3f(Left + m_Glyphs[*text].width, Top - m_nFontHeight, Z);
- glTexCoord2f(m_Glyphs[*text].right, m_Glyphs[*text].top);
- glVertex3f(Left + m_Glyphs[*text].width, Top, Z);
+ glTexCoord2f(m_Glyphs[ch].right, m_Glyphs[ch].bottom);
+ glVertex3f(Left + m_Glyphs[ch].width, Top - m_nFontHeight, Z);
+ glTexCoord2f(m_Glyphs[ch].right, m_Glyphs[ch].top);
+ glVertex3f(Left + m_Glyphs[ch].width, Top, Z);
- Left += m_Glyphs[*text].width;
- text++;
+ Left += m_Glyphs[ch].width;
+ Text++;
}
}
// Temporary function to draw the axis icon text
-void TexFont::PrintCharScaled (float scale, char ch) const
+void TexFont::PrintCharScaled (float scale, int ch) const
{
glTexCoord2f (m_Glyphs[ch].left, m_Glyphs[ch].top);
glVertex2f (-scale * m_Glyphs[ch].width, scale * m_nFontHeight);
diff --git a/common/texfont.h b/common/texfont.h
index 252dfc7..e0d4935 100644
--- a/common/texfont.h
+++ b/common/texfont.h
@@ -20,7 +20,7 @@ public:
bool FileLoad(File& file);
void PrintText(float left, float top, float z, const char* text) const;
void PrintText(float Left, float Top, float ScaleX, float ScaleY, const char* Text) const;
- void PrintCharScaled(float scale, char ch) const;
+ void PrintCharScaled(float scale, int ch) const;
void GetStringDimensions(int* cx, int* cy, const char* Text) const;
protected: