Index: trunk/src/lib/collision_detection/cd_engine.cc
===================================================================
--- trunk/src/lib/collision_detection/cd_engine.cc	(revision 6139)
+++ trunk/src/lib/collision_detection/cd_engine.cc	(revision 6142)
@@ -65,46 +65,71 @@
     be able to enhance iteration speed.
  */
-void CDEngine::checkCollisions()
-{
-  this->checkCollisionObjects();
+//void CDEngine::checkCollisions()
+//{
+//  this->checkCollisionObjects();
   //this->checkCollisionGround();
-}
-
-#include "class_list.h"
-#include "state.h"
+//}
+
 /**
  *  this checks the collisions with the objects
  */
-void CDEngine::checkCollisionObjects()
+//void CDEngine::checkCollisionObjects()
+//{
+//   BVTree* tree;
+//   tIterator<WorldEntity>* iterator1 = entityList->getIterator();
+//   tIterator<WorldEntity>* iterator2 = entityList->getIterator();
+//   WorldEntity* entity1 = iterator1->firstElement();
+//   WorldEntity* entity2 = iterator2->iteratorElement(iterator1);
+//   PRINTF(3)("checking for collisions\n");
+//   while( entity1 != NULL)
+//   {
+//     if( likely(entity1 != this->terrain))
+//     {
+//       entity2 = iterator2->nextElement();
+//
+//       while( entity2 != NULL)
+//       {
+//         if( likely(entity2 != this->terrain))
+//         {
+//           PRINTF(4)("checking object %s against %s\n", entity1->getName(), entity2->getName());
+//           tree = entity1->getOBBTree();
+//           if( likely(tree != NULL) && entity2->getOBBTree() != NULL) tree->collideWith(entity1, entity2);
+//         }
+//         entity2 = iterator2->nextElement();
+//       }
+//     }
+//     entity1 = iterator1->nextElement();
+//     entity2 = iterator2->iteratorElement(iterator1);
+//     entity2 = iterator2->nextElement();
+//   }
+//   delete iterator1;
+//   delete iterator2;
+//}
+
+void CDEngine::checkCollisions(std::list<WorldEntity*>& list1, std::list<WorldEntity*>& list2)
 {
   BVTree* tree;
-  tIterator<WorldEntity>* iterator1 = entityList->getIterator();
-  tIterator<WorldEntity>* iterator2 = entityList->getIterator();
-  WorldEntity* entity1 = iterator1->firstElement();
-  WorldEntity* entity2 = iterator2->iteratorElement(iterator1);
+  std::list<WorldEntity*>::iterator entity1, entity2, pre1, pre2;
   PRINTF(3)("checking for collisions\n");
-  while( entity1 != NULL)
+
+  pre1 = list1.begin();
+  while (pre1 != list1.end())
   {
-    if( likely(entity1 != this->terrain))
+    entity1 = pre1++;
+    if( likely((*entity1) != this->terrain))
     {
-      entity2 = iterator2->nextElement();
-
-      while( entity2 != NULL)
+      pre2 = list2.begin();
+      while (pre2 != list2.end())
       {
-        if( likely(entity2 != this->terrain))
+        entity2 = pre2++;
+        if( likely((*entity2) != this->terrain))
         {
-          PRINTF(4)("checking object %s against %s\n", entity1->getName(), entity2->getName());
-          tree = entity1->getOBBTree();
-          if( likely(tree != NULL) && entity2->getOBBTree() != NULL) tree->collideWith(entity1, entity2);
+          PRINTF(4)("checking object %s against %s\n", (*entity1)->getName(), (*entity2)->getName());
+          tree = (*entity1)->getOBBTree();
+          if( likely(tree != NULL) && (*entity2)->getOBBTree() != NULL) tree->collideWith(*entity1, *entity2);
         }
-        entity2 = iterator2->nextElement();
       }
     }
-    entity1 = iterator1->nextElement();
-    entity2 = iterator2->iteratorElement(iterator1);
-    entity2 = iterator2->nextElement();
   }
-  delete iterator1;
-  delete iterator2;
 }
 
@@ -134,6 +159,6 @@
   /* this would operate on  worldList bases, for testing purposes, we only use one OBBTree */
   //this->rootTree->drawBV(depth, drawMode);
-
-  tIterator<WorldEntity>* iterator = entityList->getIterator();
+  /// FIXME
+/*  tIterator<WorldEntity>* iterator = entityList->getIterator();
   WorldEntity* entity = iterator->firstElement();
   while( entity != NULL)
@@ -142,5 +167,5 @@
     entity = iterator->nextElement();
   }
-  delete iterator;
+  delete iterator;*/
 }
 
Index: trunk/src/lib/collision_detection/cd_engine.h
===================================================================
--- trunk/src/lib/collision_detection/cd_engine.h	(revision 6139)
+++ trunk/src/lib/collision_detection/cd_engine.h	(revision 6142)
@@ -12,6 +12,6 @@
 #include "model.h"
 
+#include <list>
 
-template<class T> class tList;
 class WorldEntity;
 class OBBTree;
@@ -49,5 +49,4 @@
   inline void disable(const int options) { int temp = this->state & options; this->state ^= temp; }
 
-  inline void setEntityList(tList<WorldEntity>* entityList) { this->entityList = entityList; }
   inline void setTerrain(Terrain* terrain) { this->terrain = terrain; }
   //  inline void setPlayer(Player* player) { this->player = player; } /* only for debug purposes \todo: delete*/
@@ -55,5 +54,6 @@
   void drawBV(int depth, int drawMode) const;
 
-  void checkCollisions();
+//  void checkCollisions();
+  void checkCollisions(std::list<WorldEntity*>& list1, std::list<WorldEntity*>& list2);
 
   void debug();
@@ -75,5 +75,4 @@
  private:
   int                     state;                            //!< the current state of the cd engine
-  tList<WorldEntity>*     entityList;                       //!< pointer to the world entity list
   OBBTree*                rootTree;                         //!< for testing purposes a root tree
 
Index: trunk/src/lib/coord/p_node.cc
===================================================================
--- trunk/src/lib/coord/p_node.cc	(revision 6139)
+++ trunk/src/lib/coord/p_node.cc	(revision 6142)
@@ -81,5 +81,5 @@
     {
       deleteNode = tmp;
-      ++tmp;
+      tmp++;
 //      printf("TEST::%s(%s) %s\n", (*deleteNode)->getName(), (*deleteNode)->getClassName(), this->getName());
       if ((this->parentMode & PNODE_PROHIBIT_CHILD_DELETE) ||
@@ -470,4 +470,5 @@
               this->getClassName(), this->getName(), child->getClassName(), child->getName());
     child->parent = NULL;
+    child->parentCoorChanged();
   }
 }
@@ -536,5 +537,6 @@
     if (this->parentMode & PNODE_REPARENT_CHILDREN_ON_REMOVE ||
         (*reparenter)->parentMode & PNODE_REPARENT_ON_PARENTS_REMOVE)
-    {      printf("TEST----------------%s ---- %s\n", this->getClassName(), (*reparenter)->getClassName());
+    {
+      printf("TEST----------------%s ---- %s\n", this->getClassName(), (*reparenter)->getClassName());
       (*reparenter)->reparent();
       printf("REPARENTED TO: %s::%s\n",(*reparenter)->getParent()->getClassName(),(*reparenter)->getParent()->getName());
@@ -542,5 +544,8 @@
   }
   if (this->parent != NULL)
+  {
     this->parent->eraseChild(this);
+    this->parent = NULL;
+  }
 }
 
Index: trunk/src/lib/coord/p_node.h
===================================================================
--- trunk/src/lib/coord/p_node.h	(revision 6139)
+++ trunk/src/lib/coord/p_node.h	(revision 6142)
@@ -79,5 +79,5 @@
 
   // ACTIVATION //
-  inline void activateNode() { this->bActive = true; };
+  inline void activateNode() { this->bActive = this->bRelCoorChanged = this->bRelDirChanged = true; };
   inline void deactivateNode() { this->bActive = false; };
   inline bool getNodeActiveState() { return this->bActive; };
Index: trunk/src/lib/graphics/graphics_engine.cc
===================================================================
--- trunk/src/lib/graphics/graphics_engine.cc	(revision 6139)
+++ trunk/src/lib/graphics/graphics_engine.cc	(revision 6142)
@@ -19,4 +19,6 @@
 #include "resource_manager.h"
 #include "event_handler.h"
+
+#include "world_entity.h"
 
 #include "render_2d.h"
@@ -573,4 +575,13 @@
 }
 
+void GraphicsEngine::draw(const std::list<WorldEntity*>& drawList ) const
+{
+  std::list<WorldEntity*>::const_iterator entity;
+  for (entity = drawList.begin(); entity != drawList.end(); entity++)
+    if ((*entity)->isVisible()) 
+      (*entity)->draw(); 
+}
+
+
 /**
  * displays the Frames per second
Index: trunk/src/lib/graphics/graphics_engine.h
===================================================================
--- trunk/src/lib/graphics/graphics_engine.h	(revision 6139)
+++ trunk/src/lib/graphics/graphics_engine.h	(revision 6142)
@@ -15,8 +15,11 @@
 #include "glincl.h"
 
+#include <list>
+
 // Forward Declaration
 class Text;
 class IniParser;
 class SubString;
+class WorldEntity;
 
 //! class to handle graphics
@@ -66,4 +69,5 @@
     void tick(float dt);
     void draw() const;
+    void draw(const std::list<WorldEntity*>& drawList) const;
     void displayFPS(bool display);
 
Index: trunk/src/lib/graphics/render2D/element_2d.cc
===================================================================
--- trunk/src/lib/graphics/render2D/element_2d.cc	(revision 6139)
+++ trunk/src/lib/graphics/render2D/element_2d.cc	(revision 6142)
@@ -18,4 +18,6 @@
 #include "element_2d.h"
 #include "render_2d.h"
+
+#include <algorithm>
 
 #include "p_node.h"
@@ -82,5 +84,5 @@
   if (this->parent != NULL)
   {
-    this->parent->children.remove(this);
+    this->parent->eraseChild(this);
     this->parent = NULL;
   }
@@ -512,5 +514,5 @@
   {
     PRINTF(5)("Element2D::addChild() - reparenting node: removing it and adding it again\n");
-    child->parent->children.remove(child);
+    child->parent->eraseChild(child);
   }
   child->parent = this;
@@ -581,5 +583,5 @@
   if (this->parent != NULL)
   {
-    this->parent->children.remove(this);
+    this->parent->eraseChild(this);
     this->parent = NULL;
   }
@@ -655,4 +657,11 @@
   if (parentNode != NULL)
     this->setParentSoft2D(parentNode, bias);
+}
+
+/** @param child the child to be erased from this Nodes List */
+void Element2D::eraseChild(Element2D* child)
+{
+  std::list<Element2D*>::iterator childIT = std::find(this->children.begin(), this->children.end(), child);
+  this->children.erase(childIT);
 }
 
@@ -733,5 +742,5 @@
     else if (unlikely(this->bindNode != NULL))
     {
-      GLdouble projectPos[3];
+      GLdouble projectPos[3] = {0, 0, 0};
       gluProject(this->bindNode->getAbsCoor().x,
                  this->bindNode->getAbsCoor().y,
Index: trunk/src/lib/graphics/render2D/element_2d.h
===================================================================
--- trunk/src/lib/graphics/render2D/element_2d.h	(revision 6139)
+++ trunk/src/lib/graphics/render2D/element_2d.h	(revision 6142)
@@ -195,4 +195,5 @@
 
   private:
+    void eraseChild(Element2D* child);
     /** tells the child that the parent's Coordinate has changed */
     inline void parentCoorChanged () { this->bRelCoorChanged = true; }
Index: trunk/src/lib/sound/sound_engine.cc
===================================================================
--- trunk/src/lib/sound/sound_engine.cc	(revision 6139)
+++ trunk/src/lib/sound/sound_engine.cc	(revision 6142)
@@ -141,7 +141,5 @@
     if (!this->ALSources.empty())
     {
-
       source = this->ALSources.top();
-      printf("test: : %d\n", source);
       this->ALSources.pop();
     }
Index: trunk/src/lib/sound/sound_source.cc
===================================================================
--- trunk/src/lib/sound/sound_source.cc	(revision 6139)
+++ trunk/src/lib/sound/sound_source.cc	(revision 6142)
@@ -69,5 +69,4 @@
     SoundEngine::getInstance()->popALSource(this->sourceID);
 
-  //printf("%d\n",sourceID);
   alSourceStop(this->sourceID);
   alSourcei (this->sourceID, AL_BUFFER, buffer->getID());
