Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 24, 2006, 2:16:12 AM (18 years ago)
Author:
bensch
Message:

merged the new Font-Implementation back here
merged with svn merge https://svn.orxonox.net/orxonox/branches/fontdata . -r8752:HEAD
no conflicts, naturally

File:
1 edited

Legend:

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

    r8619 r8761  
    7676  glActiveTexture(GL_TEXTURE0);
    7777
    78   glEnable(GL_BLEND);
    79   glEnable(GL_TEXTURE_2D);
    80   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    81   glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, GL_MODULATE );
     78//   glEnable(GL_BLEND);
     79//   glEnable(GL_TEXTURE_2D);
     80//   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     81//   glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, GL_MODULATE );
     82//
     83//   glBindTexture(GL_TEXTURE_2D, this->font().getTexture());
     84  this->font().select();
    8285
    83   glBindTexture(GL_TEXTURE_2D, this->font()->getTexture());
    8486  glTranslatef(getAbsCoor2D().x, getAbsCoor2D().y, 0);
    8587  glRotatef(this->getAbsDir2D(), 0, 0, 1);
     
    9092  for (unsigned int i = 0; i < this->_dotedText.size(); i++)
    9193  {
    92     if(likely((tmpGlyph = this->font()->getGlyphArray()[this->_dotedText[i]]) != NULL))
     94    if(likely((tmpGlyph = this->font().getGlyphArray()[this->_dotedText[i]]) != NULL))
    9395    {
    9496      glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[2]);
     
    118120void LimitedWidthText::setupTextWidth()
    119121{
    120   float dotsSize = this->font()->getGlyphArray()[46]->advance * 3.0;
     122  float dotsSize = this->font().getGlyphArray()[46]->advance * 3.0;
    121123
    122124  float width = 0.0f;
     
    134136          this->_dotedText = this->text().substr(0, i) + "...";
    135137          if (i > 0)
    136             width -= this->font()->getGlyphArray()[this->text()[i-1]]->advance;
     138            width -= this->font().getGlyphArray()[this->text()[i-1]]->advance;
    137139          width += dotsSize;
    138140          break;
    139141        }
    140142        // Advance the Text.
    141         if(this->font()->getGlyphArray()[this->text()[i]] != NULL)
    142           width += this->font()->getGlyphArray()[this->text()[i]]->advance;
     143        if(this->font().getGlyphArray()[this->text()[i]] != NULL)
     144          width += this->font().getGlyphArray()[this->text()[i]]->advance;
    143145      }
    144146      break;
     
    152154          this->_dotedText = std::string("...") + this->text().substr(i);
    153155          if (i + 1 < (int)text().size() )
    154             width -= this->font()->getGlyphArray()[this->text()[i+1]]->advance;
     156            width -= this->font().getGlyphArray()[this->text()[i+1]]->advance;
    155157          width += dotsSize;
    156158          break;
    157159        }
    158160        // Advance the Text.
    159         if(this->font()->getGlyphArray()[this->text()[i]] != NULL)
    160           width += this->font()->getGlyphArray()[this->text()[i]]->advance;
     161        if(this->font().getGlyphArray()[this->text()[i]] != NULL)
     162          width += this->font().getGlyphArray()[this->text()[i]]->advance;
    161163      }
    162164      break;
Note: See TracChangeset for help on using the changeset viewer.