Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9793 in orxonox.OLD for branches/new_class_id


Ignore:
Timestamp:
Sep 23, 2006, 3:48:03 PM (18 years ago)
Author:
bensch
Message:

orxonox/new_class_id: storing works better now

Location:
branches/new_class_id/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/graphics/importer/resource_texture.cc

    r9792 r9793  
    1 
    21
    32#include "resource_texture.h"
  • branches/new_class_id/src/lib/util/loading/new_resource_manager.cc

    r9792 r9793  
    6464    type->setID(this->_resourceTypes.size());
    6565    this->_resourceTypes.push_back(type);
     66    PRINTF(5)("ResourceType '%s' with ID %d added\n", type->storedClassName().c_str(), type->id());
    6667  }
    6768}
     
    113114  std::vector<Resources::Type*>::const_iterator it;
    114115  for (it = this->_resourceTypes.begin(); it != this->_resourceTypes.end(); ++it)
    115     PRINT(0)("ResourceType '%s'\n", (*it)->storedClassName().c_str());
     116    (*it)->debug();
    116117
    117118  PRINT(0)("==================================RM==\n");
  • branches/new_class_id/src/lib/util/loading/resource.cc

    r9792 r9793  
    4949    return (NewResourceManager::getInstance()->mainGlobalPath() + File(fileName)).name();
    5050
    51   printf("LOCATED %s\n", locateFileInSubDir(Directory("/home/bensch/svn/orxonox/data/"), fileName).c_str());
    52 
     51  std::string locatedFile;
     52  locatedFile = locateFileInSubDir(Directory("/home/bensch/svn/orxonox/data/"), fileName);
     53  if (!locatedFile.empty())
     54  {
     55    printf("FILE found %s\n", locatedFile.c_str());
     56    return locatedFile;
     57  }
    5358  return std::string("/home/bensch/svn/orxonox/data/") + fileName;
    5459}
     
    129134{
    130135  NewResourceManager::getInstance()->registerType(this);
     136  printf("%s\n", typeName.c_str());
    131137}
    132138
     
    163169  this->_id = id;
    164170}
     171
     172
     173void Resources::Type::debug() const
     174{
     175  PRINT(0)(" ResourceType '%s' with ID %d stores %d Resources\n", this->_typeName.c_str(), this->_id, this->_storedResources.size());
     176  PRINT(0)("  Paths:\n");
     177  for (unsigned int i = 0; i < this->_resourcePaths.size(); ++i)
     178    PRINT(0)("    %s\n", this->_resourcePaths[i].name().c_str());
     179  PRINT(0)("  Sub-Paths:\n");
     180  for (unsigned int i = 0; i < this->_resourceSubPaths.size(); ++i)
     181    PRINT(0)("    %s\n", this->_resourceSubPaths[i].name().c_str());
     182
     183}
  • branches/new_class_id/src/lib/util/loading/resource.h

    r9792 r9793  
    6262    void addResource(Resources::StorePointer* resource);
    6363
     64    void debug() const;
     65
    6466  private:
    6567    int                             _id;
    66     const std::string&              _typeName;
     68    const std::string               _typeName;
    6769    std::vector<Directory>          _resourcePaths;
    6870    std::vector<Directory>          _resourceSubPaths;
  • branches/new_class_id/src/orxonox.cc

    r9791 r9793  
    364364    delete gui;
    365365    ResourceManager::getInstance()->setDataDir(Preferences::getInstance()->getString(CONFIG_SECTION_GENERAL, CONFIG_NAME_DATADIR, ""));
    366 
    367366  }
    368367
     
    371370  NewResourceManager::getInstance()->addResourceSubPath("Texture", "pictures");
    372371
     372  NewResourceManager::getInstance()->debug();
    373373  //  DynamicLoader::loadDyLib("libtest.so");
    374374  return 0;
Note: See TracChangeset for help on using the changeset viewer.