Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8724 in orxonox.OLD for trunk/src/lib/util/loading


Ignore:
Timestamp:
Jun 22, 2006, 3:14:58 PM (18 years ago)
Author:
bensch
Message:

merged the bsp-model-stuff back here

Location:
trunk/src/lib/util/loading
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/util/loading/resource_manager.cc

    r8490 r8724  
    2828#include "primitive_model.h"
    2929#include "md2/md2Model.h"
     30#include "md3/md3_data.h"
     31#include "md3/md3_animation_cfg.h"
    3032#endif /* NO_MODEL */
    3133#ifndef NO_TEXTURES
     
    201203  else if (!strncmp(fileName.c_str()+(fileName.size()-4), ".md2", 4))
    202204    tmpType = MD2;
     205  else if (!strncmp(fileName.c_str()+(fileName.size()-4), ".md3", 4))
     206    tmpType = MD3;
     207  else if (!strncmp(fileName.c_str()+(fileName.size()-4), ".cfg", 4))
     208    tmpType = MD3_CONFIG;
    203209  else if (!strcasecmp(fileName.c_str(), "cube") ||
    204210            !strcasecmp(fileName.c_str(), "sphere") ||
     
    400406      }
    401407      break;
     408    case MD3:
     409      if(File(fullName).isFile())
     410      {
     411        tmpResource->param[0] = param0;
     412        tmpResource->param[1] = param1;
     413        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);
     422      }
     423      break;
    402424#endif /* NO_MODEL */
    403425#ifndef NO_TEXT
     
    624646            match = true;
    625647          break;
     648        case MD3:
     649          if (param0 == MT_NULL && ((*resource)->param[0] == "") && param1 == MT_NULL && ((*resource)->param[0] == 1.0f))
     650            match = true;
     651          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())
     658            match = true;
     659          break;
     660
    626661#endif /* NO_MODEL */
    627662#ifndef NO_TEXT
     
    863898    "PrimitiveModel",
    864899    "MD2-Data",
     900    "MD3-Data",
     901    "MD3-Config"
    865902#endif
    866903#ifndef NO_TEXT
  • trunk/src/lib/util/loading/resource_manager.h

    r8330 r8724  
    3333  PRIM,                 //!< loading primitive model
    3434  MD2,                  //!< loading md2-file
     35  MD3,                  //!< loading md3-file
     36  MD3_CONFIG,           //!< the md3 config file
    3537#endif /* NO_MODEL */
    3638#ifndef NO_TEXT
Note: See TracChangeset for help on using the changeset viewer.