Changeset 9786 in orxonox.OLD for branches/new_class_id/src/lib
- Timestamp:
- Sep 22, 2006, 6:38:28 PM (18 years ago)
- Location:
- branches/new_class_id/src/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/graphics/importer/resource_texture.cc
r9785 r9786 11 11 12 12 if (ptr) 13 { 14 printf("FOUNT TEXTURE: %s\n", imageName.c_str()); 13 15 this->acquireData(static_cast<ResourceTexture::TextureResourcePointer*>(ptr)->ptr()); 16 } 14 17 else 15 18 { 19 printf("NOT FOUNT TEXTURE: %s\n", imageName.c_str()); 16 20 std::string fileName = this->Resource::locateFile(imageName); 17 21 this->Texture::loadImage(fileName, target); -
branches/new_class_id/src/lib/util/loading/resource.cc
r9785 r9786 61 61 return (Resource::_mainGlobalPath + File(fileName)).name(); 62 62 63 64 63 return std::string("/home/bensch/svn/orxonox/data/") + fileName; 65 64 … … 72 71 73 72 for (unsigned int i = 0; i < _type->storedResources().size(); ++i) 74 if (_type->storedResources()[i]->_pointer->loadString() == loadString) 75 return _type->storedResources()[i]->_pointer; 73 { 74 printf("Compare %s with %s\n", _type->storedResources()[i]->loadString().c_str(), loadString.c_str()); 75 if (_type->storedResources()[i]->loadString() == loadString) 76 return _type->storedResources()[i]; 77 } 76 78 77 79 return NULL; … … 94 96 95 97 void Resource::addResource(Resource::Pointer* pointer) 96 {} 98 { 99 this->_type->addResource(pointer); 100 } 97 101 98 102 … … 114 118 115 119 120 void Resource::Type::addResource(Resource::Pointer* resource) 121 { 122 this->_storedResources.push_back(resource); 116 123 117 118 119 120 124 } 121 125 122 126 123 127 Resource::Pointer::Pointer(const std::string& loadString, const Resource::KeepLevel& keeplevel) 124 { 125 } 128 : _loadString(loadString), _keepLevel(keeplevel) 129 {} 130 126 131 127 132 void Resource::Type::setID(int id) -
branches/new_class_id/src/lib/util/loading/resource.h
r9785 r9786 32 32 33 33 protected: 34 class Pointer 35 { 36 public: 37 Pointer(const std::string& loadString, const Resource::KeepLevel& keeplevel); 38 const std::string& loadString() const { return _loadString; }; 39 const Resource::KeepLevel& keepLevel() const { return _keepLevel; }; 40 41 private: 42 std::string _loadString; //!< An identifier, to match when loading a File. 43 Resource::KeepLevel _keepLevel; //!< The Priority of this resource. (can only be increased, so none else will delete this) 44 }; 45 46 34 47 class Type 35 48 { … … 47 60 const std::vector<std::string>& resourcePaths() const { return _resourcePaths; }; 48 61 const std::vector<std::string>& resourceSubPaths() const { return _resourceSubPaths; }; 49 const std::vector<Resource *>& storedResources() const { return _storedResources; };62 const std::vector<Resource::Pointer*>& storedResources() const { return _storedResources; }; 50 63 51 64 void setID(int id); 52 void addResource(Resource * resource);65 void addResource(Resource::Pointer* resource); 53 66 54 67 private: 55 int _id;56 const ClassID& _classID;57 std::vector<std::string> _resourcePaths;58 std::vector<std::string> _resourceSubPaths;59 std::vector<std::string> _fileExtensions;68 int _id; 69 const ClassID& _classID; 70 std::vector<std::string> _resourcePaths; 71 std::vector<std::string> _resourceSubPaths; 72 std::vector<std::string> _fileExtensions; 60 73 61 std::vector<Resource*> _storedResources; 62 }; 63 64 class Pointer 65 { 66 public: 67 Pointer(const std::string& loadString, const Resource::KeepLevel& keeplevel); 68 const std::string& loadString() const { return _loadString; }; 69 const Resource::KeepLevel& keepLevel() const { return _keepLevel; }; 70 71 private: 72 std::string _loadString; //!< An identifier, to match when loading a File. 73 Resource::KeepLevel _keepLevel; //!< The Priority of this resource. (can only be increased, so none else will delete this) 74 std::vector<Resource::Pointer*> _storedResources; 74 75 }; 75 76 … … 85 86 86 87 87 88 89 88 public: 89 static void setMainGlobalPath(const Directory& directory); 90 static void addGlobalPath(const Directory& directory); 90 91 91 92 … … 95 96 96 97 private: 97 Resource::Pointer* _pointer; //!< Virtual Pointer to the ResourceData.98 Resource::Type* _type; //!< Type of the Resource.98 Resource::Pointer* _pointer; //!< Virtual Pointer to the ResourceData. 99 Resource::Type* _type; //!< Type of the Resource. 99 100 100 101
Note: See TracChangeset
for help on using the changeset viewer.