diff --git a/apps/opencs/model/filter/parser.cpp b/apps/opencs/model/filter/parser.cpp index 6f185d60fa..c69a54726d 100644 --- a/apps/opencs/model/filter/parser.cpp +++ b/apps/opencs/model/filter/parser.cpp @@ -260,11 +260,11 @@ std::shared_ptr CSMFilter::Parser::parseImp (bool allowEmpty, b { case Token::Type_Keyword_True: - return std::shared_ptr (new BooleanNode (true)); + return std::make_shared(true); case Token::Type_Keyword_False: - return std::shared_ptr (new BooleanNode (false)); + return std::make_shared(false); case Token::Type_Keyword_And: case Token::Type_Keyword_Or: @@ -278,7 +278,7 @@ std::shared_ptr CSMFilter::Parser::parseImp (bool allowEmpty, b if (mError) return std::shared_ptr(); - return std::shared_ptr (new NotNode (node)); + return std::make_shared(node); } case Token::Type_Keyword_Text: @@ -340,8 +340,8 @@ std::shared_ptr CSMFilter::Parser::parseNAry (const Token& keyw switch (keyword.mType) { - case Token::Type_Keyword_And: return std::shared_ptr (new AndNode (nodes)); - case Token::Type_Keyword_Or: return std::shared_ptr (new OrNode (nodes)); + case Token::Type_Keyword_And: return std::make_shared(nodes); + case Token::Type_Keyword_Or: return std::make_shared(nodes); default: error(); return std::shared_ptr(); } } @@ -407,7 +407,7 @@ std::shared_ptr CSMFilter::Parser::parseText() return std::shared_ptr(); } - return std::shared_ptr (new TextNode (columnId, text)); + return std::make_shared(columnId, text); } std::shared_ptr CSMFilter::Parser::parseValue() @@ -532,7 +532,7 @@ std::shared_ptr CSMFilter::Parser::parseValue() return std::shared_ptr(); } - return std::shared_ptr (new ValueNode (columnId, lowerType, upperType, lower, upper)); + return std::make_shared(columnId, lowerType, upperType, lower, upper); } void CSMFilter::Parser::error() diff --git a/apps/openmw/mwrender/actoranimation.cpp b/apps/openmw/mwrender/actoranimation.cpp index 88e1d10d81..b3d76d423c 100644 --- a/apps/openmw/mwrender/actoranimation.cpp +++ b/apps/openmw/mwrender/actoranimation.cpp @@ -330,9 +330,7 @@ void ActorAnimation::resetControllers(osg::Node* node) if (node == nullptr) return; - std::shared_ptr src; - src.reset(new NullAnimationTime); - SceneUtil::ForceControllerSourcesVisitor removeVisitor(src); + SceneUtil::ForceControllerSourcesVisitor removeVisitor(std::make_shared()); node->accept(removeVisitor); } diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index b1c7bc89c4..cb4c074586 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -521,7 +521,7 @@ namespace MWRender , mAlpha(1.f) { for(size_t i = 0;i < sNumBlendMasks;i++) - mAnimationTimePtr[i].reset(new AnimationTime); + mAnimationTimePtr[i] = std::make_shared(); mLightListCallback = new SceneUtil::LightListCallback; } @@ -630,8 +630,7 @@ namespace MWRender if(!mResourceSystem->getVFS()->exists(kfname)) return; - std::shared_ptr animsrc; - animsrc.reset(new AnimSource); + auto animsrc = std::make_shared(); animsrc->mKeyframes = mResourceSystem->getKeyframeManager()->get(kfname); if (!animsrc->mKeyframes || animsrc->mKeyframes->mTextKeys.empty() || animsrc->mKeyframes->mKeyframeControllers.empty()) @@ -660,7 +659,7 @@ namespace MWRender animsrc->mControllerMap[blendMask].insert(std::make_pair(bonename, cloned)); } - mAnimSources.push_back(animsrc); + mAnimSources.push_back(std::move(animsrc)); SceneUtil::AssignControllerSourcesVisitor assignVisitor(mAnimationTimePtr[0]); mObjectRoot->accept(assignVisitor); @@ -1574,7 +1573,7 @@ namespace MWRender params.mLoop = loop; params.mEffectId = effectId; params.mBoneName = bonename; - params.mAnimTime = std::shared_ptr(new EffectAnimationTime); + params.mAnimTime = std::make_shared(); trans->addUpdateCallback(new UpdateVfxCallback(params)); SceneUtil::AssignControllerSourcesVisitor assignVisitor(std::shared_ptr(params.mAnimTime)); diff --git a/apps/openmw/mwrender/creatureanimation.cpp b/apps/openmw/mwrender/creatureanimation.cpp index 627b200b71..78a524b74f 100644 --- a/apps/openmw/mwrender/creatureanimation.cpp +++ b/apps/openmw/mwrender/creatureanimation.cpp @@ -63,7 +63,7 @@ CreatureWeaponAnimation::CreatureWeaponAnimation(const MWWorld::Ptr &ptr, const updateParts(); } - mWeaponAnimationTime = std::shared_ptr(new WeaponAnimationTime(this)); + mWeaponAnimationTime = std::make_shared(this); } void CreatureWeaponAnimation::showWeapons(bool showWeapon) diff --git a/apps/openmw/mwrender/effectmanager.cpp b/apps/openmw/mwrender/effectmanager.cpp index 3e785a769e..d5d01a5e41 100644 --- a/apps/openmw/mwrender/effectmanager.cpp +++ b/apps/openmw/mwrender/effectmanager.cpp @@ -32,7 +32,7 @@ void EffectManager::addEffect(const std::string &model, const std::string& textu node->setNodeMask(Mask_Effect); Effect effect; - effect.mAnimTime.reset(new EffectAnimationTime); + effect.mAnimTime = std::make_shared(); SceneUtil::FindMaxControllerLengthVisitor findMaxLengthVisitor; node->accept(findMaxLengthVisitor); diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index 3fdfaed72d..1ae792f60c 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -275,8 +275,8 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, osg::ref_ptr par { mNpc = mPtr.get()->mBase; - mHeadAnimationTime = std::shared_ptr(new HeadAnimationTime(mPtr)); - mWeaponAnimationTime = std::shared_ptr(new WeaponAnimationTime(this)); + mHeadAnimationTime = std::make_shared(mPtr); + mWeaponAnimationTime = std::make_shared(this); for(size_t i = 0;i < ESM::PRT_Count;i++) { @@ -846,7 +846,7 @@ bool NpcAnimation::addOrReplaceIndividualPart(ESM::PartReferenceType type, int g if (type == ESM::PRT_Weapon) src = mWeaponAnimationTime; else - src.reset(new NullAnimationTime); + src = std::make_shared(); SceneUtil::AssignControllerSourcesVisitor assignVisitor(src); node->accept(assignVisitor); } diff --git a/apps/openmw/mwrender/ripplesimulation.cpp b/apps/openmw/mwrender/ripplesimulation.cpp index 1045594c20..d1a8ea1ecd 100644 --- a/apps/openmw/mwrender/ripplesimulation.cpp +++ b/apps/openmw/mwrender/ripplesimulation.cpp @@ -48,7 +48,7 @@ namespace } osg::ref_ptr controller (new NifOsg::FlipController(0, 0.3f/rippleFrameCount, textures)); - controller->setSource(std::shared_ptr(new SceneUtil::FrameTimeSource)); + controller->setSource(std::make_shared()); node->addUpdateCallback(controller); osg::ref_ptr stateset (new osg::StateSet); diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index 8e4353f2ef..a9c56bdf19 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -642,7 +642,7 @@ namespace MWRender mParticleEffect = mSceneManager->getInstance(mCurrentParticleEffect, mParticleNode); - SceneUtil::AssignControllerSourcesVisitor assignVisitor = std::shared_ptr(new SceneUtil::FrameTimeSource); + SceneUtil::AssignControllerSourcesVisitor assignVisitor(std::make_shared()); mParticleEffect->accept(assignVisitor); SetupVisitor alphaFaderSetupVisitor(mPrecipitationAlpha); diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index 47e60245ba..7d9aca9b76 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -599,7 +599,7 @@ void Water::createSimpleWaterStateSet(osg::Node* node, float alpha) float fps = Fallback::Map::getFloat("Water_SurfaceFPS"); osg::ref_ptr controller (new NifOsg::FlipController(0, 1.f/fps, textures)); - controller->setSource(std::shared_ptr(new SceneUtil::FrameTimeSource)); + controller->setSource(std::make_shared()); node->setUpdateCallback(controller); stateset->setTextureAttributeAndModes(0, textures[0], osg::StateAttribute::ON); diff --git a/apps/openmw/mwsound/movieaudiofactory.cpp b/apps/openmw/mwsound/movieaudiofactory.cpp index d8c1c928ee..233b3c79ea 100644 --- a/apps/openmw/mwsound/movieaudiofactory.cpp +++ b/apps/openmw/mwsound/movieaudiofactory.cpp @@ -38,8 +38,8 @@ namespace MWSound public: MovieAudioDecoder(Video::VideoState *videoState) : Video::MovieAudioDecoder(videoState), mAudioTrack(nullptr) + , mDecoderBridge(std::make_shared(this)) { - mDecoderBridge.reset(new MWSoundDecoderBridge(this)); } size_t getSampleOffset() diff --git a/apps/openmw/mwworld/projectilemanager.cpp b/apps/openmw/mwworld/projectilemanager.cpp index 5e60154a89..e931afa07b 100644 --- a/apps/openmw/mwworld/projectilemanager.cpp +++ b/apps/openmw/mwworld/projectilemanager.cpp @@ -244,7 +244,7 @@ namespace MWWorld mParent->addChild(state.mNode); - state.mEffectAnimationTime.reset(new MWRender::EffectAnimationTime); + state.mEffectAnimationTime = std::make_shared(); SceneUtil::AssignControllerSourcesVisitor assignVisitor (state.mEffectAnimationTime); state.mNode->accept(assignVisitor); diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 67e8782296..17bd381a3d 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -388,9 +388,9 @@ namespace NifOsg { bool autoPlay = animflags & Nif::NiNode::AnimFlag_AutoPlay; if (autoPlay) - toSetup->setSource(std::shared_ptr(new SceneUtil::FrameTimeSource)); + toSetup->setSource(std::make_shared()); - toSetup->setFunction(std::shared_ptr(new ControllerFunction(ctrl))); + toSetup->setFunction(std::make_shared(ctrl)); } static osg::ref_ptr handleLodNode(const Nif::NiLODNode* niLodNode)