Index: orxonox/trunk/src/lib/particles/particle_system.cc
===================================================================
--- orxonox/trunk/src/lib/particles/particle_system.cc	(revision 4653)
+++ orxonox/trunk/src/lib/particles/particle_system.cc	(revision 4654)
@@ -95,4 +95,6 @@
   this->setType(PARTICLE_DEFAULT_TYPE, 1);
   ParticleEngine::getInstance()->addSystem(this);
+
+  colorAnim[0].setName("test"); //!< \todo delete this line
 }
 
Index: orxonox/trunk/src/lib/particles/quick_animation.cc
===================================================================
--- orxonox/trunk/src/lib/particles/quick_animation.cc	(revision 4653)
+++ orxonox/trunk/src/lib/particles/quick_animation.cc	(revision 4654)
@@ -34,22 +34,27 @@
    this->setClassID(CL_QUICK_ANIMATION, "QuickAnimation");
 
-   this->first = this->current = NULL;
-}
-
-/**
-   \brief standard deconstructor
-
+   // initialize the First KeyFrame (will be deleted if a new one gets created)
+   this->count = 0;
+   this->first = this->current = new QuickKeyFrame;
+   this->first->next = this->first->prev = this->first;
+   this->first->position = 0.0;
+   this->first->value = 0.0;
+}
+
+/**
+   \brief deletes all the deconstructor stuff
 */
 QuickAnimation::~QuickAnimation (void)
 {
   this->current = this->first;
-  QuickKeyFrame delKF;
-
-  while (this->current != NULL)
-    {
-      this->first = this->current->next;
-      delete this->current;
-      this->current = this->first;
-    }
+  QuickKeyFrame* delKF = this->first;
+
+  do
+  {
+    delKF = this->current;
+    this->current = this->current->next;
+    delete delKF;
+  }  while (this->current != this->first);
+
 }
 
@@ -60,37 +65,69 @@
    \returns false if the key existed already for a given position
 */
-bool QuickAnimation::addEntry(float position, float value)
-{
-  this->current = this->first;
-  while (this->current != NULL)
+void QuickAnimation::addEntry(float position, float value)
+{
+  if (this->getName())
+  {
+    printf("ADDED KEYFRAME %d\n", this->count);
+  }
+
+  // create the new KeyFrame
+  QuickKeyFrame* newKey = new QuickKeyFrame;
+  newKey->position = position;
+  newKey->value = value;
+
+  // if we add a KeyFrame for the first Time:
+  if (unlikely (this->count == 0))
+  {
+    delete this->first;
+
+    newKey->next  = newKey;
+    newKey->prev  = newKey;
+    this->first   = newKey;
+    this->current = newKey;
+  }
+  // if the KeyFrame is in front of the FIRST keyFrame
+  else if (this->first->position > position)
+  {
+    newKey->next = this->first;
+    newKey->prev = this->first->prev;
+    newKey->prev->next = newKey;
+    newKey->next->prev = newKey;
+
+    this->first = newKey; // the new Key becomes the FIRST.
+  }
+  // if the KeyFrame is at the End of the Animation
+  else if (this->first->prev->position < position)
+  {
+    newKey->next = this->first;
+    newKey->prev = this->first->prev;
+    newKey->prev->next = newKey;
+    newKey->next->prev = newKey;
+  }
+  // if the Key is between two frames.
+  else
+  {
+    this->current = this->first;
+    do
     {
-      // if it is between some keyframes
-      if ((!this->current->next && this->current->position < position)
-          || (this->current->position < position && this->current->next->position > position))
+      if (this->current->position < position && this->current->next->position > position)
         break;
       // if it is the same as an already existing keyframe
       else if (this->current->position == position)
-        return false;
+      {
+        this->current->value = value;
+        delete newKey;
+        return;
+      }
       this->current = this->current->next;
-    }
-
-  QuickKeyFrame* newKey = new QuickKeyFrame;
-  if (this->first == NULL)
-    {
-      this->first = newKey;
-      this->current = newKey;
-      newKey->next = NULL;
-    }
-  else
-    {
-      newKey->next = this->current->next;
-      this->current->next = newKey;
-    }
-  newKey->value = value;
-  newKey->position = position;
-
-  this->current = this->first;
-
-  return true;
+    } while (this->current != this->first);
+
+    newKey->next = this->current->next;
+    newKey->prev = this->current;
+    newKey->next->prev = newKey;
+    newKey->prev->next = newKey;
+  }
+  this->current = this->first;
+  ++this->count;
 }
 
@@ -100,18 +137,21 @@
    \param region a deviation of the existing keyframe (like a delta in witch to search for
    \param value the new Value
-*/
-bool QuickAnimation::changeEntry(float position, float value, float region)
-{
-  this->current = this->first;
-  while (this->current)
-    {
-      if (this->current->position < position+region && this->current->position > position-region)
-        {
-          this->current->value = value;
-          return true;
-        }
-      this->current = this->current->next;
-    }
-  this->current = this->first;
+
+   \todo rimplement
+*/
+void QuickAnimation::changeEntry(float position, float value, float region)
+{
+//   this->current = this->first;
+//   do
+//   {
+//     if (this->current->position < position+region && this->current->position > position-region)
+//     {
+//       this->current->value = value;
+//       return;
+//     }
+//     this->current = this->current->next;
+//   }  while (this->current != this->first);
+//
+//   this->current = this->first;
 
   this->addEntry(position, value);
@@ -145,24 +185,29 @@
 float QuickAnimation::getValue(float position)
 {
-  if (unlikely(this->first == NULL))
-    return 0.0;
-  else if (unlikely (this->first->next == NULL))
-    return this->first->value;
-  else
+  int counter = 0;
+  while (true)
+  {
+    counter++;
+    if (counter >= 10)
     {
-      if (unlikely(position < this->current->position))
-        {
-          if (position <= this->first->position)
-            return this->first->value;
-          this->current = this->first;
-        }
-      while (likely(this->current->next != NULL && position > this->current->next->position))
-        this->current = this->current->next;
-      if (this->current->next == NULL)
-        return this->current->value;
-
+      printf("FUCK!!! %f\n", position);
+      this->debug();
+      break;
+
+    }
+    // if we have a match
+    if (likely(this->current->position <= position && this->current->next->position >= position))
       return this->current->value + (this->current->next->value - this->current->value)
-        * ((position-this->current->position) / (this->current->next->position -this->current->position));
-    }
+          * ((position-this->current->position) / (this->current->next->position -this->current->position));
+
+    else if (unlikely(this->first->prev->position < position))
+      return this->first->prev->value;
+    else if (unlikely(this->first->position > position))
+      return this->first->value;
+    else if(likely(this->current->next->position < position))
+      this->current = this->current->next;
+    else if (likely(this->current->position > position))
+      this->current = this->current->prev;
+  }
 }
 
@@ -174,10 +219,10 @@
   this->current = this->first;
 
-  PRINT(0)("QuickAnim:: (position, value)");
-  while(this->current)
+  PRINT(0)("QuickAnim(entries:%d)::(position, value)", this->count);
+  do
     {
       PRINT(0)("->(%f, %f)", this->current->position, this->current->value);
       this->current = this->current->next;
-    }
+    } while(this->current != this->first);
 
   PRINT(0)("\n");
Index: orxonox/trunk/src/lib/particles/quick_animation.h
===================================================================
--- orxonox/trunk/src/lib/particles/quick_animation.h	(revision 4653)
+++ orxonox/trunk/src/lib/particles/quick_animation.h	(revision 4654)
@@ -21,5 +21,4 @@
    this class is optimized for a raising value. eg. 100 particles sorted
    by age.
-  \todo speedUP this stuff (especially getValue)
 */
 class QuickAnimation : public BaseObject {
@@ -34,4 +33,5 @@
 
     QuickKeyFrame*   next;              //!< The next Animation
+    QuickKeyFrame*   prev;              //!< The previous QuickKeyFrame
   };
 
@@ -39,6 +39,6 @@
   virtual ~QuickAnimation();
 
-  bool addEntry(float position, float value);
-  bool changeEntry(float position, float value, float region = .04);
+  void addEntry(float position, float value);
+  void changeEntry(float position, float value, float region = .04);
 
   /** \todo implemente thos functions
@@ -52,6 +52,7 @@
 
  private:
-  QuickKeyFrame*       first;          //!< The first KeyFrame in a Sequence of Keyframes
-  QuickKeyFrame*       current;        //!< The currently selected KeyFrame
+  QuickKeyFrame*       first;          //!< The first KeyFrame in a Sequence of Keyframes.
+  QuickKeyFrame*       current;        //!< The currently selected KeyFrame.
+  unsigned int         count;          //!< How many Keyframes the QuickAnimation has.
 };
 
Index: orxonox/trunk/src/story_entities/world.cc
===================================================================
--- orxonox/trunk/src/story_entities/world.cc	(revision 4653)
+++ orxonox/trunk/src/story_entities/world.cc	(revision 4654)
@@ -484,7 +484,7 @@
   system->setMass (0.0, 1.0);
 
-  system->setColor(0, .5,0,0,1);
-  system->setColor(.5, 1,1,0,.01);
-  system->setColor(1.0, 0,0,0,0);
+  system->setColor(0, .5, 0, 0, 1);
+  system->setColor(.5, 1, 1, 0, .01);
+  system->setColor(1.0, 0, 0, 0, 0);
 
 
