mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-22 03:40:49 +00:00
Add const version of getAnimation
This commit is contained in:
parent
7a4aac1842
commit
7a8a7e3dd6
@ -263,4 +263,13 @@ Animation* Objects::getAnimation(const MWWorld::Ptr &ptr)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const Animation* Objects::getAnimation(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
PtrAnimationMap::const_iterator iter = mObjects.find(ptr);
|
||||
if(iter != mObjects.end())
|
||||
return iter->second;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -81,6 +81,7 @@ public:
|
||||
void insertCreature (const MWWorld::Ptr& ptr, const std::string& model, bool weaponsShields);
|
||||
|
||||
Animation* getAnimation(const MWWorld::Ptr &ptr);
|
||||
const Animation* getAnimation(const MWWorld::ConstPtr &ptr) const;
|
||||
|
||||
bool removeObject (const MWWorld::Ptr& ptr);
|
||||
///< \return found?
|
||||
|
@ -706,6 +706,14 @@ namespace MWRender
|
||||
return mObjects->getAnimation(ptr);
|
||||
}
|
||||
|
||||
const MWRender::Animation* RenderingManager::getAnimation(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
if (mPlayerAnimation.get() && ptr == mPlayerAnimation->getPtr())
|
||||
return mPlayerAnimation.get();
|
||||
|
||||
return mObjects->getAnimation(ptr);
|
||||
}
|
||||
|
||||
MWRender::Animation* RenderingManager::getPlayerAnimation()
|
||||
{
|
||||
return mPlayerAnimation.get();
|
||||
|
@ -136,6 +136,7 @@ namespace MWRender
|
||||
void update(float dt, bool paused);
|
||||
|
||||
Animation* getAnimation(const MWWorld::Ptr& ptr);
|
||||
const Animation* getAnimation(const MWWorld::ConstPtr& ptr) const;
|
||||
Animation* getPlayerAnimation();
|
||||
|
||||
void addWaterRippleEmitter(const MWWorld::Ptr& ptr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user