Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 23, 2006, 10:20:35 PM (19 years ago)
Author:
bensch
Message:

font is a Material now

File:
1 edited

Legend:

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

    r8757 r8758  
    5050    this->loadFontFromTTF(fontFile, renderSize);
    5151}
     52
    5253
    5354/**
     
    108109{ }
    109110
     111Font& Font::operator=(const Font& font)
     112{
     113  this->data = font.data;
     114  this->setDiffuseMap(font.data->texData);
     115
     116  return *this;
     117};
     118
     119
    110120/**
    111121 * @brief initializes a Font (with default values)
     
    113123void Font::init()
    114124{
     125  this->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     126
    115127  this->setClassID(CL_FONT, "Font");
    116128  if (Font::defaultFontData.get() == NULL)
     
    152164  {
    153165    this->setStyle("c");
    154     this->createFastTexture();
    155     if (this->getTexture() != 0)
     166    if (this->createFastTexture())
    156167      return true;
    157168    else
     
    186197  if (newSurf != NULL)
    187198  {
    188     this->data->setSurface(newSurf);
    189     this->data->setAlpha(hasAlpha);
    190     this->data->setTexture(Texture::loadTexToGL(newSurf));
     199    this->data->texData->setSurface(newSurf);
     200    this->data->texData->setAlpha(hasAlpha);
     201    this->setTexture(Texture::loadTexToGL(newSurf));
    191202  }
    192203  else
     
    479490//       sprintf( outName, "%s-glyphs.bmp", this->getName());
    480491//       SDL_SaveBMP(tmpSurf, outName);
    481   this->data->setAlpha(true);
    482   if (this->data->setSurface(tmpSurf))
    483     (this->data->setTexture(Texture::loadTexToGL(tmpSurf)));
     492  this->data->texData->setAlpha(true);
     493  if (this->data->texData->setSurface(tmpSurf))
     494    this->setTexture(Texture::loadTexToGL(tmpSurf));
    484495  return true;
    485496}
     497
     498/**
     499 * @brief the Internal implementation of setting up the Texture.
     500 * @param texture the Texture to load.
     501 * @returns true on success, false otherwise.
     502 */
     503bool Font::setTexture(GLuint texture)
     504{
     505  bool retVal = this->data->texData->setTexture(texture);
     506  this->setDiffuseMap(data->texData, 0);
     507  printf("this->texture %d\n", texture);
     508  //printf(this->getT)
     509  this->debug();
     510  return retVal;
     511};
    486512
    487513/**
     
    577603void Font::debug() const
    578604{
     605  Material::debug();
     606
     607  PRINT(0)("TEST %p and %p\n", this->data.get(), this->data->texData.get());
    579608  // print the loaded font's style
    580609  int style = TTF_STYLE_NORMAL;
Note: See TracChangeset for help on using the changeset viewer.