Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6142 in orxonox.OLD for trunk/src/lib/graphics/render2D


Ignore:
Timestamp:
Dec 16, 2005, 7:13:57 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merge the ObjectManager to the trunk
merged with command:
svn merge -r6082:HEAD objectmanager/ ../trunk/

conflicts resolution was easy this time :)
but specially merged the world to network_world

Location:
trunk/src/lib/graphics/render2D
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/render2D/element_2d.cc

    r5944 r6142  
    1818#include "element_2d.h"
    1919#include "render_2d.h"
     20
     21#include <algorithm>
    2022
    2123#include "p_node.h"
     
    8284  if (this->parent != NULL)
    8385  {
    84     this->parent->children.remove(this);
     86    this->parent->eraseChild(this);
    8587    this->parent = NULL;
    8688  }
     
    512514  {
    513515    PRINTF(5)("Element2D::addChild() - reparenting node: removing it and adding it again\n");
    514     child->parent->children.remove(child);
     516    child->parent->eraseChild(child);
    515517  }
    516518  child->parent = this;
     
    581583  if (this->parent != NULL)
    582584  {
    583     this->parent->children.remove(this);
     585    this->parent->eraseChild(this);
    584586    this->parent = NULL;
    585587  }
     
    655657  if (parentNode != NULL)
    656658    this->setParentSoft2D(parentNode, bias);
     659}
     660
     661/** @param child the child to be erased from this Nodes List */
     662void 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);
    657666}
    658667
     
    733742    else if (unlikely(this->bindNode != NULL))
    734743    {
    735       GLdouble projectPos[3];
     744      GLdouble projectPos[3] = {0, 0, 0};
    736745      gluProject(this->bindNode->getAbsCoor().x,
    737746                 this->bindNode->getAbsCoor().y,
  • trunk/src/lib/graphics/render2D/element_2d.h

    r5775 r6142  
    195195
    196196  private:
     197    void eraseChild(Element2D* child);
    197198    /** tells the child that the parent's Coordinate has changed */
    198199    inline void parentCoorChanged () { this->bRelCoorChanged = true; }
Note: See TracChangeset for help on using the changeset viewer.