From 2c2ed5f7ffb674110eb34a4342a76539903e1a28 Mon Sep 17 00:00:00 2001 From: Sam Hellawell Date: Fri, 29 Mar 2024 19:04:07 +0000 Subject: [PATCH] Clang format --- apps/openmw/mwrender/animation.cpp | 4 +--- components/resource/scenemanager.cpp | 30 +++++++++++++++------------- components/sceneutil/extradata.cpp | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 33c6dab46a..1807b0050f 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -1457,9 +1457,7 @@ namespace MWRender } } - osg::ref_ptr created - = getModelInstance(mResourceSystem, model, baseonly, inject, defaultSkeleton); - + osg::ref_ptr created = getModelInstance(mResourceSystem, model, baseonly, inject, defaultSkeleton); if (!forceskeleton) { mInsert->addChild(created); diff --git a/components/resource/scenemanager.cpp b/components/resource/scenemanager.cpp index 426f37d47b..03b61e7ec3 100644 --- a/components/resource/scenemanager.cpp +++ b/components/resource/scenemanager.cpp @@ -9,10 +9,10 @@ #include #include -#include -#include -#include #include +#include +#include +#include #include @@ -359,28 +359,29 @@ namespace Resource void updateVertexInfluenceMap(osgAnimation::RigGeometry& rig) { osgAnimation::VertexInfluenceMap* vertexInfluenceMap = rig.getInfluenceMap(); - if (!vertexInfluenceMap) return; + if (!vertexInfluenceMap) + return; std::vector> renameList; // Collecting updates - for (const auto& influence : *vertexInfluenceMap) { + for (const auto& influence : *vertexInfluenceMap) + { const std::string& oldBoneName = influence.first; std::string newBoneName = Misc::StringUtils::underscoresToSpaces(oldBoneName); - if (newBoneName != oldBoneName) { + if (newBoneName != oldBoneName) renameList.emplace_back(oldBoneName, newBoneName); - } } // Applying updates (cant update map while iterating it!) - for (const auto& rename : renameList) { + for (const auto& rename : renameList) + { const std::string& oldName = rename.first; const std::string& newName = rename.second; // Check if new name already exists to avoid overwriting - if (vertexInfluenceMap->find(newName) == vertexInfluenceMap->end()) { + if (vertexInfluenceMap->find(newName) == vertexInfluenceMap->end()) (*vertexInfluenceMap)[newName] = std::move((*vertexInfluenceMap)[oldName]); - } vertexInfluenceMap->erase(oldName); } @@ -390,7 +391,9 @@ namespace Resource { public: RenameBonesVisitor() - : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {} + : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) + { + } void apply(osg::MatrixTransform& node) override { @@ -400,8 +403,8 @@ namespace Resource osg::Callback* cb = node.getUpdateCallback(); while (cb) { - osgAnimation::AnimationUpdateCallback* animCb = - dynamic_cast*>(cb); + osgAnimation::AnimationUpdateCallback* animCb + = dynamic_cast*>(cb); if (animCb) animCb->setName(Misc::StringUtils::underscoresToSpaces(animCb->getName())); @@ -721,7 +724,6 @@ namespace Resource new TemplateRef(newRiggeometryHolder->getGeometry(0))); } } - } node->getOrCreateStateSet()->addUniform(new osg::Uniform("emissiveMult", 1.f)); diff --git a/components/sceneutil/extradata.cpp b/components/sceneutil/extradata.cpp index 8192c52339..1daa023168 100644 --- a/components/sceneutil/extradata.cpp +++ b/components/sceneutil/extradata.cpp @@ -9,10 +9,10 @@ #include #include +#include #include #include #include -#include namespace SceneUtil {