1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-24 18:39:59 +00:00

Accept a ConstPtr in adjustScale

This commit is contained in:
scrawl 2015-12-18 16:46:02 +01:00
parent 09bdb0ad4b
commit 303521002d
6 changed files with 8 additions and 9 deletions

View File

@ -774,9 +774,9 @@ namespace MWClass
return ref->mBase->mAiData.mFight; return ref->mBase->mAiData.mFight;
} }
void Creature::adjustScale(const MWWorld::Ptr &ptr, osg::Vec3f &scale, bool /* rendering */) const void Creature::adjustScale(const MWWorld::ConstPtr &ptr, osg::Vec3f &scale, bool /* rendering */) const
{ {
MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>(); const MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
scale *= ref->mBase->mScale; scale *= ref->mBase->mScale;
} }
} }

View File

@ -130,7 +130,7 @@ namespace MWClass
virtual int getBaseFightRating(const MWWorld::ConstPtr &ptr) const; virtual int getBaseFightRating(const MWWorld::ConstPtr &ptr) const;
virtual void adjustScale(const MWWorld::Ptr& ptr, osg::Vec3f& scale, bool rendering) const; virtual void adjustScale(const MWWorld::ConstPtr& ptr, osg::Vec3f& scale, bool rendering) const;
/// @param rendering Indicates if the scale to adjust is for the rendering mesh, or for the collision mesh /// @param rendering Indicates if the scale to adjust is for the rendering mesh, or for the collision mesh
}; };
} }

View File

@ -1019,14 +1019,13 @@ namespace MWClass
+ shield; + shield;
} }
void Npc::adjustScale(const MWWorld::Ptr &ptr, osg::Vec3f&scale, bool rendering) const void Npc::adjustScale(const MWWorld::ConstPtr &ptr, osg::Vec3f&scale, bool rendering) const
{ {
if (!rendering) if (!rendering)
return; // collision meshes are not scaled based on race height return; // collision meshes are not scaled based on race height
// having the same collision extents for all races makes the environments easier to test // having the same collision extents for all races makes the environments easier to test
MWWorld::LiveCellRef<ESM::NPC> *ref = const MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
ptr.get<ESM::NPC>();
const ESM::Race* race = const ESM::Race* race =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Race>().find(ref->mBase->mRace); MWBase::Environment::get().getWorld()->getStore().get<ESM::Race>().find(ref->mBase->mRace);

View File

@ -108,7 +108,7 @@ namespace MWClass
/// \param actor Actor that is resposible for the ID being applied to \a ptr. /// \param actor Actor that is resposible for the ID being applied to \a ptr.
/// \return Any effect? /// \return Any effect?
virtual void adjustScale (const MWWorld::Ptr &ptr, osg::Vec3f &scale, bool rendering) const; virtual void adjustScale (const MWWorld::ConstPtr &ptr, osg::Vec3f &scale, bool rendering) const;
/// @param rendering Indicates if the scale to adjust is for the rendering mesh, or for the collision mesh /// @param rendering Indicates if the scale to adjust is for the rendering mesh, or for the collision mesh
virtual void skillUsageSucceeded (const MWWorld::Ptr& ptr, int skill, int usageType, float extraFactor=1.f) const; virtual void skillUsageSucceeded (const MWWorld::Ptr& ptr, int skill, int usageType, float extraFactor=1.f) const;

View File

@ -287,7 +287,7 @@ namespace MWWorld
return ""; return "";
} }
void Class::adjustScale(const MWWorld::Ptr& ptr, osg::Vec3f& scale, bool rendering) const void Class::adjustScale(const MWWorld::ConstPtr& ptr, osg::Vec3f& scale, bool rendering) const
{ {
} }

View File

@ -258,7 +258,7 @@ namespace MWWorld
virtual int getEnchantmentPoints (const MWWorld::Ptr& ptr) const; virtual int getEnchantmentPoints (const MWWorld::Ptr& ptr) const;
///< @return the number of enchantment points available for possible enchanting ///< @return the number of enchantment points available for possible enchanting
virtual void adjustScale(const MWWorld::Ptr& ptr, osg::Vec3f& scale, bool rendering) const; virtual void adjustScale(const MWWorld::ConstPtr& ptr, osg::Vec3f& scale, bool rendering) const;
/// @param rendering Indicates if the scale to adjust is for the rendering mesh, or for the collision mesh /// @param rendering Indicates if the scale to adjust is for the rendering mesh, or for the collision mesh
virtual bool canSell (const MWWorld::ConstPtr& item, int npcServices) const; virtual bool canSell (const MWWorld::ConstPtr& item, int npcServices) const;