Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5370 in orxonox.OLD for trunk


Ignore:
Timestamp:
Oct 13, 2005, 12:45:03 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: minor nice-render update in the FONT

Location:
trunk/src/lib/graphics/text_engine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/text_engine/font.cc

    r5369 r5370  
    477477        SDL_FreeSurface(glyphSurf);
    478478
    479         tmpRect.x += (int)(tmpGlyph->advance*this->renderSize);
     479        tmpRect.x += (int)(tmpGlyph->advance*this->renderSize)+1;
    480480
    481481              // Outputting Glyphs to BMP-files.
     
    578578        if (y + maxLineHeight + 1 > size)
    579579          break;
    580         x += (int)(tmpGlyph->advance*this->renderSize);
     580        x += (int)(tmpGlyph->advance*this->renderSize)+1;
    581581
    582582      }
  • trunk/src/lib/graphics/text_engine/text.cc

    r5369 r5370  
    243243    {
    244244      Glyph* tmpGlyph;
     245      float posX = 0.0f;
    245246      while (likely(*tmpText != '\0'))
    246247      {
     
    249250          glBegin(GL_QUADS);
    250251          glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[2]);
    251           glVertex2d(0, - tmpGlyph->bearingY * this->size);
     252          glVertex2d(posX, - tmpGlyph->bearingY * this->size);
    252253          glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[3]);
    253           glVertex2d(0, (tmpGlyph->height - tmpGlyph->bearingY)*this->size);
     254          glVertex2d(posX, (tmpGlyph->height - tmpGlyph->bearingY)*this->size);
    254255          glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[3]);
    255           glVertex2d(tmpGlyph->width*this->size, (tmpGlyph->height - tmpGlyph->bearingY)*this->size);
     256          glVertex2d(posX+tmpGlyph->width*this->size, (tmpGlyph->height - tmpGlyph->bearingY)*this->size);
    256257          glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[2]);
    257           glVertex2d(tmpGlyph->width*this->size, - tmpGlyph->bearingY*this->size);
     258          glVertex2d(posX+tmpGlyph->width*this->size, - tmpGlyph->bearingY*this->size);
    258259          glEnd();
    259260          glEndList();
    260           glTranslatef(glyphArray[*tmpText]->width*this->size, 0, 0);
     261          posX += tmpGlyph->width*this->size;
    261262        }
    262263        tmpText++;
Note: See TracChangeset for help on using the changeset viewer.