Changeset 4020 in orxonox.OLD
- Timestamp:
- May 3, 2005, 12:48:25 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/factory.cc
r4019 r4020 28 28 \brief constructor 29 29 30 set everything to zero and define classname30 set everything to zero and define factoryName 31 31 */ 32 32 Factory::Factory (const char* name) 33 33 { 34 this-> classname = NULL;35 this->set Classname(name);34 this->factoryName = NULL; 35 this->setFactoryName(name); 36 36 next = NULL; 37 37 … … 46 46 Factory::~Factory () 47 47 { 48 // printf("%s\n", this-> classname);48 // printf("%s\n", this->factoryName); 49 49 // Factory* tmpDel = this->next; 50 50 // this->next = NULL; … … 53 53 } 54 54 55 void Factory::set Classname(const char* name)55 void Factory::setFactoryName(const char* name) 56 56 { 57 if ( classname)58 delete classname;59 classname = new char[strlen(name)+1];60 strcpy( classname, name);57 if (factoryName) 58 delete factoryName; 59 factoryName = new char[strlen(name)+1]; 60 strcpy(factoryName, name); 61 61 } 62 62 -
orxonox/trunk/src/factory.h
r4010 r4020 33 33 void initialize(); 34 34 void registerFactory( Factory* factory); 35 void set Classname(const char* name);36 const char* get Classname() {return classname;};35 void setFactoryName(const char* name); 36 const char* getFactoryName() {return factoryName;}; 37 37 void setNext( Factory* factory) {next = factory;} 38 38 Factory* getNext() {return next;} 39 39 40 40 private: 41 char* classname;41 char* factoryName; 42 42 43 43 Factory* next; … … 68 68 BaseObject* tFactory<T>::fabricate( TiXmlElement* root) 69 69 { 70 if(!strcmp(root->Value(), get Classname()))70 if(!strcmp(root->Value(), getFactoryName())) 71 71 return new T ( root); 72 72 else if( getNext() != NULL) -
orxonox/trunk/src/game_loader.cc
r4017 r4020 279 279 assert( factory != NULL); 280 280 281 PRINTF0("Registered factory for '%s'\n", factory->get Classname());281 PRINTF0("Registered factory for '%s'\n", factory->getFactoryName()); 282 282 283 283 if( first == NULL) first = factory; -
orxonox/trunk/src/lib/graphics/importer/model.cc
r3917 r4020 211 211 { 212 212 if (this->name) 213 delete this->name;213 delete []this->name; 214 214 if (name) 215 215 {
Note: See TracChangeset
for help on using the changeset viewer.