Changeset 3557 in orxonox.OLD for orxonox/branches/levelloader/src/lib/coord
- Timestamp:
- Mar 15, 2005, 10:53:46 AM (20 years ago)
- Location:
- orxonox/branches/levelloader/src/lib/coord
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelloader/src/lib/coord/p_node.cc
r3499 r3557 40 40 this->bAbsDirChanged = false; 41 41 this->parent = NULL; 42 this->objectName = NULL; 42 43 } 43 44 … … 59 60 this->bAbsDirChanged = false; 60 61 this->parent = parent; 61 62 this->objectName = NULL; 63 62 64 parent->addChild (this); 63 65 } … … 79 81 */ 80 82 this->parent = NULL; 83 if( this->objectName) delete this->objectName; 81 84 /* there is currently a problem with cleaning up - fix*/ 82 85 } … … 442 445 \brief set the name of the node 443 446 447 \todo Error free assignment of name by copying the string instead of keeping just the pointer 448 444 449 for debug purposes realy usefull, not used to work properly 445 450 */ 446 void PNode::setName (char* newName) 447 { 448 this->objectName = newName; 451 void PNode::setName (const char* newName) 452 { 453 int l = strlen( newName); 454 455 if( this->objectName != NULL) delete this->objectName; 456 this->objectName = NULL; 457 458 if( newName != NULL) 459 { 460 this->objectName = new char[l+1]; 461 462 for( int i = 0; i < l+1; i++) 463 this->objectName[i] = newName[i]; 464 } 449 465 } 450 466 … … 453 469 \brief gets the name of the node 454 470 */ 455 c har* PNode::getName ()471 const char* PNode::getName () 456 472 { 457 473 return this->objectName; -
orxonox/branches/levelloader/src/lib/coord/p_node.h
r3499 r3557 73 73 virtual void tick (float dt); 74 74 75 void setName (c har* newName);76 c har* getName ();75 void setName (const char* newName); 76 const char* getName (); 77 77 78 78
Note: See TracChangeset
for help on using the changeset viewer.