| 1 | /* | 
|---|
| 2 | ----------------------------------------------------------------------------- | 
|---|
| 3 | This source file is part of OGRE | 
|---|
| 4 |     (Object-oriented Graphics Rendering Engine) | 
|---|
| 5 | For the latest info, see http://www.ogre3d.org/ | 
|---|
| 6 |  | 
|---|
| 7 | Copyright (c) 2000-2013 Torus Knot Software Ltd | 
|---|
| 8 |  | 
|---|
| 9 | Permission is hereby granted, free of charge, to any person obtaining a copy | 
|---|
| 10 | of this software and associated documentation files (the "Software"), to deal | 
|---|
| 11 | in the Software without restriction, including without limitation the rights | 
|---|
| 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | 
|---|
| 13 | copies of the Software, and to permit persons to whom the Software is | 
|---|
| 14 | furnished to do so, subject to the following conditions: | 
|---|
| 15 |  | 
|---|
| 16 | The above copyright notice and this permission notice shall be included in | 
|---|
| 17 | all copies or substantial portions of the Software. | 
|---|
| 18 |  | 
|---|
| 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 
|---|
| 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 
|---|
| 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | 
|---|
| 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | 
|---|
| 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | 
|---|
| 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | 
|---|
| 25 | THE SOFTWARE. | 
|---|
| 26 | ----------------------------------------------------------------------------- | 
|---|
| 27 | */ | 
|---|
| 28 | #ifndef __SkeletonManager_H__ | 
|---|
| 29 | #define __SkeletonManager_H__ | 
|---|
| 30 |  | 
|---|
| 31 | #include "OgrePrerequisites.h" | 
|---|
| 32 |  | 
|---|
| 33 | #include "OgreResourceManager.h" | 
|---|
| 34 | #include "OgreSingleton.h" | 
|---|
| 35 |  | 
|---|
| 36 | namespace Ogre { | 
|---|
| 37 |  | 
|---|
| 38 |         /** \addtogroup Core | 
|---|
| 39 |         *  @{ | 
|---|
| 40 |         */ | 
|---|
| 41 |         /** \addtogroup Animation | 
|---|
| 42 |         *  @{ | 
|---|
| 43 |         */ | 
|---|
| 44 |         /** Handles the management of skeleton resources. | 
|---|
| 45 |         @remarks | 
|---|
| 46 |             This class deals with the runtime management of | 
|---|
| 47 |             skeleton data; like other resource managers it handles | 
|---|
| 48 |             the creation of resources (in this case skeleton data), | 
|---|
| 49 |             working within a fixed memory budget. | 
|---|
| 50 |     */ | 
|---|
| 51 |     class _OgreExport SkeletonManager: public ResourceManager, public Singleton<SkeletonManager> | 
|---|
| 52 |     { | 
|---|
| 53 |     public: | 
|---|
| 54 |         /// Constructor | 
|---|
| 55 |         SkeletonManager(); | 
|---|
| 56 |         ~SkeletonManager(); | 
|---|
| 57 |  | 
|---|
| 58 |                 /// Create a new skeleton | 
|---|
| 59 |                 /// @see ResourceManager::createResource | 
|---|
| 60 |                 SkeletonPtr create (const String& name, const String& group, | 
|---|
| 61 |                                                         bool isManual = false, ManualResourceLoader* loader = 0, | 
|---|
| 62 |                                                         const NameValuePairList* createParams = 0); | 
|---|
| 63 |  | 
|---|
| 64 |                 /// Get a resource by name | 
|---|
| 65 |                 /// @see ResourceManager::getResourceByName | 
|---|
| 66 |                 SkeletonPtr getByName(const String& name, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME); | 
|---|
| 67 |  | 
|---|
| 68 |         /** Override standard Singleton retrieval. | 
|---|
| 69 |         @remarks | 
|---|
| 70 |         Why do we do this? Well, it's because the Singleton | 
|---|
| 71 |         implementation is in a .h file, which means it gets compiled | 
|---|
| 72 |         into anybody who includes it. This is needed for the | 
|---|
| 73 |         Singleton template to work, but we actually only want it | 
|---|
| 74 |         compiled into the implementation of the class based on the | 
|---|
| 75 |         Singleton, not all of them. If we don't change this, we get | 
|---|
| 76 |         link errors when trying to use the Singleton-based class from | 
|---|
| 77 |         an outside dll. | 
|---|
| 78 |         @par | 
|---|
| 79 |         This method just delegates to the template version anyway, | 
|---|
| 80 |         but the implementation stays in this single compilation unit, | 
|---|
| 81 |         preventing link errors. | 
|---|
| 82 |         */ | 
|---|
| 83 |         static SkeletonManager& getSingleton(void); | 
|---|
| 84 |         /** Override standard Singleton retrieval. | 
|---|
| 85 |         @remarks | 
|---|
| 86 |         Why do we do this? Well, it's because the Singleton | 
|---|
| 87 |         implementation is in a .h file, which means it gets compiled | 
|---|
| 88 |         into anybody who includes it. This is needed for the | 
|---|
| 89 |         Singleton template to work, but we actually only want it | 
|---|
| 90 |         compiled into the implementation of the class based on the | 
|---|
| 91 |         Singleton, not all of them. If we don't change this, we get | 
|---|
| 92 |         link errors when trying to use the Singleton-based class from | 
|---|
| 93 |         an outside dll. | 
|---|
| 94 |         @par | 
|---|
| 95 |         This method just delegates to the template version anyway, | 
|---|
| 96 |         but the implementation stays in this single compilation unit, | 
|---|
| 97 |         preventing link errors. | 
|---|
| 98 |         */ | 
|---|
| 99 |         static SkeletonManager* getSingletonPtr(void); | 
|---|
| 100 |     protected: | 
|---|
| 101 |  | 
|---|
| 102 |         /// @copydoc ResourceManager::createImpl | 
|---|
| 103 |         Resource* createImpl(const String& name, ResourceHandle handle,  | 
|---|
| 104 |             const String& group, bool isManual, ManualResourceLoader* loader,  | 
|---|
| 105 |             const NameValuePairList* createParams); | 
|---|
| 106 |  | 
|---|
| 107 |     }; | 
|---|
| 108 |  | 
|---|
| 109 |         /** @} */ | 
|---|
| 110 |         /** @} */ | 
|---|
| 111 |  | 
|---|
| 112 | } | 
|---|
| 113 |  | 
|---|
| 114 |  | 
|---|
| 115 | #endif | 
|---|