Index: /orxonox/trunk/src/animation.cc
===================================================================
--- /orxonox/trunk/src/animation.cc	(revision 3859)
+++ /orxonox/trunk/src/animation.cc	(revision 3860)
@@ -29,4 +29,5 @@
   this->bHasKeys = false;
   this->bHandled = true;
+  this->bDelete = false;
   this->baseObject = NULL;
 
@@ -84,5 +85,5 @@
       break;
     case ANIM_INF_DELETE: // this will possibly never be made
-      //this->bDelete;
+      this->bDelete = true;
       break;
     }
Index: /orxonox/trunk/src/animation.h
===================================================================
--- /orxonox/trunk/src/animation.h	(revision 3859)
+++ /orxonox/trunk/src/animation.h	(revision 3860)
@@ -11,6 +11,4 @@
 
 // FORWARD DEFINITION
-
-#define DELTA_X 0.05  //!< the percentag of the distance that doesnt have to be done by neg_exp (asymptotical) ~ maschinendelta
 
 //! An enumerator of Functions to describe the flow of the Animation
@@ -47,4 +45,5 @@
  * Animation Functions
  * virtual tick
+ * addKeyFrame
  * List of keyFrames
  * currentKeyFrame/nextKeyFrame
@@ -73,4 +72,7 @@
   BaseObject* getBaseObject(void) const {return baseObject;}
 
+  /** \returns if the Animation should be deleted */
+  inline bool ifDelete(void) {return bDelete;}
+
  protected:
   Animation(void);
@@ -85,5 +87,5 @@
   bool bHandled;                  //!< If this Animation is handled by the AnimationPlayer.
   bool bRunning;                  //!< If the animation is running
-  //  bool bDelete;                   //!< If true, the animation will be deleted through the AnimationPlayer.
+  bool bDelete;                   //!< If true, the animation will be deleted through the AnimationPlayer.
 };
 
Index: /orxonox/trunk/src/animation_player.cc
===================================================================
--- /orxonox/trunk/src/animation_player.cc	(revision 3859)
+++ /orxonox/trunk/src/animation_player.cc	(revision 3860)
@@ -17,4 +17,6 @@
 
 #include "animation_player.h"
+
+#include "compiler.h"
 
 using namespace std;
@@ -120,4 +122,9 @@
 	{
 	  anim->tick(timePassed);
+	  if(unlikely(anim->ifDelete()))
+	  {
+	    this->animationList->remove(anim);
+	    delete anim;
+	  }
 	  anim = animIt->nextElement();
 	}
Index: /orxonox/trunk/src/defs/compiler.h
===================================================================
--- /orxonox/trunk/src/defs/compiler.h	(revision 3860)
+++ /orxonox/trunk/src/defs/compiler.h	(revision 3860)
@@ -0,0 +1,24 @@
+
+#ifndef _COMPILER_H
+#define _COMPILER_H
+
+/* performance tweaking stuff */
+#if __GNUC__ == 2 && __GNUC_MINOR__ < 96
+#define __builtin_expect(x, expected_value) (x)
+#endif
+
+#define likely(x)	__builtin_expect((x),1)
+#define unlikely(x)	__builtin_expect((x),0)
+
+#ifdef __unix__
+
+// deprecated //
+ #define __LIKELY_IF(condition)  if( likely(condition))
+ #define __UNLIKELY_IF(condition) if( unlikely(condition))
+#else
+ #define __LIKELY_IF(condition)  if( condition)
+ #define __UNLIKELY_IF(condition) if( condition)
+#endif
+
+
+#endif /* _COMPILER_H */
Index: /orxonox/trunk/src/defs/stdincl.h
===================================================================
--- /orxonox/trunk/src/defs/stdincl.h	(revision 3859)
+++ /orxonox/trunk/src/defs/stdincl.h	(revision 3860)
@@ -29,14 +29,5 @@
 #include "debug.h"
 
-
-/* performance tweaking stuff */
-#ifdef __unix__
- #include <linux/compiler.h>
- #define __LIKELY_IF(condition)  if( likely(condition))
- #define __UNLIKELY_IF(condition) if( unlikely(condition))
-#else
- #define __LIKELY_IF(condition)  if( condition)
- #define __UNLIKELY_IF(condition) if( condition)
-#endif
+#include "compiler.h"
 
 #endif /* _STDINCL_H */
Index: /orxonox/trunk/src/lib/coord/p_node.cc
===================================================================
--- /orxonox/trunk/src/lib/coord/p_node.cc	(revision 3859)
+++ /orxonox/trunk/src/lib/coord/p_node.cc	(revision 3860)
@@ -22,4 +22,5 @@
 #include "p_node.h"
 #include "stdincl.h"
+#include "compiler.h"
 
 #include "error.h"
@@ -61,5 +62,5 @@
   *this->absCoordinate = absCoordinate;
 
-  __LIKELY_IF(parent != NULL)
+  if (likely(parent != NULL))
   {
     *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
@@ -208,5 +209,5 @@
 {
 
-  __UNLIKELY_IF( this->bAbsCoorChanged)
+  if( unlikely(this->bAbsCoorChanged))
     {
       *this->absCoordinate = *this->absCoordinate + shift;
@@ -316,5 +317,5 @@
 void PNode::addChild (PNode* pNode, int parentingMode)
 {
-  __LIKELY_IF( pNode->parent != NULL)
+  if( likely(pNode->parent != NULL))
     {
       PRINTF(3)("PNode::addChild() - reparenting node: removing it and adding it again\n");
@@ -436,12 +437,12 @@
 
 
-  __LIKELY_IF( this->mode & PNODE_MOVEMENT)
+  if( likely(this->mode & PNODE_MOVEMENT))
     {
-      __UNLIKELY_IF(this->bAbsCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
+      if( unlikely(this->bAbsCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
 	{
 	  /* if you have set the absolute coordinates this overrides all other changes */
 	  *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
 	}
-      __LIKELY_IF(this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
+      if( likely(this->bRelCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
 
 	{
@@ -449,5 +450,5 @@
 
 	  /*
-	  __UNLIKELY_IF( this->parent == NULL)
+	  if( unlikely(this->parent == NULL))
 	    {
 	      *this->absCoordinate = *this->relCoordinate;
@@ -460,10 +461,10 @@
   if( this->mode & PNODE_LOCAL_ROTATE)
     {
-      __UNLIKELY_IF( this->bAbsDirChanged /*&& this->timeStamp != DataTank::timeStamp*/)
+      if( unlikely(this->bAbsDirChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
 	{
 	  /* if you have set the absolute coordinates this overrides all other changes */
 	  *this->relDirection = *this->absDirection - parent->getAbsDir();
 	}
-      else __LIKELY_IF( this->bRelDirChanged /*&& this->timeStamp != DataTank::timeStamp*/)
+      else if( likely(this->bRelDirChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
 	{
 	  /* update the current absDirection - remember * means rotation around sth.*/
@@ -474,10 +475,10 @@
   if( this->mode & PNODE_ROTATE_MOVEMENT)
     {
-      __UNLIKELY_IF( this->bAbsCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
+      if( unlikely(this->bAbsCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
 	{
 	  /* if you have set the absolute coordinates this overrides all other changes */
 	  *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
 	}
-      else __LIKELY_IF( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
+      else if( likely(this->bRelCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
 	{
 	  /*this is bad style... must be deleted later - just for testing*/
@@ -496,7 +497,7 @@
     { 
       /* if this node has changed, make sure, that all children are updated also */
-      __LIKELY_IF( this->bRelCoorChanged || this->bAbsCoorChanged)
+      if( likely(this->bRelCoorChanged || this->bAbsCoorChanged))
 	pn->parentCoorChanged ();
-      __LIKELY_IF( this->bRelDirChanged || this->bAbsDirChanged)
+      if( likely(this->bRelDirChanged || this->bAbsDirChanged))
 	pn->parentDirChanged ();
 
Index: /orxonox/trunk/src/lib/math/vector.cc
===================================================================
--- /orxonox/trunk/src/lib/math/vector.cc	(revision 3859)
+++ /orxonox/trunk/src/lib/math/vector.cc	(revision 3860)
@@ -1,4 +1,2 @@
-
-
 /* 
    orxonox - the future of 3D-vertical-scrollers
@@ -66,5 +64,5 @@
 Vector Vector::operator/ (float f) const
 {
-  __UNLIKELY_IF( f == 0.0)
+  if( unlikely(f == 0.0))
   {
     // Prevent divide by zero
@@ -105,9 +103,9 @@
 {
   float l = len();
-  __UNLIKELY_IF(l != 1.0)
+  if(unlikely(l != 1.0))
     {
       return this;
     }
-  else __UNLIKELY_IF(l == 0.0)
+  else if(unlikely(l == 0.0))
     {
       return 0;
Index: /orxonox/trunk/src/lib/math/vector.h
===================================================================
--- /orxonox/trunk/src/lib/math/vector.h	(revision 3859)
+++ /orxonox/trunk/src/lib/math/vector.h	(revision 3860)
@@ -10,5 +10,5 @@
 
 #include <math.h>
-#include "stdincl.h"
+#include "compiler.h"
 //! PI the circle-constant
 #define PI 3.14159265359f
@@ -41,5 +41,5 @@
   inline void normalize() { 
                       float l = len(); 
-		      __UNLIKELY_IF( l == 0.0) 
+		      if( unlikely(l == 0.0)) 
 			{ 
 			  // Prevent divide by zero
Index: /orxonox/trunk/src/lib/util/list.h
===================================================================
--- /orxonox/trunk/src/lib/util/list.h	(revision 3859)
+++ /orxonox/trunk/src/lib/util/list.h	(revision 3860)
@@ -3,5 +3,8 @@
 #define _LIST_H
 
-#include "stdincl.h"
+#include "compiler.h"
+#ifndef NULL
+#define NULL 0
+#endif
 
 //! An enum to list all the modes available when adding an object to a List
@@ -38,5 +41,5 @@
     listElement* next;
   };
-  Uint32 size;
+  unsigned int size;
   listElement* first;
   listElement* last;
@@ -118,5 +121,5 @@
 
  private:
-  Uint32 size;
+  unsigned int size;
   listElement<T>* first;
   listElement<T>* last;
@@ -153,5 +156,5 @@
 inline void tList<T>::add(T* entity)
 {
-  __UNLIKELY_IF( entity == NULL) return;
+  if( unlikely(entity == NULL)) return;
   listElement<T>* el = new listElement<T>;
   el->prev = this->last;
@@ -161,5 +164,5 @@
   this->last = el;
 
-  __UNLIKELY_IF(el->prev == NULL) this->first = el; /* if first element */
+  if( unlikely(el->prev == NULL)) this->first = el; /* if first element */
   else el->prev->next = el;
   this->size++;
@@ -174,10 +177,10 @@
   while( this->currentEl != NULL)
     {
-      __UNLIKELY_IF( this->currentEl->curr == entity)
+      if( unlikely(this->currentEl->curr == entity))
 	{ 
-	  __UNLIKELY_IF( this->currentEl->prev  == NULL ) this->first = this->currentEl->next;
+	  if( unlikely(this->currentEl->prev  == NULL)) this->first = this->currentEl->next;
 	  else this->currentEl->prev->next = this->currentEl->next;
 
-	  __UNLIKELY_IF( this->currentEl->next == NULL) this->last = this->currentEl->prev;
+	  if( unlikely(this->currentEl->next == NULL)) this->last = this->currentEl->prev;
 	  else this->currentEl->next->prev = this->currentEl->prev;
 
Index: /orxonox/trunk/src/t_animation.h
===================================================================
--- /orxonox/trunk/src/t_animation.h	(revision 3859)
+++ /orxonox/trunk/src/t_animation.h	(revision 3860)
@@ -22,4 +22,6 @@
 
 #include "animation.h"
+
+#define DELTA_X 0.05  //!< the percentag of the distance that doesnt have to be done by neg_exp (asymptotical) ~ maschinendelta
 
 //! A Class to handle some animation for single floated values.
