Index: trunk/src/lib/particles/particle_system.cc
===================================================================
--- trunk/src/lib/particles/particle_system.cc	(revision 7299)
+++ trunk/src/lib/particles/particle_system.cc	(revision 7300)
@@ -14,5 +14,5 @@
 */
 
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GRAPHICS
+#define DEBUG_SPECIAL_MODULE 5 //DEBUG_MODULE_GRAPHICS
 
 #include "particle_system.h"
@@ -40,42 +40,4 @@
 ParticleSystem::ParticleSystem (unsigned int maxCount)
 {
-  this->init();
-
-  this->setMaxCount(maxCount);
-}
-
-/**
- *  standard deconstructor
-*/
-ParticleSystem::~ParticleSystem()
-{
-  // deleting all the living Particles
-  while (this->particles)
-  {
-    Particle* tmpDelPart = this->particles;
-    this->particles = this->particles->next;
-    delete tmpDelPart;
-  }
-
-  // deleting all the dead particles
-  while (this->deadList)
-  {
-    Particle* tmpDelPart = this->deadList;
-    this->deadList = this->deadList->next;
-    delete tmpDelPart;
-  }
-
-  while(!this->emitters.empty())
-  {
-    this->removeEmitter(this->emitters.front());
-  }
-
-}
-
-/**
- * @brief initializes the ParticleSystem with default values
- */
-void ParticleSystem::init()
-{
   this->setClassID(CL_PARTICLE_SYSTEM, "ParticleSystem");
 
@@ -84,8 +46,38 @@
   this->particles = NULL;
   this->deadList = NULL;
-  this->setConserve(1);
-  this->setLifeSpan(1);
+  this->conserve = 1.0;
+  this->lifeSpan = 1.0; this->randomLifeSpan = 0.0;
 
   this->toList(OM_ENVIRON);
+
+  this->maxCount = maxCount;
+}
+
+/**
+ *  standard deconstructor
+*/
+ParticleSystem::~ParticleSystem()
+{
+  // deleting all the living Particles
+  while (this->particles)
+  {
+    Particle* tmpDelPart = this->particles;
+    this->particles = this->particles->next;
+    delete tmpDelPart;
+  }
+
+  // deleting all the dead particles
+  while (this->deadList)
+  {
+    Particle* tmpDelPart = this->deadList;
+    this->deadList = this->deadList->next;
+    delete tmpDelPart;
+  }
+
+  while(!this->emitters.empty())
+  {
+    this->removeEmitter(this->emitters.front());
+  }
+
 }
 
@@ -127,6 +119,6 @@
 
   LoadParam(root, "precache", this, ParticleSystem, precache)
-      .describe("Precaches the ParticleSystem for %1 seconds, %2 times per Second")
-      .defaultValues(1.0, 25.0);
+  .describe("Precaches the ParticleSystem for %1 seconds, %2 times per Second")
+  .defaultValues(1.0, 25.0);
 }
 
@@ -160,14 +152,17 @@
 
 /**
-* @param maxCount the maximum count of particles that can be emitted
- */
-void ParticleSystem::setMaxCount(int maxCount)
+ * @param maxCount the maximum count of particles that can be emitted
+ */
+void ParticleSystem::setMaxCount(unsigned int maxCount)
 {
   this->maxCount = maxCount;
+  PRINTF(4)("MAXCOUNT of %s::%s is %d\n", this->getClassName(), this->getName(),maxCount);
 }
 
 // setting properties
 /**
- *  Sets the lifespan of newly created particles
+ * @brief Sets the lifespan of newly created particles
+ * @param lifeSpan the LifeSpan of each particle in the System
+ * @param randomLifeSpan the Deviation from lifeSpan (random Value).
 */
 void ParticleSystem::setLifeSpan(float lifeSpan, float randomLifeSpan)
@@ -175,9 +170,13 @@
   this->lifeSpan = lifeSpan;
   this->randomLifeSpan = randomLifeSpan;
-}
-
-/**
- *  sets the conserve Factor of newly created particles
-*/
+  PRINTF(4)("LifeTime of %s::%s is %f\n", this->getClassName(), this->getName(), lifeSpan);
+}
+
+/**
+ * @brief sets the conserve Factor of newly created particles
+ * @param conserve sets the conserve factor of each particle.
+ * Conserve is the ammount of energy a particle takes from the last Frame into the next.
+ * A Value of 1 means, that all energy is conserved, a Value of 0 means infinit friction.
+ */
 void ParticleSystem::setConserve(float conserve)
 {
@@ -188,4 +187,6 @@
   else
     this->conserve = conserve;
+
+  PRINTF(4)("Conserve of %s::%s is %f\n", this->getClassName(), this->getName(),conserve);
 }
 
@@ -194,5 +195,5 @@
 /////////////////////////////
 /**
- *  sets a key in the radius-animation on a per-particle basis
+ * @brief sets a key in the radius-animation on a per-particle basis
  * @param lifeCycleTime the time (partilceLifeTime/particleAge) [0-1]
  * @param radius the radius at this position
@@ -203,8 +204,11 @@
   this->radiusAnim.changeEntry(lifeCycleTime, radius);
   this->randRadiusAnim.changeEntry(lifeCycleTime, randRadius);
-}
-
-/**
- *  sets a key in the mass-animation on a per-particle basis
+
+  PRINTF(4)("Radius of %s::%s at timeSlice %f is %f with a Random of %f\n",
+    this->getClassName(), this->getName(),lifeCycleTime, radius, randRadius);
+}
+
+/**
+ * @brief sets a key in the mass-animation on a per-particle basis
  * @param lifeCycleTime the time (partilceLifeTime/particleAge) [0-1]
  * @param mass the mass at this position
@@ -218,5 +222,5 @@
 
 /**
- *  sets a key in the color-animation on a per-particle basis
+ * @brief sets a key in the color-animation on a per-particle basis
  * @param lifeCycleTime: the time (partilceLifeTime/particleAge) [0-1]
  * @param red: red
@@ -231,4 +235,7 @@
   this->colorAnim[2].changeEntry(lifeCycleTime, blue);
   this->colorAnim[3].changeEntry(lifeCycleTime, alpha);
+
+  PRINTF(4)("Color of %s::%s on timeslice %f is r:%f g:%f b:%f a:%f\n",
+    this->getClassName(), this->getName(), lifeCycleTime, red, green, blue, alpha);
 }
 
@@ -267,5 +274,4 @@
 void ParticleSystem::precache(unsigned int seconds, unsigned int ticksPerSecond)
 {
-
   std::list<ParticleEmitter*>::iterator emitter;
   for (emitter = this->emitters.begin(); emitter != this->emitters.end(); emitter++)
@@ -280,5 +286,5 @@
 
 /**
- *  ticks the system.
+ * @brief ticks the system.
  * @param dt the time to tick all the Particles of the System
 
@@ -357,5 +363,5 @@
   * @param field the Field to apply.
  */
-void ParticleSystem::applyField(Field* field)
+void ParticleSystem::applyField(const Field* field)
 {
   Particle* tickPart = particles;
@@ -376,46 +382,6 @@
 }
 
-
-/**
- *  draws all the Particles of this System
-
-   The Cases in this Function all do the same:
-   Drawing all the particles with the appropriate Type.
-   This is just the fastest Way to do this, but will most likely be changed in the future.
- */
-// void ParticleSystem::draw() const
-// {
-//   glPushAttrib(GL_ENABLE_BIT);
-//
-//   Particle* drawPart = particles;
-//
-//   switch (this->particleType)
-//   {
-//
-//     case PARTICLE_MODEL:
-//       {
-//       }
-//       break;
-//
-//     case PARTICLE_DOT:
-//       glDisable(GL_LIGHTING);
-//       glBegin(GL_POINTS);
-//       while (likely(drawPart != NULL))
-//       {
-//         glColor4fv(drawPart->color);
-//
-//         glLineWidth(drawPart->radius);
-//
-//         glVertex3f(drawPart->position.x, drawPart->position.y, drawPart->position.z);
-//         drawPart = drawPart->next;
-//       }
-//       glEnd();
-//       break;
-//   }
-//   glPopAttrib();
-// }
-
-/**
- *  adds a new Particle to the System
+/**
+ * @brief adds a new Particle to the System
  * @param position the initial position, where the particle gets emitted.
  * @param velocity the initial velocity of the particle.
@@ -477,5 +443,5 @@
   }
   else
-    PRINTF(5)("maximum count of particles reached not adding any more\n");
+    PRINTF(4)("maximum count of particles reached not adding any more\n");
 }
 
@@ -485,6 +451,10 @@
 void ParticleSystem::debug() const
 {
-  PRINT(0)("  ParticleCount: %d emitters: %d, maximumCount: %d :: filled %d%%\n", this->count, this->emitters.size(), this->maxCount, ((this->maxCount!=0)?100*this->count/this->maxCount:0));
-  if (deadList)
+  PRINT(0)("  ParticleCount: %d emitters: %d, maximumCount: %d :: filled %d%%\n",
+           this->count,
+           this->emitters.size(),
+           this->maxCount,
+           ((this->maxCount!=0)?100*this->count/this->maxCount:0));
+  if (this->deadList)
   {
     PRINT(0)("  - ParticleDeadList is used: ");
Index: trunk/src/lib/particles/particle_system.h
===================================================================
--- trunk/src/lib/particles/particle_system.h	(revision 7299)
+++ trunk/src/lib/particles/particle_system.h	(revision 7300)
@@ -60,5 +60,4 @@
   virtual ~ParticleSystem();
 
-  void init();
   virtual void loadParams(const TiXmlElement* root);
   void loadEmitters(const TiXmlElement* root);
@@ -66,5 +65,5 @@
   void setLifeSpan(float lifeSpan, float randomLifeSpan = 0.0);
   void setConserve(float conserve);
-  void setMaxCount(int maxCount);
+  void setMaxCount(unsigned int maxCount);
 
   /* Per-Particle-Attributes */
@@ -94,5 +93,5 @@
   void removeEmitter(ParticleEmitter* emitter);
 
-  virtual void applyField(Field* field);
+  virtual void applyField(const Field* field);
   /** @brief this is an empty function, because the Physics are implemented in tick @param dt: useless here */
   virtual void tickPhys(float dt) {};
@@ -114,6 +113,6 @@
   float             randomInitialMass;   //!< The random initial Mass of the Particle
 
-  int               maxCount;            //!< The maximum count of Particles.
-  int               count;               //!< The current count of Particles.
+  unsigned int      maxCount;            //!< The maximum count of Particles.
+  unsigned int      count;               //!< The current count of Particles.
   Particle*         particles;           //!< A list of particles of this System.
   Particle*         deadList;            //!< A list of dead Particles in the System.
Index: trunk/src/lib/util/executor/executor.cc
===================================================================
--- trunk/src/lib/util/executor/executor.cc	(revision 7299)
+++ trunk/src/lib/util/executor/executor.cc	(revision 7300)
@@ -53,7 +53,7 @@
 
   this->paramCount = 0;
-  for (unsigned int i = 0; i < FUNCTOR_MAX_ARGUMENTS; i++)
+  for (unsigned int i = 0; i <= FUNCTOR_MAX_ARGUMENTS; i++)
   {
-    if (this->defaultValue[i] == MT_NULL)
+    if (this->defaultValue[i] == MT_NULL || i == FUNCTOR_MAX_ARGUMENTS)
     {
       this->paramCount = i;
Index: trunk/src/lib/util/executor/executor.h
===================================================================
--- trunk/src/lib/util/executor/executor.h	(revision 7299)
+++ trunk/src/lib/util/executor/executor.h	(revision 7300)
@@ -121,5 +121,5 @@
 
 #define ExecutorFunctionPoiter5(t1, t2, t3, t4, t5) \
-  void EXECUTORINCLASS(*functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE); \
+  void EXECUTORINCLASS(*functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE);
 
 
@@ -218,8 +218,7 @@
 
 
-
-//////////\//////////
+/////////////////////
 // DYNAMIC FUNCTOR //
-///////////\/////////
+/////////////////////
 #ifdef FUNCTOR_LIST
 #undef FUNCTOR_LIST
Index: trunk/src/lib/util/substring.h
===================================================================
--- trunk/src/lib/util/substring.h	(revision 7299)
+++ trunk/src/lib/util/substring.h	(revision 7300)
@@ -31,9 +31,7 @@
   unsigned int split(const std::string& string, const std::string& splitters, char escapeChar ='\\', char safemode_char = '"', char comment_char = '\0');
 
-
+  inline unsigned int getCount() { return this->strings.size(); };
+  const std::string& getString(unsigned int i) { return (i < this->strings.size()) ? this->strings[i] : emptyString; }; // safety-precaution
   const std::string& operator[](unsigned int i) { return this->getString(i); };
-
-  inline unsigned int getCount() { return this->strings.size(); };
-  const std::string& getString(unsigned int i) { return (i < this->strings.size()) ? this->strings[i] : emptyString; };
   unsigned int getOffset(unsigned int i);
 
