Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10241 in orxonox.OLD for branches/mount_points/src/lib/graphics


Ignore:
Timestamp:
Jan 16, 2007, 11:43:15 PM (18 years ago)
Author:
patrick
Message:

much more on the resources. it's not that simple at all

Location:
branches/mount_points/src/lib/graphics/importer/oif
Files:
4 edited

Legend:

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

    r10240 r10241  
    5252void OIFData::load(const std::string& fileName)
    5353{
    54   PRINTF(0)("loading %s as oif data\n", fileName.c_str());
    55     if( fileName.empty())
     54  PRINTF(0)("loading |%s| as oif data\n", fileName.c_str());
     55  if( fileName.empty())
    5656  {
    57     PRINTF(3)("No filename specified for object information loading");
     57    PRINTF(0)("No filename specified for object information loading");
    5858    return;
    5959  }
     
    6464  {
    6565    // report an error
    66     PRINTF(1)("Could not load XML File %s: %s @ %d:%d\n", fileName.c_str(), XMLDoc.ErrorDesc(), XMLDoc.ErrorRow(), XMLDoc.ErrorCol());
     66    PRINTF(0)("Could not load XML File %s: %s @ %d:%d\n", fileName.c_str(), XMLDoc.ErrorDesc(), XMLDoc.ErrorRow(), XMLDoc.ErrorCol());
    6767    return;
    6868  }
     
    7575  {
    7676    // report an error
    77     PRINTF(2)("Specified XML File is not an orxonox object information file (<ObjectInformationFile> element missing)\n");
     77    PRINTF(0)("Specified XML File is not an orxonox object information file (<ObjectInformationFile> element missing)\n");
    7878    return;
    7979  }
     80  PRINTF(0)("OIF loaded\n");
    8081
    8182}
     
    139140
    140141
     142void ObjectInformationFile::load(const std::string& fileName)
     143{
     144}
     145
     146
    141147/**
    142148 * standard deconstructor
  • branches/mount_points/src/lib/graphics/importer/oif/object_information_file.h

    r10239 r10241  
    4343  virtual ~ObjectInformationFile();
    4444
     45  void load(const std::string& fileName);
     46
    4547  ObjectInformationFile& operator=(const ObjectInformationFile& oif);
    4648
    4749  /** @returns a reference to the xml oif file */
    4850  inline const TiXmlElement* getMountPointDescription() { return this->data->root(); }
     51
     52  inline void acquireData(const OIFData::Pointer& data) { this->data = data; }
     53  const OIFData::Pointer& dataPointer() const { return this->data; };
     54
    4955
    5056
  • branches/mount_points/src/lib/graphics/importer/oif/resource_oif.cc

    r10147 r10241  
    2626  Resources::StorePointer* ptr = this->acquireResource(fileName);
    2727
     28
    2829  if (ptr)
    2930  {
    30     PRINTF(0)("FOUND OIF: %s\n", fileName.c_str());
    31     //this->acquireData(static_cast<ResourceOIF::OIFResourcePointer*>(ptr)->ptr());
     31    PRINTF(5)("FOUND OIF: %s\n", fileName.c_str());
     32    this->acquireData(static_cast<ResourceOIF::OIFResourcePointer*>(ptr)->ptr());
    3233  }
    3334  else
    3435  {
    35     PRINTF(4)("NOT FOUND OIF: %s\n", fileName.c_str());
    36 //     std::string modelFileName = this->Resource::locateFile(modelName);
    37 //     //std::string skinFileName = this->Resource::locateFile(skinName);
    38 //     this->MD2Model::load(modelFileName, skinName, scale);
    39 //     this->Resource::addResource(new ResourceOIF::OIFResourcePointer(loadString(modelName, skinName, scale), keepLevel, this->MD2Model::dataPointer()));
     36    PRINTF(5)("NOT FOUND OIF: %s\n", fileName.c_str());
     37    std::string fullName = this->Resource::locateFile(fileName);
     38
     39    this->ObjectInformationFile::load(fileName);
     40    this->Resource::addResource(new ResourceOIF::OIFResourcePointer(fileName, keepLevel, this->ObjectInformationFile::dataPointer()));
    4041  }
    4142
  • branches/mount_points/src/lib/graphics/importer/oif/resource_oif.h

    r10147 r10241  
    1515{
    1616public:
    17   ResourceOIF(const std::string& fileName, const Resources::KeepLevel& keepLevel = Resources::KeepLevel());
     17  ResourceOIF(const std::string& fileName,
     18              const Resources::KeepLevel& keepLevel = Resources::KeepLevel());
    1819  static ResourceOIF createFromString(const std::string& loadString, const Resources::KeepLevel& keepLevel = Resources::KeepLevel());
    1920
Note: See TracChangeset for help on using the changeset viewer.