- Timestamp:
- Sep 22, 2006, 10:20:14 PM (18 years ago)
- Location:
- branches/new_class_id/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/graphics/importer/resource_texture.cc
r9788 r9789 8 8 : NewResource(&ResourceTexture::type) 9 9 { 10 NewResource:: Pointer* ptr = this->acquireResource(imageName + ',' + "TEST");10 NewResource::StorePointer* ptr = this->acquireResource(imageName + ',' + "TEST"); 11 11 12 12 if (ptr) … … 20 20 std::string fileName = this->NewResource::locateFile(imageName); 21 21 this->Texture::loadImage(fileName, target); 22 this->NewResource::addResource(new ResourceTexture::TextureResourcePointer(imageName + ',' + "TEST", KeepLevel( ), this->Texture::dataPointer()));22 this->NewResource::addResource(new ResourceTexture::TextureResourcePointer(imageName + ',' + "TEST", KeepLevel(0), this->Texture::dataPointer())); 23 23 } 24 24 } … … 32 32 33 33 ResourceTexture::TextureResourcePointer::TextureResourcePointer(const std::string& loadString, const NewResource::KeepLevel& keepLevel, const TextureData::Pointer& data) 34 : NewResource:: Pointer(loadString, keepLevel) , pointer(data)34 : NewResource::StorePointer(loadString, keepLevel) , pointer(data) 35 35 {} 36 36 -
branches/new_class_id/src/lib/graphics/importer/resource_texture.h
r9788 r9789 19 19 20 20 private: 21 class TextureResourcePointer : public NewResource:: Pointer21 class TextureResourcePointer : public NewResource::StorePointer 22 22 { 23 23 public: -
branches/new_class_id/src/lib/util/loading/resource.cc
r9788 r9789 42 42 this->_type->setID(NewResource::_resourceTypes.size()-1); 43 43 } 44 45 44 } 46 45 … … 66 65 67 66 68 NewResource:: Pointer* NewResource::acquireResource(const std::string& loadString)67 NewResource::StorePointer* NewResource::acquireResource(const std::string& loadString) 69 68 { 70 69 //const NewResource::Type* const type = NewResource::_resourceTypes[this->_type->id()]; … … 94 93 95 94 96 void NewResource::addResource(NewResource:: Pointer* pointer)95 void NewResource::addResource(NewResource::StorePointer* pointer) 97 96 { 98 97 this->_type->addResource(pointer); … … 107 106 108 107 109 110 void NewResource::KeepLevel:: setKeepLevelName(unsigned int level, const std::string& name)108 std::vector<std::string> NewResource::KeepLevel::_keepLevelNames; 109 void NewResource::KeepLevel::defineKeepLevelName(unsigned int level, const std::string& name) 111 110 { 112 if (_keepLevelName .size() <= level)113 _keepLevelName .resize(level+1);114 _keepLevelName [level] = name;111 if (_keepLevelNames.size() <= level) 112 _keepLevelNames.resize(level+1); 113 _keepLevelNames[level] = name; 115 114 } 116 115 117 116 118 117 119 void NewResource::Type::addResource(NewResource:: Pointer* resource)118 void NewResource::Type::addResource(NewResource::StorePointer* resource) 120 119 { 121 120 this->_storedResources.push_back(resource); … … 124 123 125 124 126 NewResource:: Pointer::Pointer(const std::string& loadString, const NewResource::KeepLevel& keeplevel)127 : _loadString(loadString), _keepLevel(keeplevel)125 NewResource::StorePointer::StorePointer(const std::string& loadString, const NewResource::KeepLevel& keeplevel) 126 : _loadString(loadString), _keepLevel(keeplevel) 128 127 {} 129 128 -
branches/new_class_id/src/lib/util/loading/resource.h
r9788 r9789 8 8 9 9 #include "base_object.h" 10 #include "multi_type.h"11 10 #include <string> 12 11 #include <vector> … … 26 25 { 27 26 public: 28 void setKeepLevelName(unsigned int level, const std::string& name); 27 KeepLevel(unsigned int keepLevel) { _keepLevel = keepLevel; }; 28 KeepLevel(const std::string& keepLevelName); 29 30 static void defineKeepLevelName(unsigned int level, const std::string& name); 29 31 private: 30 std::vector<std::string> _keepLevelName; 32 unsigned int _keepLevel; 33 private: 34 static std::vector<std::string> _keepLevelNames; 31 35 }; 32 36 37 33 38 protected: 34 class Pointer39 class StorePointer 35 40 { 36 41 public: 37 Pointer(const std::string& loadString, const NewResource::KeepLevel& keeplevel);42 StorePointer(const std::string& loadString, const NewResource::KeepLevel& keeplevel); 38 43 const std::string& loadString() const { return _loadString; }; 39 44 const NewResource::KeepLevel& keepLevel() const { return _keepLevel; }; 40 45 41 46 private: 42 std::string _loadString; //!< An identifier, to match when loading a File.47 std::string _loadString; //!< An identifier, to match when loading a File. 43 48 NewResource::KeepLevel _keepLevel; //!< The Priority of this resource. (can only be increased, so none else will delete this) 44 49 }; … … 60 65 const std::vector<std::string>& resourcePaths() const { return _resourcePaths; }; 61 66 const std::vector<std::string>& resourceSubPaths() const { return _resourceSubPaths; }; 62 const std::vector<NewResource:: Pointer*>& storedResources() const { return _storedResources; };67 const std::vector<NewResource::StorePointer*>& storedResources() const { return _storedResources; }; 63 68 64 69 void setID(int id); 65 void addResource(NewResource:: Pointer* resource);70 void addResource(NewResource::StorePointer* resource); 66 71 67 72 private: … … 72 77 std::vector<std::string> _fileExtensions; 73 78 74 std::vector<NewResource:: Pointer*> _storedResources;79 std::vector<NewResource::StorePointer*> _storedResources; 75 80 }; 76 81 … … 92 97 93 98 protected: 94 NewResource:: Pointer* acquireResource(const std::string& loadString);95 void addResource(NewResource:: Pointer* pointer);99 NewResource::StorePointer* acquireResource(const std::string& loadString); 100 void addResource(NewResource::StorePointer* pointer); 96 101 97 102 private: 98 NewResource:: Pointer* _pointer; //!< Virtual Pointer to the ResourceData.103 NewResource::StorePointer* _pointer; //!< Virtual Pointer to the ResourceData. 99 104 NewResource::Type* _type; //!< Type of the NewResource. 100 105 -
branches/new_class_id/src/orxonox.cc
r9768 r9789 327 327 328 328 //#include "util/loading/dynamic_loader.h" 329 329 #include "loading/resource.h" 330 330 /** 331 331 * initializes and loads resource files
Note: See TracChangeset
for help on using the changeset viewer.