|
|
|
@ -55,53 +55,7 @@ public:
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#if (OGRE_VERSION < ((1 << 16) | (9 << 8) | 0))
|
|
|
|
|
class BulletShapePtr : public Ogre::SharedPtr<BulletShape>
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
BulletShapePtr() : Ogre::SharedPtr<BulletShape>() {}
|
|
|
|
|
explicit BulletShapePtr(BulletShape *rep) : Ogre::SharedPtr<BulletShape>(rep) {}
|
|
|
|
|
BulletShapePtr(const BulletShapePtr &r) : Ogre::SharedPtr<BulletShape>(r) {}
|
|
|
|
|
BulletShapePtr(const Ogre::ResourcePtr &r) : Ogre::SharedPtr<BulletShape>()
|
|
|
|
|
{
|
|
|
|
|
if( r.isNull() )
|
|
|
|
|
return;
|
|
|
|
|
// lock & copy other mutex pointer
|
|
|
|
|
OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
|
|
|
|
|
OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
|
|
|
|
|
pRep = static_cast<BulletShape*>(r.getPointer());
|
|
|
|
|
pUseCount = r.useCountPointer();
|
|
|
|
|
useFreeMethod = r.freeMethod();
|
|
|
|
|
if (pUseCount)
|
|
|
|
|
{
|
|
|
|
|
++(*pUseCount);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Operator used to convert a ResourcePtr to a BulletShapePtr
|
|
|
|
|
BulletShapePtr& operator=(const Ogre::ResourcePtr& r)
|
|
|
|
|
{
|
|
|
|
|
if(pRep == static_cast<BulletShape*>(r.getPointer()))
|
|
|
|
|
return *this;
|
|
|
|
|
release();
|
|
|
|
|
if( r.isNull() )
|
|
|
|
|
return *this; // resource ptr is null, so the call to release above has done all we need to do.
|
|
|
|
|
// lock & copy other mutex pointer
|
|
|
|
|
OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
|
|
|
|
|
OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
|
|
|
|
|
pRep = static_cast<BulletShape*>(r.getPointer());
|
|
|
|
|
pUseCount = r.useCountPointer();
|
|
|
|
|
useFreeMethod = r.freeMethod();
|
|
|
|
|
if (pUseCount)
|
|
|
|
|
{
|
|
|
|
|
++(*pUseCount);
|
|
|
|
|
}
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
#else
|
|
|
|
|
typedef Ogre::SharedPtr<BulletShape> BulletShapePtr;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*Hold any BulletShape that was created by the ManualBulletShapeLoader.
|
|
|
|
@ -146,7 +100,6 @@ public:
|
|
|
|
|
virtual ~BulletShapeManager();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if (OGRE_VERSION >= ((1 << 16) | (9 << 8) | 0))
|
|
|
|
|
/// Get a resource by name
|
|
|
|
|
/// @see ResourceManager::getByName
|
|
|
|
|
BulletShapePtr getByName(const Ogre::String& name, const Ogre::String& groupName = Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
|
|
|
|
@ -156,7 +109,6 @@ public:
|
|
|
|
|
BulletShapePtr create (const Ogre::String& name, const Ogre::String& group,
|
|
|
|
|
bool isManual = false, Ogre::ManualResourceLoader* loader = 0,
|
|
|
|
|
const Ogre::NameValuePairList* createParams = 0);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
virtual BulletShapePtr load(const Ogre::String &name, const Ogre::String &group);
|
|
|
|
|
|
|
|
|
|