Index: /orxonox/trunk/src/subprojects/particles/particle_fun.cc
===================================================================
--- /orxonox/trunk/src/subprojects/particles/particle_fun.cc	(revision 4350)
+++ /orxonox/trunk/src/subprojects/particles/particle_fun.cc	(revision 4351)
@@ -21,20 +21,32 @@
 #include "particle_engine.h"
 
+#define PINIT_EMISSION_RATE          50
+#define PINIT_EMISSION_VELOCITY      5.0
+#define PINIT_SPREAD_ANGLE           0.1
+#define PINIT_EMITTER_TYPE           EMITTER_DOT
+#define PINIT_EMITTER_SIZE           1.0
+#define PINIT_START_RADIUS           5.0
+#define PINIT_END_RADIUS             0.0
+#define PINIT_LIFESPAN               1.0
+#define PINIT_CONSERVE_FACTOR        1.0
+#define PINIT_PARTICLE_TYPE          PARTICLE_SPRITE
+#define PINIT_INHERIT_SPEED          0.0
+
 
 void Framework::moduleInit(int argc, char** argv)
 {
   // Creating a Test Particle System
-  ParticleSystem* system = new ParticleSystem(100000, PARTICLE_SPRITE);
-  system->setRadius(0,0,0,0);
-  system->setLifeSpan(0);
-  system->setConserve(1.0);
+  ParticleSystem* system = new ParticleSystem(100000, PINIT_PARTICLE_TYPE);
+  system->setRadius(PINIT_START_RADIUS, PINIT_END_RADIUS ,0 ,0);
+  system->setLifeSpan(PINIT_LIFESPAN);
+  system->setConserve(PINIT_CONSERVE_FACTOR);
 
   // Creating a Test Particle Emitter
   ParticleEmitter* emitter = new ParticleEmitter(Vector(0 , 1, 0));
-  emitter->setEmissionRate(0);
-  emitter->setEmissionVelocity(0,0);
-  emitter->setSpread(0,0);
-  emitter->setType(EMITTER_DOT);
-  emitter->setSize(0);
+  emitter->setEmissionRate(PINIT_EMISSION_RATE);
+  emitter->setEmissionVelocity(PINIT_EMISSION_VELOCITY ,0);
+  emitter->setSpread(PINIT_SPREAD_ANGLE ,0);
+  emitter->setType(PINIT_EMITTER_TYPE);
+  emitter->setSize(PINIT_EMITTER_SIZE);
   // Add the Flow from the Emitter into the System
   ParticleEngine::getInstance()->addConnection(emitter, system);
@@ -123,5 +135,4 @@
   const char* name = option->getTitle();
   char* value = option->save();
-  printf("%s\n", value);
 
   ParticleSystem* tmpSys = ParticleEngine::getInstance()->getSystemByNumber(1);
@@ -168,5 +179,10 @@
 	  PRINT(3)("ParticleInheritSpeed set to %f\n", atof(value));
 	}
-
+      else if (!strcmp(name, "RandomColor"))
+	{
+	  tmpSys->setColor((float)rand()/RAND_MAX, (float)rand()/RAND_MAX, (float)rand()/RAND_MAX, 1, 
+			   (float)rand()/RAND_MAX, (float)rand()/RAND_MAX, (float)rand()/RAND_MAX, .5, 
+			   (float)rand()/RAND_MAX, (float)rand()/RAND_MAX, (float)rand()/RAND_MAX, 0);
+	}
     }
   delete value;
@@ -191,4 +207,6 @@
 	  Slider* EmissionRate = new Slider("EmissionRate", 0, 1000);
 	  EmissionRate->connectSignal("value_changed", (void*)EmissionRate, emitterChange );
+	  EmissionRate->setValue(PINIT_EMISSION_RATE);
+	  EmissionRate->redraw();
 	  emitterBox->fill(EmissionRate);
 	  
@@ -197,4 +215,6 @@
 	  velocity->setExactness(2);
 	  velocity->connectSignal("value_changed", (void*)velocity, emitterChange );
+	  velocity->setValue(PINIT_EMISSION_VELOCITY);
+	  velocity->redraw();
 	  emitterBox->fill(velocity);
 	  
@@ -203,4 +223,6 @@
 	  SpreadAngle->setExactness(3);
 	  SpreadAngle->connectSignal("value_changed", (void*)SpreadAngle, emitterChange );
+	  SpreadAngle->setValue(PINIT_SPREAD_ANGLE);
+	  SpreadAngle->redraw();
 	  emitterBox->fill(SpreadAngle);
 
@@ -210,6 +232,6 @@
 	  EmitterType->addItem("EMITTER_PLANE");
 	  EmitterType->addItem("EMITTER_CUBE");
+	  EmitterType->connectSignal("changed", (void*)EmitterType, emitterChange );
 	  EmitterType->load("EMITTER_DOT");
-	  EmitterType->connectSignal("changed", (void*)EmitterType, emitterChange );
 	  emitterBox->fill(EmitterType);
 
@@ -218,4 +240,6 @@
 	  EmitterSize->setExactness(1);
 	  EmitterSize->connectSignal("value_changed", (void*)EmitterSize, emitterChange );
+	  EmitterSize->setValue(PINIT_EMITTER_SIZE);
+	  EmitterSize->redraw();
 	  emitterBox->fill(EmitterSize);
 	}
@@ -232,4 +256,6 @@
 	  StartRadius->setExactness(3);
 	  StartRadius->connectSignal("value_changed", (void*)StartRadius, systemChange );
+	  StartRadius->setValue(PINIT_START_RADIUS);
+	  StartRadius->redraw();
 	  systemBox->fill(StartRadius);
 
@@ -238,4 +264,6 @@
 	  EndRadius->setExactness(3);
 	  EndRadius->connectSignal("value_changed", (void*)EndRadius, systemChange );
+	  EndRadius->setValue(PINIT_END_RADIUS);
+	  EndRadius->redraw();
 	  systemBox->fill(EndRadius);
 
@@ -244,4 +272,6 @@
 	  LifeSpan->setExactness(3);
 	  LifeSpan->connectSignal("value_changed", (void*)LifeSpan, systemChange );
+	  LifeSpan->setValue(PINIT_LIFESPAN);
+	  LifeSpan->redraw();
 	  systemBox->fill(LifeSpan);
 	  
@@ -249,6 +279,7 @@
 	  Slider* ConserveFactor = new Slider("ConserveFactor", 0, 1);
 	  ConserveFactor->setExactness(3);
-	  ConserveFactor->load("1.0");
 	  ConserveFactor->connectSignal("value_changed", (void*)ConserveFactor, systemChange );
+	  ConserveFactor->setValue(PINIT_CONSERVE_FACTOR);
+	  ConserveFactor->redraw();
 	  systemBox->fill(ConserveFactor);
 
@@ -258,6 +289,6 @@
 	  ParticleType->addItem("PARTICLE_SPARK");
 	  ParticleType->addItem("PARTICLE_SPRITE");
+	  ParticleType->connectSignal("changed", (void*)ParticleType, systemChange );	  
 	  ParticleType->load("PARTICLE_SPRITE");
-	  ParticleType->connectSignal("changed", (void*)ParticleType, systemChange );	  
 	  systemBox->fill(ParticleType);
 	  
@@ -268,4 +299,7 @@
 	  systemBox->fill(InheritSpeed);
 
+	  Button* RandomColor = new Button("RandomColor");
+	  RandomColor->connectSignal("released", (void*)RandomColor, systemChange);
+	  systemBox->fill(RandomColor);
 
 	}
