Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 20, 2005, 3:24:14 PM (19 years ago)
Author:
patrick
Message:

christmas: the texture gets loaded now and is loadable

Location:
branches/christmas_branche/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/christmas_branche/src/world_entities/world_entity.cc

    r6187 r6191  
    8585  static_cast<PNode*>(this)->loadParams(root);
    8686
     87  LoadParam(root, "md2texture", this, WorldEntity, loadMD2Texture)
     88      .describe("the fileName of the texture, that should be loaded onto this world-entity. (must be relative to the data-dir)")
     89      .defaultValues(1, NULL);
     90
    8791  // Model Loading
    8892  LoadParam(root, "model", this, WorldEntity, loadModel)
    8993      .describe("the fileName of the model, that should be loaded onto this world-entity. (must be relative to the data-dir)")
    9094      .defaultValues(3, NULL, 1.0f, 0);
    91 
    92 }
     95}
     96
    9397
    9498/**
     
    135139      PRINTF(4)("fetching MD2 file: %s\n", fileName);
    136140//         MD2Model* m = (MD2Model*)ResourceManager::getInstance()->load(fileName, MD2, RP_CAMPAIGN);
    137       Model* m = new MD2Model(fileName, "md2_fake_texture.bad");
     141      Model* m = new MD2Model(fileName, this->md2TextureFileName);
    138142        //this->setModel((Model*)ResourceManager::getInstance()->load(fileName, MD2, RP_CAMPAIGN), 0);
    139143      this->setModel(m, 0);
  • branches/christmas_branche/src/world_entities/world_entity.h

    r6179 r6191  
    3636  void setModel(Model* model, unsigned int modelNumber = 0);
    3737  Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; };
     38
     39  inline void loadMD2Texture(const char* fileName) { this->md2TextureFileName = fileName; }
    3840
    3941  bool buildObbTree(unsigned int depth);
     
    7981 private:
    8082  std::vector<Model*>     models;             //!< The model that should be loaded for this entity.
     83  const char*             md2TextureFileName; //!< the file name of the md2 model texture, only if this
    8184  BVTree*                 obbTree;            //!< this is the obb tree reference needed for collision detection
    8285
Note: See TracChangeset for help on using the changeset viewer.