Index: branches/christmas_branche/src/world_entities/world_entity.cc
===================================================================
--- branches/christmas_branche/src/world_entities/world_entity.cc	(revision 6167)
+++ branches/christmas_branche/src/world_entities/world_entity.cc	(revision 6169)
@@ -21,4 +21,5 @@
 
 #include "model.h"
+#include "md2Model.h"
 #include "resource_manager.h"
 #include "load_param.h"
@@ -56,4 +57,5 @@
   this->objectListNumber = OM_INIT;
   this->objectListIterator = NULL;
+  this->supportsLOD = false;
 
   this->toList(OM_NULL);
@@ -117,4 +119,5 @@
               this->loadModel(lodFile, scaling, i);
           }
+          this->supportsLOD = true;
         return;
       }
@@ -134,5 +137,9 @@
       {
         PRINTF(4)("fetching MD2 file: %s\n", fileName);
-        this->setModel((Model*)ResourceManager::getInstance()->load(fileName, MD2, RP_CAMPAIGN), 0);
+//         MD2Model* m = (MD2Model*)ResourceManager::getInstance()->load(fileName, MD2, RP_CAMPAIGN);
+        MD2Model* m = new MD2Model(fileName, "/home/boenzlip/orxonox/data/maps/santa_claus.pcx");
+        m->debug();
+        //this->setModel((Model*)ResourceManager::getInstance()->load(fileName, MD2, RP_CAMPAIGN), 0);
+        this->setModel((Model*)m, 0);
       }
   }
@@ -154,10 +161,12 @@
   {
     Resource* resource = ResourceManager::getInstance()->locateResourceByPointer(this->models[modelNumber]);
-    if (resource != NULL)
-      ResourceManager::getInstance()->unload(resource, RP_LEVEL);
-    else
-      delete this->models[modelNumber];
-  }
+//     if (resource != NULL)
+    ResourceManager::getInstance()->unload(resource, RP_LEVEL);
+  }
+  else
+    delete this->models[modelNumber];
+
   this->models[modelNumber] = model;
+
 
 //   if (this->model != NULL)
@@ -281,35 +290,59 @@
 }
 
+
+/**
+ *  this functions draws the model automaticaly in multiple LOD
+ */
 void WorldEntity::drawLODsafe() const
 {
-  if (!this->models.empty())
-  {
-    glMatrixMode(GL_MODELVIEW);
-    glPushMatrix();
-
-    /* translate */
-    glTranslatef (this->getAbsCoor ().x,
-                  this->getAbsCoor ().y,
-                  this->getAbsCoor ().z);
-    Vector tmpRot = this->getAbsDir().getSpacialAxis();
-    glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+  if (!unlikely(this->models.empty()))
+  {
+    if( likely(this->supportsLOD))
+    {
+      glMatrixMode(GL_MODELVIEW);
+      glPushMatrix();
+
+      /* translate */
+      glTranslatef (this->getAbsCoor ().x,
+                    this->getAbsCoor ().y,
+                    this->getAbsCoor ().z);
+      Vector tmpRot = this->getAbsDir().getSpacialAxis();
+      glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
 
 
     // This Draws the LOD's
-    float cameraDistance = (State::getCamera()->getAbsCoor() - this->getAbsCoor()).len();
-    if (cameraDistance > 30 && this->models.size() >= 3 && this->models[2] != NULL)
+      float cameraDistance = (State::getCamera()->getAbsCoor() - this->getAbsCoor()).len();
+      if (cameraDistance > 30 && this->models.size() >= 3 && this->models[2] != NULL)
+      {
+        this->models[2]->draw();
+      }
+      else if (cameraDistance > 10 && this->models.size() >= 2 && this->models[1] != NULL)
+      {
+        this->models[1]->draw();
+      }
+      else if (this->models.size() >= 1 && this->models[0] != NULL)
+      {
+        this->models[0]->draw();
+      }
+      glPopMatrix();
+    }
+    else // no LOD
     {
-       this->models[2]->draw();
+      glMatrixMode(GL_MODELVIEW);
+      glPushMatrix();
+
+      /* translate */
+      glTranslatef (this->getAbsCoor ().x,
+                    this->getAbsCoor ().y,
+                    this->getAbsCoor ().z);
+      Vector tmpRot = this->getAbsDir().getSpacialAxis();
+      glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+
+      this->models[0]->draw();
+
+      glPopMatrix();
     }
-    else if (cameraDistance > 10 && this->models.size() >= 2 && this->models[1] != NULL)
-    {
-      this->models[1]->draw();
-    }
-    else if (this->models.size() >= 1 && this->models[0] != NULL)
-    {
-      this->models[0]->draw();
-    }
-    glPopMatrix();
-  }
+  }
+
 }
 
