Index: branches/bsp_model/src/lib/graphics/importer/Makefile.am
===================================================================
--- branches/bsp_model/src/lib/graphics/importer/Makefile.am	(revision 8526)
+++ branches/bsp_model/src/lib/graphics/importer/Makefile.am	(revision 8532)
@@ -34,4 +34,5 @@
                            md3/md3_model.cc \
                            md3/md3_animation.cc \
+                           md3/md3_animation_cfg.cc \
                            md3/md3_bone_frame.cc \
                            md3/md3_mesh.cc \
@@ -76,4 +77,5 @@
                 md3/md3_model.h \
                 md3/md3_animation.h \
+                md3/md3_animation_cfg.h \
                 md3/md3_bone_frame.h \
                 md3/md3_mesh.h \
Index: branches/bsp_model/src/lib/graphics/importer/md3/md3_animation_cfg.cc
===================================================================
--- branches/bsp_model/src/lib/graphics/importer/md3/md3_animation_cfg.cc	(revision 8526)
+++ branches/bsp_model/src/lib/graphics/importer/md3/md3_animation_cfg.cc	(revision 8532)
@@ -17,5 +17,9 @@
 #include "md3_animation_cfg.h"
 
-
+#include "tokenizer.h"
+
+#include "debug.h"
+
+using namespace std;
 
 namespace md3
@@ -34,6 +38,11 @@
    * @param line: the line to read from
    */
-  MD3AnimationCfg::MD3AnimationCfg(std::string line)
-  {
+  MD3AnimationCfg::MD3AnimationCfg(std::string filename)
+  {
+    this->dataStream.open(filename.c_str());
+
+    if( !this->dataStream) {
+      PRINTF(1)("Error: file could not be opened: %s\n", filename.c_str());
+    }
   }
 
@@ -44,4 +53,115 @@
   MD3AnimationCfg::~MD3AnimationCfg()
   {}
+
+
+  /**
+   * loads the configuration file
+   */
+  void MD3AnimationCfg::loadConfig()
+  {
+//     BufferedReader bin=new BufferedReader(new InputStreamReader(in));
+
+    int      i = 0;                //!< last read animation, animation order is hard coded!
+    int      torsoOffset = -1;     //!< torso offset
+    int      firstTorsoFrame = -1; //!< first of the TORSO animation frames
+    bool     inHeader = true;      //!< are we still in the header of the .cfg file?
+    char     buffer[1024];         //!< buffer to write stuff into
+
+
+
+    // parse file
+    this->dataStream.getline(buffer, 1024, '\n');
+    std::string line(buffer);
+    PRINTF(0)("line = %s\n", line.c_str());
+    while( !this->dataStream.eof()) {
+
+      //ignore empty lines and comments
+      if( line != "" && line.find("//") != 0) {
+        // find the sex section
+        if( inHeader && line.find("sex") == 0) {
+          //parse line: sex [m | f | ...]
+//           StringTokenizer st=new StringTokenizer(line, " \t\n\r\f/");
+          std::vector<std::string> tokens;
+          Tokenizer::tokenize(line, tokens, " \t\n\r\f/");
+
+          while( !tokens.empty())
+          {
+            PRINTF(0)("tokens: %s\n", tokens.back());
+            tokens.pop_back();
+          }
+          return;
+/*
+          st.nextToken(); //throw away first token
+          String sexStr=st.nextToken();
+          if (sexStr.length()!=1)
+            //non-fatal error, don't thow exception
+            newAnimCfg.sex='?';
+          else
+            newAnimCfg.sex=sexStr.charAt(0);
+        }
+        else if (IN_HEADER && line.startsWith("headoffset")) {
+                                        //parse line: headoffset X Y Z
+          StringTokenizer st=new StringTokenizer(line, " \t\n\r\f/");
+
+          st.nextToken(); //throw away first token
+
+          newAnimCfg.headOffset=
+              new md3.util.Vec3(new Float(st.nextToken()).floatValue(),
+                                new Float(st.nextToken()).floatValue(),
+                                new Float(st.nextToken()).floatValue());
+        }
+        else if (IN_HEADER && line.startsWith("footsteps")) {
+                                        //parse line: footsteps [normal | mech | ...]
+          StringTokenizer st=new StringTokenizer(line, " \t\n\r\f/");
+
+          st.nextToken(); //throw away first token
+          newAnimCfg.footsteps=st.nextToken().trim();
+
+          if (!(newAnimCfg.footsteps.toLowerCase().equals("default") ||
+                newAnimCfg.footsteps.toLowerCase().equals("normal") ||
+                newAnimCfg.footsteps.toLowerCase().equals("boot") ||
+                newAnimCfg.footsteps.toLowerCase().equals("flesh") ||
+                newAnimCfg.footsteps.toLowerCase().equals("mech") ||
+                newAnimCfg.footsteps.toLowerCase().equals("energy")
+               ))
+            //don't throw an exception, non-fatal error
+            newAnimCfg.footsteps="illegal footsteps value (" + newAnimCfg.footsteps + ")";
+        }
+        else {
+                                        //assume it's an animation line
+          IN_HEADER=false; //no longer in header
+
+          MD3Animation animation=MD3ModelFactory.getFactory().makeMD3Animation(line);
+
+          animation.name=animationNames[i];
+          animation.type=animationTypes[i++];
+
+                                        //workaround for strange numbering in animation.cfg: skip TORSO frames
+                                        //for LEGS animation lines...
+          if (animation.type==AnimationType.LEGS) {
+                                                //when first LEGS animation is found, calc # of TORSO frames
+            if (TORSO_OFFSET==-1)
+              TORSO_OFFSET=animation.first-firstTORSOFrame;
+
+            animation.first-=TORSO_OFFSET;
+            animation.offset=TORSO_OFFSET;
+          }
+          else if (animation.type==AnimationType.TORSO)
+            if (firstTORSOFrame==-1)
+              firstTORSOFrame=animation.first;
+
+          newAnimCfg.putAnimation(animation);
+        }
+      }
+
+      line=bin.readLine();
+    }
+    catch (Exception e) {
+      throw new IOException(e.getMessage());
+    }*/
+        }
+      }
+    }
+  }
 
 
Index: branches/bsp_model/src/lib/graphics/importer/md3/md3_animation_cfg.h
===================================================================
--- branches/bsp_model/src/lib/graphics/importer/md3/md3_animation_cfg.h	(revision 8526)
+++ branches/bsp_model/src/lib/graphics/importer/md3/md3_animation_cfg.h	(revision 8532)
@@ -13,4 +13,8 @@
 #include <string>
 #include <map>
+
+#include <iostream>
+#include <fstream>
+
 
 
@@ -31,4 +35,5 @@
       virtual ~MD3AnimationCfg();
 
+      void loadConfig();
 
       std::string toString() { return std::string("Name: " + this->filename); }
@@ -42,4 +47,6 @@
       std::string             footsteps;           //!< type of the footstep sounds associated with anumations (e.g. "mech", "default")
 
+      std::ifstream           dataStream;          //!< the data stream
+
       std::map<std::string, MD3Animation*>     animations;          //!< mapping of animation names to MD3Animation objects.
   };
