Changeset 3658 in orxonox.OLD for orxonox/trunk/src/lib/util/resource_manager.h
- Timestamp:
- Mar 27, 2005, 7:44:39 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/util/resource_manager.h
r3655 r3658 15 15 16 16 // FORWARD DEFINITION \\ 17 //template<class T> class tList; 18 #include "list.h" //! \todo do this by forward definition (ask Patrick) 19 enum ResourceType {OBJ, PRIM, WAV, MP3, OGG, IMAGE}; 17 20 21 struct Resource 22 { 23 void* pointer; //!< Pointer to the Resource. 24 25 char* name; //!< Name of the Resource. 26 ResourceType type; //!< ResourceType of this Resource. 27 int count; //!< How many times this Resource has been loaded. 28 }; 18 29 19 enum ResourceType {OBJ, WAV, MP3, OGG, IMAGE};20 30 21 31 //! The ResourceManager is a class, that decides if a file/resource should be loaded … … 34 44 virtual ~ResourceManager(); 35 45 36 bool setDataDir(char* dataDir); 46 static bool setDataDir(char* dataDir); 47 static bool addImageDir(char* imageDir); 37 48 static void* load(const char* fileName); 38 49 static void* load(const char* fileName, ResourceType type); 50 static bool unload(void* pointer); 39 51 40 52 private: … … 42 54 static ResourceManager* singletonRef; 43 55 56 static tList<Resource>* resourceList; 57 static char* dataDir; 58 static tList<char>* imageDirs; 44 59 45 struct file; 46 struct folder 47 { 48 char* name; 49 folder** subfolders; //!< 50 file** files; //!< Files in the directory 51 }; 52 struct file 53 { 54 char* name; //!< exact Name of a file 55 void* pointer; 56 }; 57 58 char* dataDir; //!< The main data directory 60 static Resource* locateResourceByName(const char* fileName); 61 static Resource* locateResourceByPointer(const void* pointer); 62 59 63 60 64 static bool isDir(const char* directory);
Note: See TracChangeset
for help on using the changeset viewer.