Index: trunk/src/lib/graphics/render2D/element_2d.cc
===================================================================
--- trunk/src/lib/graphics/render2D/element_2d.cc	(revision 5671)
+++ trunk/src/lib/graphics/render2D/element_2d.cc	(revision 5775)
@@ -19,10 +19,11 @@
 #include "render_2d.h"
 
+#include "p_node.h"
+
 #include "graphics_engine.h"
-#include "p_node.h"
 #include "load_param.h"
 #include "tinyxml.h"
 #include "class_list.h"
-#include "list.h"
+
 #include "color.h"
 
@@ -73,20 +74,13 @@
 {
   // remove the Node, delete it's children.
-  tIterator<Element2D>* iterator = this->children->getIterator();
-  Element2D* child = iterator->firstElement();
-
-  while( child != NULL)
-  {
-    delete child;
-    child = iterator->nextElement();
-  }
-  delete iterator;
+  list<Element2D*>::iterator child;
+  for (child = this->children.begin(); child != this->children.end(); child++)
+    delete *child;
 
   if (this->parent != NULL)
   {
-    this->parent->children->remove(this);
+    this->parent->children.remove(this);
     this->parent = NULL;
   }
-  delete this->children;
 
   // remove all other allocated memory.
@@ -113,5 +107,4 @@
   this->setParentMode2D(E2D_PARENT_ALL);
   this->parent = NULL;
-  this->children = new tList<Element2D>;
   this->absDirection = 0.0;
   this->relDirection = 0.0;
@@ -517,5 +510,5 @@
   {
     PRINTF(5)("Element2D::addChild() - reparenting node: removing it and adding it again\n");
-    child->parent->children->remove(child);
+    child->parent->children.remove(child);
   }
   child->parent = this;
@@ -523,19 +516,18 @@
   {
     // ELEMENT SORTING TO LAYERS  //
-    unsigned int childCount = this->children->getSize();
-    tIterator<Element2D>* iterator = this->children->getIterator();
-    Element2D* elem = iterator->firstElement();
-    while (elem != NULL)
-    {
-      if (elem->layer < child->layer)
+    unsigned int childCount = this->children.size();
+
+    list<Element2D*>::iterator elem;
+    for (elem = this->children.begin(); elem != this->children.end(); elem++)
+    {
+      if ((*elem)->layer < child->layer)
       {
-        this->children->addAtIteratorPosition(child, iterator);
+        this->children.insert(elem, child);
         break;
       }
-      elem = iterator->nextElement();
-    }
-    delete iterator;
-    if (childCount == this->children->getSize())
-      this->children->add(child);
+    }
+
+    if (childCount == this->children.size())
+      this->children.push_back(child);
     ////////////////////////////////
     if (unlikely(this->layer > child->getLayer()))
@@ -579,20 +571,13 @@
 void Element2D::remove2D()
 {
-  tIterator<Element2D>* iterator = this->children->getIterator();
-  Element2D* pn = iterator->firstElement();
-
-  while( pn != NULL)
-  {
-    NullElement2D::getInstance()->addChild2D(pn);
-    pn = iterator->nextElement();
-  }
-  delete iterator;
-
-  delete this->children;
-  this->children = new tList<Element2D>;
+  list<Element2D*>::iterator child;
+  for (child = this->children.begin(); child != this->children.end(); child++)
+    NullElement2D::getInstance()->addChild2D(*child);
+
+  this->children.erase(this->children.begin(), this->children.end());
 
   if (this->parent != NULL)
   {
-    this->parent->children->remove(this);
+    this->parent->children.remove(this);
     this->parent = NULL;
   }
@@ -802,20 +787,17 @@
 
   // UPDATE CHILDREN
-  if(this->children->getSize() > 0)
-  {
-    tIterator<Element2D>* iterator = this->children->getIterator();
-    Element2D* pn = iterator->firstElement();
-    while( pn != NULL)
+  if(this->children.size() > 0)
+  {
+    list<Element2D*>::iterator child;
+    for (child = this->children.begin(); child != this->children.end(); child++)
     {
       /* if this node has changed, make sure, that all children are updated also */
       if( likely(this->bRelCoorChanged))
-        pn->parentCoorChanged ();
+        (*child)->parentCoorChanged ();
       if( likely(this->bRelDirChanged))
-        pn->parentDirChanged ();
-
-      pn->update2D(dt);
-      pn = iterator->nextElement();
-    }
-    delete iterator;
+        (*child)->parentDirChanged ();
+
+      (*child)->update2D(dt);
+    }
   }
 
@@ -836,5 +818,5 @@
   for (unsigned int i = 0; i < level; i++)
     PRINT(0)(" |");
-  if (this->children->getSize() > 0)
+  if (this->children.size() > 0)
     PRINT(0)(" +");
   else
@@ -853,15 +835,12 @@
   if (depth >= 2 || depth == 0)
   {
-    tIterator<Element2D>* iterator = this->children->getIterator();
-    Element2D* pn = iterator->firstElement();
-    while( pn != NULL)
+    list<Element2D*>::const_iterator child;
+    for (child = this->children.begin(); child != this->children.end(); child++)
     {
       if (depth == 0)
-        pn->debug(0, level + 1);
+        (*child)->debug(0, level + 1);
       else
-        pn->debug(depth - 1, level +1);
-      pn = iterator->nextElement();
-    }
-    delete iterator;
+        (*child)->debug(depth - 1, level +1);
+    }
   }
 }
@@ -879,14 +858,9 @@
   if (this->active)
     this->tick(dt);
-  if (this->children->getSize() > 0)
-  {
-    tIterator<Element2D>* tickIT = children->getIterator();
-    Element2D* tickElem = tickIT->firstElement();
-    while (tickElem != NULL)
-    {
-      tickElem->tick2D(dt);
-      tickElem = tickIT->nextElement();
-    }
-    delete tickIT;
+  if (this->children.size() > 0)
+  {
+    list<Element2D*>::iterator child;
+    for (child = this->children.begin(); child != this->children.end(); child++)
+      (*child)->tick2D(dt);
   }
 }
@@ -900,15 +874,10 @@
   if (this->visible)
     this->draw();
-  if (this->children->getSize() > 0)
-  {
-    tIterator<Element2D>* drawIT = children->getIterator();
-    Element2D* drawElem = drawIT->firstElement();
-    while (drawElem != NULL)
-    {
+  if (this->children.size() > 0)
+  {
+    list<Element2D*>::const_iterator child;
+    for (child = this->children.begin(); child != this->children.end(); child++)
       if (likely(layer >= this->layer))
-        drawElem->draw2D(layer);
-      drawElem = drawIT->nextElement();
-    }
-    delete drawIT;
+        (*child)->draw2D(layer);
   }
 }
@@ -948,7 +917,6 @@
   {
     Vector childColor =  Color::HSVtoRGB(Color::RGBtoHSV(color)+Vector(20,0,.0));
-    tIterator<Element2D>* iterator = this->children->getIterator();
-    Element2D* pn = iterator->firstElement();
-    while( pn != NULL)
+    list<Element2D*>::const_iterator child;
+    for (child = this->children.begin(); child != this->children.end(); child++)
     {
       // drawing the Dependency graph
@@ -961,16 +929,14 @@
                    0);
         glColor3f(childColor.x, childColor.y, childColor.z);
-        glVertex3f(pn->getAbsCoor2D ().x,
-                   pn->getAbsCoor2D ().y,
+        glVertex3f((*child)->getAbsCoor2D ().x,
+                   (*child)->getAbsCoor2D ().y,
                    0);
         glEnd();
       }
       if (depth == 0)
-        pn->debugDraw2D(0, size, childColor, level+1);
+        (*child)->debugDraw2D(0, size, childColor, level+1);
       else
-        pn->debugDraw2D(depth - 1, size, childColor, level +1);
-      pn = iterator->nextElement();
-    }
-    delete iterator;
+        (*child)->debugDraw2D(depth - 1, size, childColor, level +1);
+    }
   }
   if (level == 0)
Index: trunk/src/lib/graphics/render2D/element_2d.h
===================================================================
--- trunk/src/lib/graphics/render2D/element_2d.h	(revision 5671)
+++ trunk/src/lib/graphics/render2D/element_2d.h	(revision 5775)
@@ -10,9 +10,9 @@
 
 #include "vector.h"
+#include <list>
 
 // FORWARD DECLARATION
 class PNode;
 class TiXmlElement;
-template<class T> class tList;
 
 //!< An enumerator defining the Depth of a 2D-element.
@@ -171,5 +171,5 @@
     inline Element2D* getParent2D () const { return this->parent; };
     /** @returns the List of Children of this Element2D */
-    inline const tList<Element2D>* getChildren2D() const { return this->children; };
+    inline const std::list<Element2D*>& getChildren2D() const { return this->children; };
 
     void setParentSoft2D(Element2D* parentNode, float bias = 1.0);
@@ -234,5 +234,5 @@
 
     Element2D*              parent;             //!< a pointer to the parent node
-    tList<Element2D>*       children;           //!< list of the children of this Element2D
+    std::list<Element2D*>   children;           //!< list of the children of this Element2D
 
     unsigned int            parentMode;         //!< the mode of the binding
