Changeset 7195 in orxonox.OLD for trunk/src/lib/util/loading
- Timestamp:
- Mar 7, 2006, 11:12:31 PM (19 years ago)
- Location:
- trunk/src/lib/util/loading
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/loading/resource.cc
r7193 r7195 10 10 11 11 ### File Specific: 12 main-programmer: ...12 main-programmer: Benjamin Grauer 13 13 co-programmer: ... 14 14 */ 15 15 16 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOADING 17 17 18 18 #include "resource.h" … … 23 23 /** 24 24 * standard constructor 25 * @todo this constructor is not jet implemented - do it26 25 */ 27 Resource::Resource ( )26 Resource::Resource (const std::string& fileName) 28 27 { 29 28 this->setClassID(CL_RESOURCE, "Resource"); 30 29 31 /* If you make a new class, what is most probably the case when you write this file32 don't forget to:33 1. Add the new file new_class.cc to the ./src/Makefile.am34 2. Add the class identifier to ./src/class_id.h eg. CL_NEW_CLASS35 36 Advanced Topics:37 - if you want to let your object be managed via the ObjectManager make sure to read38 the object_manager.h header comments. You will use this most certanly only if you39 make many objects of your class, like a weapon bullet.40 */41 30 } 42 43 31 44 32 /** 45 33 * standard deconstructor 46 */34 */ 47 35 Resource::~Resource () 48 36 { -
trunk/src/lib/util/loading/resource.h
r7193 r7195 1 1 /*! 2 2 * @file resource.h 3 * @brief Definition of ...3 * @brief Definition of a Resource. 4 4 */ 5 5 … … 9 9 #include "base_object.h" 10 10 #include "multi_type.h" 11 11 #include <string> 12 12 13 13 // FORWARD DECLARATION … … 15 15 16 16 17 //! A class for ... 17 //! An enumerator for different (UN)LOAD-types. 18 /** 19 * RP_NO: will be unloaded on request 20 * RP_LEVEL: will be unloaded at the end of a Level 21 * RP_CAMPAIGN: will be unloaded at the end of a Campaign 22 * RP_GAME: will be unloaded at the end of the whole Game (when closing orxonox) 23 */ 24 typedef enum ResourcePriority 25 { 26 RP_NO = 0, 27 RP_LEVEL = 1, 28 RP_CAMPAIGN = 2, 29 RP_GAME = 3 30 }; 31 32 33 34 //! A Resource is an Object, that can be loaded from Disk 35 /** 36 * 37 */ 18 38 class Resource : virtual public BaseObject { 19 39 20 40 public: 21 Resource();41 Resource(const std::string& fileName); 22 42 virtual ~Resource(); 23 43 24 virtual bool load( const char*fileName, const MultiType& param1, const MultiType& param2);44 virtual bool load(std::string& fileName, const MultiType& param1, const MultiType& param2); 25 45 virtual bool reload(); 26 46 virtual bool unload(); 27 47 28 48 private: 49 std::string fileName; 29 50 51 unsigned int referenceCount; //!< How many times this Resource has been loaded. 52 /// TODO REMOVE THIS: ResourceType type; //!< ResourceType of this Resource. 53 ResourcePriority prio; //!< The Priority of this resource. (can only be increased, so noone else will delete this) 54 55 MultiType param[3]; //!< The Parameters given to this Resource. 30 56 }; 31 57
Note: See TracChangeset
for help on using the changeset viewer.