Changeset 6693 in orxonox.OLD for branches/network/src/util/loading/resource_manager.h
- Timestamp:
- Jan 25, 2006, 2:19:46 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/util/loading/resource_manager.h
r6633 r6693 14 14 (NO_TEXT) 15 15 (NO_TEXTURES) 16 (NO_SHADERS) 16 17 */ 17 18 … … 20 21 21 22 #include "base_object.h" 23 #include "multi_type.h" 22 24 23 24 #include <list> 25 #include <vector> 25 26 26 27 //! An eumerator for different fileTypes the resourceManager supports … … 46 47 SHADER, //!< openGL-shader program 47 48 #endif /* NO_SHADERS */ 49 RESOURCE_TYPE_SIZE 48 50 }; 49 51 … … 73 75 ResourcePriority prio; //!< The Priority of this resource. (This will only be increased) 74 76 75 // more specific 76 union { 77 #ifndef NO_MODEL 78 float modelSize; //!< the size of the model (OBJ/PRIM) 79 char* secFileName; //!< a seconf fileName 80 #endif /* NO_MODEL */ 81 #ifndef NO_TEXT 82 unsigned int ttfSize; //!< the size of the ttf-font (TTF) 83 #endif /* NO_TEXT */ 84 #ifndef NO_TEXTURES 85 GLenum texTarget; 86 #endif /* NO_TEXTURES */ 87 }; 77 MultiType param[3]; //!< The Parameters given to this Resource. 88 78 }; 89 79 … … 114 104 bool verifyDataDir(const char* fileInside); 115 105 bool addImageDir(const char* imageDir); 106 107 bool cache(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO, 108 const MultiType& param0 = MultiType(), const MultiType& param1 = MultiType(), const MultiType& param2 = MultiType()); 109 BaseObject* copy(BaseObject* resourcePointer); 110 116 111 BaseObject* load(const char* fileName, ResourcePriority prio = RP_NO, 117 void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);112 const MultiType& param0 = MultiType(), const MultiType& param1 = MultiType(), const MultiType& param2 = MultiType()); 118 113 BaseObject* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO, 119 void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);120 bool unload( void* pointer, ResourcePriority prio = RP_NO);114 const MultiType& param0 = MultiType(), const MultiType& param1 = MultiType(), const MultiType& param2 = MultiType()); 115 bool unload(BaseObject* pointer, ResourcePriority prio = RP_NO); 121 116 bool unload(Resource* resource, ResourcePriority = RP_NO); 122 117 bool unloadAllByPriority(ResourcePriority prio); 123 118 124 Resource* locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3) const; 119 Resource* locateResourceByInfo(const char* fileName, ResourceType type, 120 const MultiType& param0 = MultiType(), const MultiType& param1 = MultiType(), const MultiType& param2 = MultiType()) const; 125 121 Resource* locateResourceByPointer(const void* pointer) const; 122 123 char* toResourcableString(unsigned int i); 124 bool fromResourceableString(const char* resourceableString); 125 /** @returns the Count of Resources the ResourceManager handles */ 126 unsigned int resourceCount() const { return this->resourceList.size(); } 126 127 127 128 void debug() const; … … 138 139 139 140 static const char* ResourceTypeToChar(ResourceType type); 140 141 static ResourceType stringToResourceType(const char* resourceType); 141 142 142 143 private: 143 144 ResourceManager(); 145 Resource* loadResource(const char* fileName, ResourceType type, ResourcePriority prio, 146 const MultiType& param0, const MultiType& param1, const MultiType& param2); 144 147 145 148 private: … … 147 150 148 151 char* dataDir; //!< The Data Directory, where all relevant Data is stored. 149 std::list<Resource*> resourceList; //!< The List of Resources, that has already been loaded. 150 std::list<char*> imageDirs; //!< A list of directories in which images are stored. 152 std::vector<char*> imageDirs; //!< A list of directories in which images are stored. 151 153 154 std::vector<Resource*> resourceList; //!< The List of Resources, that has already been loaded. 155 156 static const char* resourceNames[RESOURCE_TYPE_SIZE]; 152 157 }; 153 158
Note: See TracChangeset
for help on using the changeset viewer.