Changeset 3660 in orxonox.OLD for orxonox/trunk/src/lib/util/resource_manager.h
- Timestamp:
- Mar 29, 2005, 11:50:51 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/util/resource_manager.h
r3658 r3660 17 17 //template<class T> class tList; 18 18 #include "list.h" //! \todo do this by forward definition (ask Patrick) 19 20 //! An eumerator for different fileTypes the resourceManager supports \todo WAV, MP3, OGG support 19 21 enum ResourceType {OBJ, PRIM, WAV, MP3, OGG, IMAGE}; 22 //! An enumerator for different UNLOAD-types. 23 /** 24 RP_NO: will be unloaded on request 25 RP_LEVEL: will be unloaded at the end of a Level 26 RP_CAMPAIGN: will be unloaded at the end of a Campaign 27 RP_GAME: will be unloaded at the end of the whole Game (when closing orxonox) 28 */ 29 enum ResourcePriority {RP_NO = 0, RP_LEVEL = 1, RP_CAMPAIGN = 2, RP_GAME = 3}; 20 30 31 //! A Struct that keeps track about A resource its name its Type, and so on 21 32 struct Resource 22 33 { … … 25 36 char* name; //!< Name of the Resource. 26 37 ResourceType type; //!< ResourceType of this Resource. 38 ResourcePriority prio; //!< The Priority of this resource. (This will only be increased) 27 39 int count; //!< How many times this Resource has been loaded. 28 40 }; … … 46 58 static bool setDataDir(char* dataDir); 47 59 static bool addImageDir(char* imageDir); 48 static void* load(const char* fileName); 49 static void* load(const char* fileName, ResourceType type); 50 static bool unload(void* pointer); 60 static void* load(const char* fileName, ResourcePriority prio = RP_NO); 61 static void* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO); 62 static bool unload(void* pointer, ResourcePriority prio = RP_NO); 63 static bool unload(Resource* resource, ResourcePriority = RP_NO); 64 static bool unloadAllByPriority(ResourcePriority prio); 51 65 52 66 private: … … 61 75 static Resource* locateResourceByPointer(const void* pointer); 62 76 63 64 77 static bool isDir(const char* directory); 65 78 static bool isFile(const char* directory);
Note: See TracChangeset
for help on using the changeset viewer.