Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10313 in orxonox.OLD for branches


Ignore:
Timestamp:
Jan 24, 2007, 12:18:01 AM (18 years ago)
Author:
patrick
Message:

file is now loadable over the world xml file, including loading of model details

Location:
branches/mount_points/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/mount_points/src/lib/graphics/importer/oif/object_information_file.cc

    r10247 r10313  
    6060  if( fileName.empty())
    6161  {
    62     PRINTF(3)("No filename specified for object information loading");
     62    PRINTF(1)("No filename specified for object information loading");
    6363    return;
    6464  }
     
    6969  {
    7070    // report an error
    71     PRINTF(3)("Could not load XML File %s: %s @ %d:%d\n", fileName.c_str(), XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
     71    PRINTF(1)("Could not load XML File %s: %s @ %d:%d\n", fileName.c_str(), XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
    7272    return;
    7373  }
     
    8080  {
    8181    // report an error
    82     PRINTF(3)("Specified XML File is not an orxonox object information file (<ObjectInformationFile> element missing)\n");
     82    PRINTF(1)("Specified XML File is not an orxonox object information file (<ObjectInformationFile> element missing)\n");
    8383    return;
    8484  }
  • branches/mount_points/src/world_entities/mount_point.cc

    r10312 r10313  
    1919#include "util/loading/factory.h"
    2020#include "util/loading/load_param.h"
     21#include "util/loading/load_param_xml.h"
     22
    2123
    2224
     
    122124  LoadParam(root, "OrxClass", this, MountPoint, setOrxClass)
    123125  .describe("Sets the class this mount points should host");
    124 }
    125 
     126
     127  LoadParamXML(root, "Details", this, MountPoint, loadDetails);
     128}
     129
     130
     131/**
     132 * load the parameters from the world entity
     133 * @param root the root element of this xml branche
     134 */
     135void MountPoint::loadDetails(const TiXmlElement* root)
     136{
     137  if( this->_mount != NULL)
     138  {
     139    PRINTF(0)("Got detail informations\n");
     140    this->_mount->loadParams( root);
     141  }
     142}
    126143
    127144
  • branches/mount_points/src/world_entities/mount_point.h

    r10232 r10313  
    1818    void initMountPoint(const TiXmlElement* root);
    1919    void loadParam(const TiXmlElement* root);
     20    void loadDetails(const TiXmlElement* root);
    2021
    2122    void setDescription(const std::string& description);
  • branches/mount_points/src/world_entities/world_entity.cc

    r10312 r10313  
    145145  .defaultValues("", 1.0f, 0);
    146146
     147  LoadParam(root, "mountpoints", this, WorldEntity, loadMountPoints)
     148  .describe("the fileName of the object information file (optional)");
     149
    147150  LoadParam(root, "maxHealth", this, WorldEntity, setHealthMax)
    148151  .describe("The Maximum health that can be loaded onto this entity")
     
    216219        {
    217220          this->buildObbTree(obbTreeDepth);
    218 
    219           // now get the object information file for this model, if any
    220           std::string oifName = fileName.substr(0, fileName.length() - 4) + ".oif";
    221           this->loadMountPoints( model, oifName);
    222221        }
    223222      }
     
    277276 * @param fileName the name of the file
    278277 */
    279 void WorldEntity::loadMountPoints( Model* model, const std::string& fileName)
     278void WorldEntity::loadMountPoints(const std::string& fileName)
    280279{
    281280  PRINTF(5)("loading the oif File: %s\n", fileName.c_str());
     
    283282  // now load the object information file
    284283  this->oiFile = new ObjectInformationFile(fileName);
     284
     285  // get the model to load
     286  Model* model = this->getModel();
    285287
    286288  // extract the mount points
  • branches/mount_points/src/world_entities/world_entity.h

    r10228 r10313  
    5353  Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; };
    5454
    55   void loadMountPoints( Model* model, const std::string& fileName);
     55  void loadMountPoints(const std::string& fileName);
    5656  inline void loadMD2Texture(const std::string& fileName) { this->md2TextureFileName = fileName; }
    5757
Note: See TracChangeset for help on using the changeset viewer.