Index: orxonox/trunk/src/lib/graphics/importer/md2Model.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/md2Model.cc	(revision 4357)
+++ orxonox/trunk/src/lib/graphics/importer/md2Model.cc	(revision 4459)
@@ -25,42 +25,46 @@
 using namespace std;
 
-
+//! the model anorms 
 sVec3D MD2Model::anorms[NUM_VERTEX_NORMALS] = {
  #include "anorms.h"
 };
 
+//! anormal dots, no idea of how this shall work, but it does
 float MD2Model::anormsDots[SHADEDOT_QUANT][256] = {
   #include "anormtab.h"
 };
 
+//! again one of these strange id software parts
 static float *shadeDots = MD2Model::anormsDots[0];
 
+//! the angle under which the model is viewd, used internaly 
 float md2Angle = 0.0f;
 
 
+//! list of all different animations a std md2model supports
 sAnim MD2Model::animationList[21] =
   {
  // begin, end, fps 
-    {   0,  39,  9 },   // STAND
-    {  40,  45, 10 },   // RUN
-    {  46,  53, 10 },   // ATTACK
-    {  54,  57,  7 },   // PAIN_A
-    {  58,  61,  7 },   // PAIN_B
-    {  62,  65,  7 },   // PAIN_C
-    {  66,  71,  7 },   // JUMP
-    {  72,  83,  7 },   // FLIP
-    {  84,  94,  7 },   // SALUTE
-    {  95, 111, 10 },   // FALLBACK
-    { 112, 122,  7 },   // WAVE
-    { 123, 134,  6 },   // POINTT
-    { 135, 153, 10 },   // CROUCH_STAND
-    { 154, 159,  7 },   // CROUCH_WALK
-    { 160, 168, 10 },   // CROUCH_ATTACK
-    { 196, 172,  7 },   // CROUCH_PAIN
-    { 173, 177,  5 },   // CROUCH_DEATH
-    { 178, 183,  7 },   // DEATH_FALLBACK
-    { 184, 189,  7 },   // DEATH_FALLFORWARD
-    { 190, 197,  7 },   // DEATH_FALLBACKSLOW
-    { 198, 198,  5 },   // BOOM
+    {   0,  39,  9 },   //!< STAND
+    {  40,  45, 10 },   //!< RUN
+    {  46,  53, 10 },   //!< ATTACK
+    {  54,  57,  7 },   //!< PAIN_A
+    {  58,  61,  7 },   //!< PAIN_B
+    {  62,  65,  7 },   //!< PAIN_C
+    {  66,  71,  7 },   //!< JUMP
+    {  72,  83,  7 },   //!< FLIP
+    {  84,  94,  7 },   //!< SALUTE
+    {  95, 111, 10 },   //!< FALLBACK
+    { 112, 122,  7 },   //!< WAVE
+    { 123, 134,  6 },   //!< POINTT
+    { 135, 153, 10 },   //!< CROUCH_STAND
+    { 154, 159,  7 },   //!< CROUCH_WALK
+    { 160, 168, 10 },   //!< CROUCH_ATTACK
+    { 196, 172,  7 },   //!< CROUCH_PAIN
+    { 173, 177,  5 },   //!< CROUCH_DEATH
+    { 178, 183,  7 },   //!< DEATH_FALLBACK
+    { 184, 189,  7 },   //!< DEATH_FALLFORWARD
+    { 190, 197,  7 },   //!< DEATH_FALLBACKSLOW
+    { 198, 198,  5 },   //!< BOOM
   };
 
@@ -68,13 +72,14 @@
 
 /********************************************************************************
- *   MD2Model                                                                   * ********************************************************************************/
+ *   MD2Model                                                                   *
+ ********************************************************************************/
 
 /*
   \brief simple constructor initializing all variables
 */
-MD2Model::MD2Model()
+MD2Model::MD2Model(const char* modelFileName, const char* skinFileName)
 {
   /* this creates the data container via ressource manager */
-  this->data = new MD2Data();
+  this->data = new MD2Data(modelFileName, skinFileName);
   this->scaleFactor = this->data->scaleFactor;
 
@@ -90,25 +95,4 @@
 {
 
-}
-
-/*
-  \brief load model
-  \param name of the model file
-  \return true if everything worked out smoothly
-*/
-bool MD2Model::loadModel(const char* fileName)
-{
-  return this->data->loadModel(fileName);
-}
-
-
-/*
-  \brief load the skin as a material
-  \param name of the texture file
-  \return true if ok
-*/
-bool MD2Model::loadSkin(const char* fileName)
-{
-  return this->data->loadSkin(fileName);
 }
 
@@ -116,4 +100,5 @@
 /**
    \brief initializes an array of vert with the current frame scaled vertices
+   \param verticesList: the list of vertices to interpolate between
 
    we won't use the pVertices array directly, since its much easier and we need
@@ -139,5 +124,5 @@
 /*
   \brief sets the animation type
-  \param animation type
+  \param type: animation type
 
   the animation types can be looked up in the animationType table
@@ -163,5 +148,5 @@
 /*
   \brief sets the time in seconds passed since the last tick
-  \param time in sec
+  \param time: in sec
 */
 void MD2Model::tick(float time)
@@ -291,5 +276,5 @@
   \brief simple constructor
 */
-MD2Data::MD2Data()
+MD2Data::MD2Data(const char* modelFileName, const char* skinFileName)
 {
   this->pVertices = NULL;
@@ -302,4 +287,7 @@
   
   this->scaleFactor = 1.0f;
+
+  this->loadModel(modelFileName);
+  this->loadSkin(skinFileName);
 }
 
@@ -321,5 +309,5 @@
 /*
   \brief this will load the whole model data (vertices, opengl command list, ...)
-  \param name to the model file
+  \param fileName to the model file
   \return true if success
 */
@@ -391,9 +379,15 @@
 /*
   \brief loads the skin/material stuff
-  \param name of the skin file
+  \param fileName of the skin file
   \return true if success
 */
 bool MD2Data::loadSkin(const char* fileName)
 {
+  if( fileName == NULL)
+    {
+      this->skinFileName = NULL;
+      return false;
+    }
+
   this->skinFileName = new char[strlen(fileName)+1];
   strcpy(this->skinFileName, fileName);
