Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8545 in orxonox.OLD for branches/bsp_model/src/lib


Ignore:
Timestamp:
Jun 16, 2006, 5:32:47 PM (18 years ago)
Author:
patrick
Message:

bsp: animation initialisation work

Location:
branches/bsp_model/src/lib/graphics/importer/md3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/lib/graphics/importer/md3/md3_animation.cc

    r8526 r8545  
    6363
    6464  /**
    65    * create a new MD3 Anumation object and initialize it with the data on the given line
    66    * @param line: the line to read from
    67    */
    68   MD3Animation::MD3Animation(std::string line)
    69   {
    70     this->init();
    71     // loadAnimation()
    72   }
    73 
    74 
    75   /**
    7665   * deconstructor
    7766   */
  • branches/bsp_model/src/lib/graphics/importer/md3/md3_animation.h

    r8541 r8545  
    4040  public:
    4141    MD3Animation();
    42     MD3Animation(std::string line);
    4342    virtual ~MD3Animation();
    4443
  • branches/bsp_model/src/lib/graphics/importer/md3/md3_animation_cfg.cc

    r8544 r8545  
    134134
    135135          this->footsteps = tokens.back();
    136 //           std::transform(this->footsteps.begin(), this->footsteps.end(), this->footsteps.begin(), std::tolower);
    137 
    138            while( !tokens.empty())
    139           {
    140             PRINTF(0)("tokens: %s\n", tokens.back().c_str());
    141             tokens.pop_back();
    142           }
    143136
    144137          //check if value is ok
     
    157150          inHeader = false;
    158151
    159           MD3Animation* animation = new MD3Animation(line);
     152          MD3Animation* animation = new MD3Animation();
     153          this->loadAnimation(animation, line);
    160154
    161155          animation->name = MD3Animation::animationList[i].animationName;
     
    183177
    184178
     179  /**
     180   * loading the animation data itself
     181   */
     182  void MD3AnimationCfg::loadAnimation(MD3Animation* anim, std::string line)
     183  {
     184    // parse the line:
     185    // first frame, num frames, looping frames, frames per second (fps)
     186    std::vector<std::string> tokens;
     187    Tokenizer::tokenize(line, tokens, " \t\n\r\f/");
     188
     189
     190    while( !tokens.empty())
     191    {
     192      PRINTF(0)("tokens: %s\n", tokens.back().c_str());
     193      tokens.pop_back();
     194    }
     195  }
     196// //parse line:
     197//                 //first frame, num frames, looping frames, frames per second
     198//   try {
     199//     StringTokenizer st=new StringTokenizer(line, " \t\n\r\f/");
     200//
     201//     newAnimation.first=new Integer(st.nextToken()).intValue();
     202//     newAnimation.num=new Integer(st.nextToken()).intValue();
     203//     newAnimation.looping=new Integer(st.nextToken()).intValue();
     204//     newAnimation.fps=new Integer(st.nextToken()).intValue();
     205//   } catch (Exception e) {
     206//     throw new IOException("corrupt animation line");
     207//   }
     208
    185209
    186210  /**
  • branches/bsp_model/src/lib/graphics/importer/md3/md3_animation_cfg.h

    r8544 r8545  
    4040      void putAnimation(MD3Animation* animation);
    4141
     42    private:
     43      void loadAnimation(MD3Animation* anim, std::string line);
     44
    4245
    4346    public:
Note: See TracChangeset for help on using the changeset viewer.