Index: /orxonox/branches/particleEngine/src/lib/graphics/particles/particle_engine.cc
===================================================================
--- /orxonox/branches/particleEngine/src/lib/graphics/particles/particle_engine.cc	(revision 3944)
+++ /orxonox/branches/particleEngine/src/lib/graphics/particles/particle_engine.cc	(revision 3945)
@@ -53,16 +53,44 @@
 
 /**
-   \brief standard destructor
-
+   \brief deletes all the system, emitters, connections and Lists
 */
 ParticleEngine::~ParticleEngine () 
 {
+  // delete all remaining systems
+  tIterator<ParticleSystem>* sysIt = this->systemList->getIterator();
+  ParticleSystem* tmpSys = sysIt->nextElement();
+  while(tmpSys)
+    {
+      delete tmpSys;
+      tmpSys = sysIt->nextElement();
+    }
+  delete sysIt;
   delete this->systemList;
 
-  delete this->connectionList;
+  // delete all remaining emitters
+  tIterator<ParticleEmitter>* emitIt = this->emitterList->getIterator();
+  ParticleEmitter* tmpEmit = emitIt->nextElement();
+  while(tmpEmit)
+    {
+      delete tmpEmit;
+      tmpEmit = emitIt->nextElement();
+    }
+  delete emitIt;
+  delete this->emitterList;
+
+  // there should be no more Connections
+  if (this->connectionList->getSize() == 0)
+    delete this->connectionList;
+  else
+    PRINTF(2)("The Connection List is not empty. This should not happen.\n");
 
   ParticleEngine::singletonRef = NULL;
 }
 
+/**
+   \brief Adds a System to the System list.
+
+   this is done automatically when creating a ParticleSystem
+*/
 void ParticleEngine::addSystem(ParticleSystem* system)
 {
@@ -70,4 +98,9 @@
 }
 
+/**
+   \brief Adds an emitter to the emitterList
+
+   this is done automatically when creating a ParticleEmitter
+*/
 void ParticleEngine::addEmitter(ParticleEmitter* emitter)
 {
@@ -76,7 +109,7 @@
 
 /**
-   \brief
-
-   \todo header, check for double connections
+   \brief Connects a ParticleSystem to a ParticleSystem thus emitting Particles.
+   \param emitter the Emitter to connect to the System
+   \param system the System to connect to the Emitter
 */
 void ParticleEngine::addConnection(ParticleEmitter* emitter, ParticleSystem* system)
@@ -107,5 +140,8 @@
 }
 
-
+/**
+   \brief Removes a system from the systemList and also removes all Connections to the System
+   \param system The ParticleSystem to delete
+*/
 bool ParticleEngine::removeSystem(ParticleSystem* system)
 {
@@ -125,4 +161,8 @@
 }
 
+/**
+   \brief removes an emitter from the emitterList and also from all Connections it is attached to.
+   \param emitter the ParticleEmitter to remove.
+*/
 bool ParticleEngine::removeEmitter(ParticleEmitter* emitter)
 {
@@ -142,5 +182,12 @@
 }
 
-
+/**
+   \brief removes a Connection between an Emitter and a System
+   \param emitter The emitter of the connection to remove
+   \param system The system of the connection to remove
+   \returns true, if the connection was broken, false if the conntection was not found
+
+   only if both system and emitter are in the connection the Connection will be broken
+*/
 bool ParticleEngine::breakConnection(ParticleEmitter* emitter, ParticleSystem* system)
 {
@@ -150,14 +197,26 @@
   while(tmpConnection)
     {
-      if (tmpConnection->emitter == emitter && tmpConnection->system == system)
+    if (tmpConnection->emitter == emitter && tmpConnection->system == system)
+      {
 	this->breakConnection(tmpConnection);
-      tmpConnection = tmpConIt->nextElement();
-    }
-  delete tmpConIt;  
-}
-
+	delete tmpConIt;
+	return true;
+      }
+    tmpConnection = tmpConIt->nextElement();
+    }
+  delete tmpConIt;
+  return false;
+}
+
+/**
+   \brief removes a Connection between an Emitter and a System
+   \param connection the connection to remove
+
+   \see bool ParticleEngine::breakConnection(ParticleEmitter* emitter, ParticleSystem* system)
+*/
 bool ParticleEngine::breakConnection(ParticleConnection* connection)
 {
   this->connectionList->remove(connection);
+  return true;
 }
 
@@ -169,5 +228,5 @@
 void ParticleEngine::tick(float dt)
 {
-  // add new Particles to each System they are connected to.
+  // add new Particles to each System connected to an Emitter.
   tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator();
   ParticleConnection* tmpConnection = tmpConIt->nextElement();
@@ -191,5 +250,7 @@
 }
 
-
+/**
+   \brief draws all the systems and their Particles.
+*/
 void ParticleEngine::draw(void)
 {
Index: /orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.cc
===================================================================
--- /orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.cc	(revision 3944)
+++ /orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.cc	(revision 3945)
@@ -52,5 +52,4 @@
 /**
    \brief standard deconstructor
-
 */
 ParticleSystem::~ParticleSystem() 
@@ -60,4 +59,8 @@
 }
 
+/**
+   \brief sets the Name of the Particle System
+   \param name the Name of the System
+*/
 void ParticleSystem::setName(const char* name)
 {
@@ -68,4 +71,7 @@
 }
 
+/**
+   \returns the Name of the ParticleSystem
+*/
 const char* ParticleSystem::getName(void) const
 {
@@ -73,5 +79,7 @@
 }
 
-
+/**
+   \todo this will be different
+*/
 void ParticleSystem::setType(PARTICLE_TYPE particleType, int count)
 {
@@ -93,11 +101,11 @@
   glBegin(GL_TRIANGLE_STRIP);
   glTexCoord2f(1, 1);
-  glVertex3f(0.0, 1.0, 1.0);
+  glVertex3f(0.0, .5, .5);
   glTexCoord2f(1, 0);
-  glVertex3f(0.0, 1.0, 0.0);
+  glVertex3f(0.0, .5, -.5);
   glTexCoord2f(0, 1);
-  glVertex3f(0.0, 0.0, 1.0);
+  glVertex3f(0.0, -.5, .5);
   glTexCoord2f(0, 0);
-  glVertex3f(0.0, 0.0, 0.0);
+  glVertex3f(0.0, -.5, -.5);
   glEnd();
   glEndList();
@@ -130,5 +138,7 @@
 }
 
-
+/**
+   \brief Sets the lifespan of newly created particles
+*/   
 void ParticleSystem::setLifeSpan(float lifeSpan, float randomLifeSpan)
 {
@@ -137,4 +147,7 @@
 }
 
+/**
+   \brief sets the radius of newly created particles
+*/
 void ParticleSystem::setRadius(float startRadius, float endRadius, float randomStartRadius, float randomEndRadius)
 {
@@ -145,4 +158,7 @@
 }
 
+/**
+   \brief sets the conserve Factor of newly created particles
+*/
 void ParticleSystem::setConserve(float conserve)
 {
@@ -155,6 +171,10 @@
 }
 
-
-
+/**
+   \brief ticks the system.
+   \param dt the time to tick all the Particles of the System
+
+   this is used to get all the particles some motion
+*/
 void ParticleSystem::tick(float dt)
 {
@@ -200,4 +220,7 @@
 }
 
+/**
+   \brief draws all the Particles of this System
+*/
 void ParticleSystem::draw(void)
 {
@@ -227,5 +250,10 @@
 }
 
-
+/**
+   \brief adds a new Particle to the System
+   \param position the position where the particle gets emitted.
+   \param velocity the Starting velocity of the particle.
+   \param data some more data given by the emitter
+*/
 void ParticleSystem::addParticle(Vector position, Vector velocity, unsigned int data)
 {
@@ -261,5 +289,4 @@
 }
 
-
 /**
    \brief outputs some nice debug information
