mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Apply clang-format to code base
This commit is contained in:
parent
f37d0be806
commit
ddb0522bbf
2199 changed files with 118692 additions and 114392 deletions
|
@ -5,9 +5,9 @@
|
|||
#include <osgAnimation/MorphGeometry>
|
||||
#include <osgAnimation/RigGeometry>
|
||||
|
||||
#include <osgParticle/Emitter>
|
||||
#include <osgParticle/ParticleProcessor>
|
||||
#include <osgParticle/ParticleSystemUpdater>
|
||||
#include <osgParticle/Emitter>
|
||||
|
||||
#include <components/sceneutil/morphgeometry.hpp>
|
||||
#include <components/sceneutil/riggeometry.hpp>
|
||||
|
@ -19,32 +19,35 @@ namespace SceneUtil
|
|||
CopyOp::CopyOp()
|
||||
{
|
||||
setCopyFlags(osg::CopyOp::DEEP_COPY_NODES
|
||||
// Controller might need different inputs per scene instance
|
||||
| osg::CopyOp::DEEP_COPY_CALLBACKS
|
||||
| osg::CopyOp::DEEP_COPY_USERDATA);
|
||||
// Controller might need different inputs per scene instance
|
||||
| osg::CopyOp::DEEP_COPY_CALLBACKS | osg::CopyOp::DEEP_COPY_USERDATA);
|
||||
}
|
||||
|
||||
osg::Node* CopyOp::operator ()(const osg::Node* node) const
|
||||
osg::Node* CopyOp::operator()(const osg::Node* node) const
|
||||
{
|
||||
if (const osgParticle::ParticleProcessor* processor = dynamic_cast<const osgParticle::ParticleProcessor*>(node))
|
||||
return operator()(processor);
|
||||
if (const osgParticle::ParticleSystemUpdater* updater = dynamic_cast<const osgParticle::ParticleSystemUpdater*>(node))
|
||||
if (const osgParticle::ParticleSystemUpdater* updater
|
||||
= dynamic_cast<const osgParticle::ParticleSystemUpdater*>(node))
|
||||
{
|
||||
osgParticle::ParticleSystemUpdater* cloned = new osgParticle::ParticleSystemUpdater(*updater, osg::CopyOp::SHALLOW_COPY);
|
||||
osgParticle::ParticleSystemUpdater* cloned
|
||||
= new osgParticle::ParticleSystemUpdater(*updater, osg::CopyOp::SHALLOW_COPY);
|
||||
mUpdaterToOldPs[cloned] = updater->getParticleSystem(0);
|
||||
return cloned;
|
||||
}
|
||||
return osg::CopyOp::operator()(node);
|
||||
}
|
||||
|
||||
osg::Drawable* CopyOp::operator ()(const osg::Drawable* drawable) const
|
||||
osg::Drawable* CopyOp::operator()(const osg::Drawable* drawable) const
|
||||
{
|
||||
if (const osgParticle::ParticleSystem* partsys = dynamic_cast<const osgParticle::ParticleSystem*>(drawable))
|
||||
return operator()(partsys);
|
||||
|
||||
if (dynamic_cast<const SceneUtil::RigGeometry*>(drawable) || dynamic_cast<const SceneUtil::MorphGeometry*>(drawable) ||
|
||||
dynamic_cast<const osgAnimation::RigGeometry*>(drawable) || dynamic_cast<const osgAnimation::MorphGeometry*>(drawable) ||
|
||||
dynamic_cast<const SceneUtil::RigGeometryHolder*>(drawable))
|
||||
if (dynamic_cast<const SceneUtil::RigGeometry*>(drawable)
|
||||
|| dynamic_cast<const SceneUtil::MorphGeometry*>(drawable)
|
||||
|| dynamic_cast<const osgAnimation::RigGeometry*>(drawable)
|
||||
|| dynamic_cast<const osgAnimation::MorphGeometry*>(drawable)
|
||||
|| dynamic_cast<const SceneUtil::RigGeometryHolder*>(drawable))
|
||||
{
|
||||
return static_cast<osg::Drawable*>(drawable->clone(*this));
|
||||
}
|
||||
|
@ -52,9 +55,10 @@ namespace SceneUtil
|
|||
return osg::CopyOp::operator()(drawable);
|
||||
}
|
||||
|
||||
osgParticle::ParticleProcessor* CopyOp::operator() (const osgParticle::ParticleProcessor* processor) const
|
||||
osgParticle::ParticleProcessor* CopyOp::operator()(const osgParticle::ParticleProcessor* processor) const
|
||||
{
|
||||
osgParticle::ParticleProcessor* cloned = static_cast<osgParticle::ParticleProcessor*>(processor->clone(osg::CopyOp::DEEP_COPY_CALLBACKS));
|
||||
osgParticle::ParticleProcessor* cloned
|
||||
= static_cast<osgParticle::ParticleProcessor*>(processor->clone(osg::CopyOp::DEEP_COPY_CALLBACKS));
|
||||
for (const auto& oldPsNewPsPair : mOldPsToNewPs)
|
||||
{
|
||||
if (processor->getParticleSystem() == oldPsNewPsPair.first)
|
||||
|
@ -68,7 +72,7 @@ namespace SceneUtil
|
|||
return cloned;
|
||||
}
|
||||
|
||||
osgParticle::ParticleSystem* CopyOp::operator ()(const osgParticle::ParticleSystem* partsys) const
|
||||
osgParticle::ParticleSystem* CopyOp::operator()(const osgParticle::ParticleSystem* partsys) const
|
||||
{
|
||||
osgParticle::ParticleSystem* cloned = static_cast<osgParticle::ParticleSystem*>(partsys->clone(*this));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue