Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7207 in orxonox.OLD for branches/std/src/lib/graphics


Ignore:
Timestamp:
Mar 9, 2006, 11:35:50 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: evil was within

Location:
branches/std/src/lib/graphics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/lib/graphics/importer/md2Model.cc

    r7203 r7207  
    7979  this->setClassID(CL_MD2_MODEL, "MD2Model");
    8080  /* this creates the data container via ressource manager */
    81   this->data = (MD2Data*)ResourceManager::getInstance()->load(modelFileName, MD2, RP_GAME, skinFileName, scale);
     81  if (!modelFileName.empty())
     82    this->data = (MD2Data*)ResourceManager::getInstance()->load(modelFileName, MD2, RP_GAME, skinFileName, scale);
    8283  if( unlikely(this->data == NULL))
    8384    PRINTF(0)("The model was not found, MD2Model Loader finished abnormaly. Update the data-repos\n");
  • branches/std/src/lib/graphics/text_engine/text.cc

    r7193 r7207  
    3232 * @param type The renderType to display this font in
    3333 */
    34 Text::Text(const char* fontFile, unsigned int textSize)
     34Text::Text(const std::string& fontFile, unsigned int textSize)
    3535{
    3636  this->init();
    3737
    38   if (fontFile != NULL)
     38  if (!fontFile.empty())
    3939    this->setFont(fontFile, FONT_DEFAULT_RENDER_SIZE);
    4040  this->setSizeY2D(textSize);
     
    7878 * @param fontSize the Size of the Font
    7979 */
    80 void Text::setFont(const char* fontFile, unsigned int fontSize)
     80void Text::setFont(const std::string& fontFile, unsigned int fontSize)
    8181{
    8282  Font* tmpFont;
     
    9090
    9191  // load a new Font
    92   if (fontFile != NULL)
     92  if (!fontFile.empty())
    9393  {
    9494    tmpFont = (Font*)ResourceManager::getInstance()->load(fontFile, TTF, RP_GAME, (int)fontSize);
     
    9696      this->font = tmpFont;
    9797    else
    98       PRINTF(2)("Font %s could not be loaded, probably file not found\n", fontFile);
     98      PRINTF(2)("Font %s could not be loaded, probably file not found\n", fontFile.c_str());
    9999  }
    100100}
  • branches/std/src/lib/graphics/text_engine/text.h

    r6981 r7207  
    3939{
    4040  public:
    41     Text(const char* fontFile = NULL, unsigned int fontSize = TEXT_DEFAULT_SIZE);
     41    Text(const std::string& fontFile = "", unsigned int fontSize = TEXT_DEFAULT_SIZE);
    4242    virtual ~Text();
    4343    void init();
    4444
    45     void setFont(const char* fontFile, unsigned int renderSize);
     45    void setFont(const std::string& fontFile, unsigned int renderSize);
    4646
    4747    void setText(const char* text, bool isExtern = false);
Note: See TracChangeset for help on using the changeset viewer.