Changeset 6142 in orxonox.OLD for trunk/src/lib/graphics
- Timestamp:
- Dec 16, 2005, 7:13:57 PM (19 years ago)
- Location:
- trunk/src/lib/graphics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/graphics_engine.cc
r6011 r6142 19 19 #include "resource_manager.h" 20 20 #include "event_handler.h" 21 22 #include "world_entity.h" 21 23 22 24 #include "render_2d.h" … … 573 575 } 574 576 577 void GraphicsEngine::draw(const std::list<WorldEntity*>& drawList ) const 578 { 579 std::list<WorldEntity*>::const_iterator entity; 580 for (entity = drawList.begin(); entity != drawList.end(); entity++) 581 if ((*entity)->isVisible()) 582 (*entity)->draw(); 583 } 584 585 575 586 /** 576 587 * displays the Frames per second -
trunk/src/lib/graphics/graphics_engine.h
r5857 r6142 15 15 #include "glincl.h" 16 16 17 #include <list> 18 17 19 // Forward Declaration 18 20 class Text; 19 21 class IniParser; 20 22 class SubString; 23 class WorldEntity; 21 24 22 25 //! class to handle graphics … … 66 69 void tick(float dt); 67 70 void draw() const; 71 void draw(const std::list<WorldEntity*>& drawList) const; 68 72 void displayFPS(bool display); 69 73 -
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.