Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8591 in orxonox.OLD


Ignore:
Timestamp:
Jun 19, 2006, 11:03:58 PM (18 years ago)
Author:
patrick
Message:

bsp: md3_config is loaded correctly via resource manager

Location:
branches/bsp_model/src/lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/lib/graphics/importer/md3/md3_animation_cfg.h

    r8545 r8591  
    1010
    1111#include "vector.h"
     12
     13#include "base_object.h"
    1214
    1315#include <string>
     
    2729   * a class with metadata describing an MD3 model animation
    2830   */
    29   class MD3AnimationCfg
     31  class MD3AnimationCfg : public BaseObject
    3032  {
    3133
  • branches/bsp_model/src/lib/graphics/importer/md3/md3_model.cc

    r8590 r8591  
    7979  void MD3Model::autoAssemblePlayerModel(std::string filename, float scaling)
    8080  {
    81 //     this->md3Data = new MD3Data(filename, filename, scaling);
    82 //     MD3AnimationCfg cfg("/home/boenzlip/tmp/q3/Downloads/MOH/q3mdl-alien3/models/players/alien3/animation.cfg");
     81    std::string cfgName(filename + "/animation.cfg");
     82    this->config = (MD3AnimationCfg*)ResourceManager::getInstance()->load(cfgName, MD3_CONFIG, RP_GAME);
    8383
    8484
    8585    //first load the torso
    8686    std::string name(filename + "/upper.md3");
    87     PRINTF(0)("data dir: %s\n", ResourceManager::getInstance()->getFullName(name).c_str());
    88 
    89 //     this->md3Data = new MD3Data(name, name, scaling);
    9087    this->md3Data = (MD3Data*)ResourceManager::getInstance()->load(name, MD3, RP_GAME, name, scaling);
    9188
  • branches/bsp_model/src/lib/graphics/importer/md3/md3_model.h

    r8579 r8591  
    2121class MD3Mesh;
    2222class MD3Tag;
     23class MD3AnimationCfg;
    2324
    2425struct MD3Normal;
     
    6566    float**             tmpMatrix;         //!< a temporary matrix
    6667
     68    MD3AnimationCfg*    config;            //!< the config file parsed
    6769};
    6870
  • branches/bsp_model/src/lib/util/loading/resource_manager.cc

    r8590 r8591  
    2929#include "md2/md2Model.h"
    3030#include "md3/md3_data.h"
     31#include "md3/md3_animation_cfg.h"
    3132#endif /* NO_MODEL */
    3233#ifndef NO_TEXTURES
     
    204205  else if (!strncmp(fileName.c_str()+(fileName.size()-4), ".md3", 4))
    205206    tmpType = MD3;
     207  else if (!strncmp(fileName.c_str()+(fileName.size()-4), ".cfg", 4))
     208    tmpType = MD3_CONFIG;
    206209  else if (!strcasecmp(fileName.c_str(), "cube") ||
    207210            !strcasecmp(fileName.c_str(), "sphere") ||
     
    406409      if(File(fullName).isFile())
    407410      {
    408         PRINTF(0)("md3 load\n");
    409411        tmpResource->param[0] = param0;
    410412        tmpResource->param[1] = param1;
    411413        tmpResource->pointer = new md3::MD3Data(fullName, tmpResource->param[0].getCString(), tmpResource->param[1].getFloat());
     414      }
     415      break;
     416    case MD3_CONFIG:
     417      if(File(fullName).isFile())
     418      {
     419        tmpResource->param[0] = param0;
     420        tmpResource->param[1] = param1;
     421        tmpResource->pointer = new md3::MD3AnimationCfg(fullName);
    412422      }
    413423      break;
     
    640650            match = true;
    641651          else if ((*resource)->param[0] == ((MultiType)param0).getString() && (*resource)->param[1] == ((MultiType)param1).getFloat())
     652            match = true;
     653          break;
     654        case MD3_CONFIG:
     655          if (param0 == MT_NULL && ((*resource)->param[0] == ""))
     656            match = true;
     657          else if ((*resource)->param[0] == ((MultiType)param0).getString())
    642658            match = true;
    643659          break;
     
    883899    "MD2-Data",
    884900    "MD3-Data",
     901    "MD3-Config"
    885902#endif
    886903#ifndef NO_TEXT
  • branches/bsp_model/src/lib/util/loading/resource_manager.h

    r8590 r8591  
    3434  MD2,                  //!< loading md2-file
    3535  MD3,                  //!< loading md3-file
     36  MD3_CONFIG,           //!< the md3 config file
    3637#endif /* NO_MODEL */
    3738#ifndef NO_TEXT
Note: See TracChangeset for help on using the changeset viewer.