Skip to content

Commit

Permalink
Fixed texture coordinates for FT_BITMAP-type fonts were calculated in…
Browse files Browse the repository at this point in the history
…correctly

while building the GL display lists for a given character (resulting in the right
side edge being cut off).
  • Loading branch information
danij-deng committed Jul 16, 2011
1 parent 95be328 commit 492c2cf
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions doomsday/engine/portable/src/bitmapfont.c
Expand Up @@ -108,23 +108,12 @@ static void drawCharacter(unsigned char ch, font_t* font)
case FT_BITMAP: {
bitmapfont_t* bf = (bitmapfont_t*)font;

if(ch != 0)
{
x = bf->_chars[ch].x;
y = bf->_chars[ch].y;
}
else
{
x = y = 0;
}

s[0] = x;
t[0] = y;
s[1] = x + BitmapFont_CharWidth(font, ch);
t[1] = y + BitmapFont_CharHeight(font, ch);
s[0] = bf->_chars[ch].x;
s[1] = bf->_chars[ch].x + bf->_chars[ch].w;
t[0] = bf->_chars[ch].y;
t[1] = bf->_chars[ch].y + bf->_chars[ch].h;

x = 0;
y = 0;
x = y = 0;
w = s[1] - s[0];
h = t[1] - t[0];
break;
Expand Down

0 comments on commit 492c2cf

Please sign in to comment.