Changeset 6142 in orxonox.OLD for trunk/src/lib/graphics/render2D
- Timestamp:
- Dec 16, 2005, 7:13:57 PM (19 years ago)
- Location:
- trunk/src/lib/graphics/render2D
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/render2D/element_2d.cc
r5944 r6142 18 18 #include "element_2d.h" 19 19 #include "render_2d.h" 20 21 #include <algorithm> 20 22 21 23 #include "p_node.h" … … 82 84 if (this->parent != NULL) 83 85 { 84 this->parent-> children.remove(this);86 this->parent->eraseChild(this); 85 87 this->parent = NULL; 86 88 } … … 512 514 { 513 515 PRINTF(5)("Element2D::addChild() - reparenting node: removing it and adding it again\n"); 514 child->parent-> children.remove(child);516 child->parent->eraseChild(child); 515 517 } 516 518 child->parent = this; … … 581 583 if (this->parent != NULL) 582 584 { 583 this->parent-> children.remove(this);585 this->parent->eraseChild(this); 584 586 this->parent = NULL; 585 587 } … … 655 657 if (parentNode != NULL) 656 658 this->setParentSoft2D(parentNode, bias); 659 } 660 661 /** @param child the child to be erased from this Nodes List */ 662 void Element2D::eraseChild(Element2D* child) 663 { 664 std::list<Element2D*>::iterator childIT = std::find(this->children.begin(), this->children.end(), child); 665 this->children.erase(childIT); 657 666 } 658 667 … … 733 742 else if (unlikely(this->bindNode != NULL)) 734 743 { 735 GLdouble projectPos[3] ;744 GLdouble projectPos[3] = {0, 0, 0}; 736 745 gluProject(this->bindNode->getAbsCoor().x, 737 746 this->bindNode->getAbsCoor().y, -
trunk/src/lib/graphics/render2D/element_2d.h
r5775 r6142 195 195 196 196 private: 197 void eraseChild(Element2D* child); 197 198 /** tells the child that the parent's Coordinate has changed */ 198 199 inline void parentCoorChanged () { this->bRelCoorChanged = true; }
Note: See TracChangeset
for help on using the changeset viewer.