Changeset 7207 in orxonox.OLD for branches/std/src/lib/graphics
- Timestamp:
- Mar 9, 2006, 11:35:50 PM (19 years ago)
- Location:
- branches/std/src/lib/graphics
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/lib/graphics/importer/md2Model.cc
r7203 r7207 79 79 this->setClassID(CL_MD2_MODEL, "MD2Model"); 80 80 /* 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); 82 83 if( unlikely(this->data == NULL)) 83 84 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 32 32 * @param type The renderType to display this font in 33 33 */ 34 Text::Text(const char*fontFile, unsigned int textSize)34 Text::Text(const std::string& fontFile, unsigned int textSize) 35 35 { 36 36 this->init(); 37 37 38 if ( fontFile != NULL)38 if (!fontFile.empty()) 39 39 this->setFont(fontFile, FONT_DEFAULT_RENDER_SIZE); 40 40 this->setSizeY2D(textSize); … … 78 78 * @param fontSize the Size of the Font 79 79 */ 80 void Text::setFont(const char*fontFile, unsigned int fontSize)80 void Text::setFont(const std::string& fontFile, unsigned int fontSize) 81 81 { 82 82 Font* tmpFont; … … 90 90 91 91 // load a new Font 92 if ( fontFile != NULL)92 if (!fontFile.empty()) 93 93 { 94 94 tmpFont = (Font*)ResourceManager::getInstance()->load(fontFile, TTF, RP_GAME, (int)fontSize); … … 96 96 this->font = tmpFont; 97 97 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()); 99 99 } 100 100 } -
branches/std/src/lib/graphics/text_engine/text.h
r6981 r7207 39 39 { 40 40 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); 42 42 virtual ~Text(); 43 43 void init(); 44 44 45 void setFont(const char*fontFile, unsigned int renderSize);45 void setFont(const std::string& fontFile, unsigned int renderSize); 46 46 47 47 void setText(const char* text, bool isExtern = false);
Note: See TracChangeset
for help on using the changeset viewer.