Sprinkle some references where it makes sense

dont-compose-content
jvoisin 4 years ago
parent df3a47187b
commit cf11870b1c

@ -230,7 +230,7 @@ namespace MWBase
virtual bool isReadyToBlock (const MWWorld::Ptr& ptr) const = 0;
virtual bool isAttackingOrSpell(const MWWorld::Ptr &ptr) const = 0;
virtual void castSpell(const MWWorld::Ptr& ptr, const std::string spellId, bool manualSpell) = 0;
virtual void castSpell(const MWWorld::Ptr& ptr, const std::string& spellId, bool manualSpell) = 0;
virtual void processChangedSettings (const std::set< std::pair<std::string, std::string> >& settings) = 0;

@ -1667,7 +1667,7 @@ namespace MWMechanics
}
}
void Actors::castSpell(const MWWorld::Ptr& ptr, const std::string spellId, bool manualSpell)
void Actors::castSpell(const MWWorld::Ptr& ptr, const std::string& spellId, bool manualSpell)
{
PtrActorMap::iterator iter = mActors.find(ptr);
if(iter != mActors.end())

@ -101,7 +101,7 @@ namespace MWMechanics
void resurrect (const MWWorld::Ptr& ptr);
void castSpell(const MWWorld::Ptr& ptr, const std::string spellId, bool manualSpell=false);
void castSpell(const MWWorld::Ptr& ptr, const std::string& spellId, bool manualSpell=false);
void updateActor(const MWWorld::Ptr &old, const MWWorld::Ptr& ptr);
///< Updates an actor with a new Ptr

@ -2852,7 +2852,7 @@ void CharacterController::setAttackingOrSpell(bool attackingOrSpell)
mAttackingOrSpell = attackingOrSpell;
}
void CharacterController::castSpell(const std::string spellId, bool manualSpell)
void CharacterController::castSpell(const std::string& spellId, bool manualSpell)
{
mAttackingOrSpell = true;
mCastingManualSpell = manualSpell;

@ -286,7 +286,7 @@ public:
void setVisibility(float visibility);
void setAttackingOrSpell(bool attackingOrSpell);
void castSpell(const std::string spellId, bool manualSpell=false);
void castSpell(const std::string& spellId, bool manualSpell=false);
void setAIAttackType(const std::string& attackType);
static void setAttackTypeRandomly(std::string& attackType);

@ -251,7 +251,7 @@ namespace MWMechanics
mObjects.addObject(ptr);
}
void MechanicsManager::castSpell(const MWWorld::Ptr& ptr, const std::string spellId, bool manualSpell)
void MechanicsManager::castSpell(const MWWorld::Ptr& ptr, const std::string& spellId, bool manualSpell)
{
if(ptr.getClass().isActor())
mActors.castSpell(ptr, spellId, manualSpell);

@ -186,7 +186,7 @@ namespace MWMechanics
/// Is \a ptr casting spell or using weapon now?
bool isAttackingOrSpell(const MWWorld::Ptr &ptr) const override;
void castSpell(const MWWorld::Ptr& ptr, const std::string spellId, bool manualSpell=false) override;
void castSpell(const MWWorld::Ptr& ptr, const std::string& spellId, bool manualSpell=false) override;
void processChangedSettings(const Settings::CategorySettingVector& settings) override;

@ -66,7 +66,7 @@ public:
return ch;
}
static std::string lowerCaseUtf8(const std::string str)
static std::string lowerCaseUtf8(const std::string& str)
{
if (str.empty())
return str;

@ -45,9 +45,9 @@ struct GetTriangleFunctor
}
#if OSG_MIN_VERSION_REQUIRED(3,5,6)
void inline operator()( const osg::Vec3 v1, const osg::Vec3 v2, const osg::Vec3 v3 )
void inline operator()( const osg::Vec3& v1, const osg::Vec3& v2, const osg::Vec3& v3 )
#else
void inline operator()( const osg::Vec3 v1, const osg::Vec3 v2, const osg::Vec3 v3, bool _temp )
void inline operator()( const osg::Vec3& v1, const osg::Vec3& v2, const osg::Vec3& v3, bool _temp )
#endif
{
if (mTriMesh)

@ -106,7 +106,7 @@ namespace Resource
return time;
}
std::string RetrieveAnimationsVisitor::changeFileExtension(const std::string file, const std::string ext)
std::string RetrieveAnimationsVisitor::changeFileExtension(const std::string& file, const std::string& ext)
{
size_t extPos = file.find_last_of('.');
if (extPos != std::string::npos && extPos+1 < file.size())

@ -22,7 +22,7 @@ namespace Resource
private:
std::string changeFileExtension(const std::string file, const std::string ext);
std::string changeFileExtension(const std::string& file, const std::string& ext);
std::string parseTextKey(const std::string& line);
double parseTimeSignature(const std::string& line);

@ -200,7 +200,7 @@ float makeOsgColorComponent(unsigned int value, unsigned int shift)
return float((value >> shift) & 0xFFu) / 255.0f;
}
bool hasUserDescription(const osg::Node* node, const std::string pattern)
bool hasUserDescription(const osg::Node* node, const std::string& pattern)
{
if (node == nullptr)
return false;

@ -58,7 +58,7 @@ namespace SceneUtil
float makeOsgColorComponent (unsigned int value, unsigned int shift);
bool hasUserDescription(const osg::Node* node, const std::string pattern);
bool hasUserDescription(const osg::Node* node, const std::string& pattern);
osg::ref_ptr<GlowUpdater> addEnchantedGlow(osg::ref_ptr<osg::Node> node, Resource::ResourceSystem* resourceSystem, osg::Vec4f glowColor, float glowDuration=-1);

Loading…
Cancel
Save