mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-29 17:15:34 +00:00
Do not copy osg::ref_ptr when possible
This commit is contained in:
parent
d3d7a663c6
commit
35561450f1
26 changed files with 37 additions and 37 deletions
|
@ -24,7 +24,7 @@
|
|||
#include "mask.hpp"
|
||||
|
||||
CSVRender::BrushDraw::BrushDraw(osg::ref_ptr<osg::Group> parentNode, bool textureMode)
|
||||
: mParentNode(parentNode)
|
||||
: mParentNode(std::move(parentNode))
|
||||
, mTextureMode(textureMode)
|
||||
{
|
||||
mBrushDrawNode = new osg::Group();
|
||||
|
|
|
@ -197,7 +197,7 @@ CSVRender::InstanceMode::InstanceMode(
|
|||
, mDragAxis(-1)
|
||||
, mLocked(false)
|
||||
, mUnitScaleDist(1)
|
||||
, mParentNode(parentNode)
|
||||
, mParentNode(std::move(parentNode))
|
||||
{
|
||||
connect(this, &InstanceMode::requestFocus, worldspaceWidget, &WorldspaceWidget::requestFocus);
|
||||
|
||||
|
|
|
@ -284,7 +284,7 @@ namespace CSVRender
|
|||
|
||||
osg::ref_ptr<osg::Geometry> gradientQuad = createGradientRectangle(bgColour, gradientColour);
|
||||
|
||||
camera->addChild(gradientQuad);
|
||||
camera->addChild(std::move(gradientQuad));
|
||||
return camera;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@ namespace MWInput
|
|||
osgViewer::ScreenCaptureHandler::CaptureOperation* screenCaptureOperation,
|
||||
osg::ref_ptr<osgViewer::Viewer> viewer, osg::ref_ptr<osgViewer::ScreenCaptureHandler> screenCaptureHandler)
|
||||
: mBindingsManager(bindingsManager)
|
||||
, mViewer(viewer)
|
||||
, mScreenCaptureHandler(screenCaptureHandler)
|
||||
, mViewer(std::move(viewer))
|
||||
, mScreenCaptureHandler(std::move(screenCaptureHandler))
|
||||
, mScreenCaptureOperation(screenCaptureOperation)
|
||||
, mTimeIdle(0.f)
|
||||
{
|
||||
|
|
|
@ -102,7 +102,7 @@ namespace MWPhysics
|
|||
, mProjectileId(0)
|
||||
, mWaterHeight(0)
|
||||
, mWaterEnabled(false)
|
||||
, mParentNode(parentNode)
|
||||
, mParentNode(std::move(parentNode))
|
||||
, mPhysicsDt(1.f / 60.f)
|
||||
{
|
||||
mResourceSystem->addResourceManager(mShapeManager.get());
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace MWRender
|
|||
|
||||
ActorAnimation::ActorAnimation(
|
||||
const MWWorld::Ptr& ptr, osg::ref_ptr<osg::Group> parentNode, Resource::ResourceSystem* resourceSystem)
|
||||
: Animation(ptr, parentNode, resourceSystem)
|
||||
: Animation(ptr, std::move(parentNode), resourceSystem)
|
||||
{
|
||||
MWWorld::ContainerStore& store = mPtr.getClass().getContainerStore(mPtr);
|
||||
|
||||
|
@ -474,7 +474,7 @@ namespace MWRender
|
|||
osg::ref_ptr<osg::Group> arrowNode = ammoNode->getChild(i)->asGroup();
|
||||
osg::ref_ptr<osg::Node> arrow = mResourceSystem->getSceneManager()->getInstance(model, arrowNode);
|
||||
if (!ammo->getClass().getEnchantment(*ammo).empty())
|
||||
mGlowUpdater = SceneUtil::addEnchantedGlow(arrow, mResourceSystem, glowColor);
|
||||
mGlowUpdater = SceneUtil::addEnchantedGlow(std::move(arrow), mResourceSystem, glowColor);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -515,7 +515,7 @@ namespace MWRender
|
|||
|
||||
Animation::Animation(
|
||||
const MWWorld::Ptr& ptr, osg::ref_ptr<osg::Group> parentNode, Resource::ResourceSystem* resourceSystem)
|
||||
: mInsert(parentNode)
|
||||
: mInsert(std::move(parentNode))
|
||||
, mSkeleton(nullptr)
|
||||
, mNodeMapCreated(false)
|
||||
, mPtr(ptr)
|
||||
|
@ -1912,7 +1912,7 @@ namespace MWRender
|
|||
// ------------------------------
|
||||
|
||||
PartHolder::PartHolder(osg::ref_ptr<osg::Node> node)
|
||||
: mNode(node)
|
||||
: mNode(std::move(node))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace MWRender
|
|||
{
|
||||
|
||||
DebugDrawer::DebugDrawer(osg::ref_ptr<osg::Group> parentNode, btCollisionWorld* world, int debugMode)
|
||||
: mParentNode(parentNode)
|
||||
: mParentNode(std::move(parentNode))
|
||||
, mWorld(world)
|
||||
{
|
||||
DebugDrawer::setDebugMode(debugMode);
|
||||
|
|
|
@ -554,7 +554,7 @@ namespace MWRender
|
|||
public:
|
||||
UpdateCameraCallback(
|
||||
osg::ref_ptr<const osg::Node> nodeToFollow, const osg::Vec3& posOffset, const osg::Vec3& lookAtOffset)
|
||||
: mNodeToFollow(nodeToFollow)
|
||||
: mNodeToFollow(std::move(nodeToFollow))
|
||||
, mPosOffset(posOffset)
|
||||
, mLookAtOffset(lookAtOffset)
|
||||
{
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace MWRender
|
|||
{
|
||||
|
||||
EffectManager::EffectManager(osg::ref_ptr<osg::Group> parent, Resource::ResourceSystem* resourceSystem)
|
||||
: mParentNode(parent)
|
||||
: mParentNode(std::move(parent))
|
||||
, mResourceSystem(resourceSystem)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ namespace MWRender
|
|||
|
||||
NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, osg::ref_ptr<osg::Group> parentNode,
|
||||
Resource::ResourceSystem* resourceSystem, bool disableSounds, ViewMode viewMode, float firstPersonFieldOfView)
|
||||
: ActorAnimation(ptr, parentNode, resourceSystem)
|
||||
: ActorAnimation(ptr, std::move(parentNode), resourceSystem)
|
||||
, mViewMode(viewMode)
|
||||
, mShowWeapons(false)
|
||||
, mShowCarriedLeft(true)
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace MWRender
|
|||
|
||||
Pathgrid::Pathgrid(osg::ref_ptr<osg::Group> root)
|
||||
: mPathgridEnabled(false)
|
||||
, mRootNode(root)
|
||||
, mRootNode(std::move(root))
|
||||
, mPathGridRoot(nullptr)
|
||||
, mInteriorPathgridNode(nullptr)
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace
|
|||
{
|
||||
public:
|
||||
PrecipitationOcclusionUpdater(osg::ref_ptr<osg::Texture2D> depthTexture)
|
||||
: mDepthTexture(depthTexture)
|
||||
: mDepthTexture(std::move(depthTexture))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -133,8 +133,8 @@ namespace MWRender
|
|||
ScreenshotManager::ScreenshotManager(osgViewer::Viewer* viewer, osg::ref_ptr<osg::Group> rootNode,
|
||||
osg::ref_ptr<osg::Group> sceneRoot, Resource::ResourceSystem* resourceSystem, Water* water)
|
||||
: mViewer(viewer)
|
||||
, mRootNode(rootNode)
|
||||
, mSceneRoot(sceneRoot)
|
||||
, mRootNode(std::move(rootNode))
|
||||
, mSceneRoot(std::move(sceneRoot))
|
||||
, mDrawCompleteCallback(new NotifyDrawCompletedCallback)
|
||||
, mResourceSystem(resourceSystem)
|
||||
, mWater(water)
|
||||
|
|
|
@ -128,8 +128,8 @@ namespace MWRender
|
|||
|
||||
OcclusionCallback::OcclusionCallback(
|
||||
osg::ref_ptr<osg::OcclusionQueryNode> oqnVisible, osg::ref_ptr<osg::OcclusionQueryNode> oqnTotal)
|
||||
: mOcclusionQueryVisiblePixels(oqnVisible)
|
||||
, mOcclusionQueryTotalPixels(oqnTotal)
|
||||
: mOcclusionQueryVisiblePixels(std::move(oqnVisible))
|
||||
, mOcclusionQueryTotalPixels(std::move(oqnTotal))
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ namespace MWRender
|
|||
public:
|
||||
SunFlashCallback(
|
||||
osg::ref_ptr<osg::OcclusionQueryNode> oqnVisible, osg::ref_ptr<osg::OcclusionQueryNode> oqnTotal)
|
||||
: OcclusionCallback(oqnVisible, oqnTotal)
|
||||
: OcclusionCallback(std::move(oqnVisible), std::move(oqnTotal))
|
||||
, mGlareView(1.f)
|
||||
{
|
||||
}
|
||||
|
@ -238,8 +238,8 @@ namespace MWRender
|
|||
public:
|
||||
SunGlareCallback(osg::ref_ptr<osg::OcclusionQueryNode> oqnVisible,
|
||||
osg::ref_ptr<osg::OcclusionQueryNode> oqnTotal, osg::ref_ptr<osg::PositionAttitudeTransform> sunTransform)
|
||||
: OcclusionCallback(oqnVisible, oqnTotal)
|
||||
, mSunTransform(sunTransform)
|
||||
: OcclusionCallback(std::move(oqnVisible), std::move(oqnTotal))
|
||||
, mSunTransform(std::move(sunTransform))
|
||||
, mTimeOfDayFade(1.f)
|
||||
, mGlareView(1.f)
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace MWRender
|
|||
if (node.getUserValue("overrideFx", index))
|
||||
{
|
||||
if (index == 1)
|
||||
overrideTexture(mTexture, mResourcesystem, nodePtr);
|
||||
overrideTexture(mTexture, mResourcesystem, std::move(nodePtr));
|
||||
}
|
||||
traverse(node);
|
||||
}
|
||||
|
|
|
@ -625,8 +625,8 @@ namespace MWRender
|
|||
, mReflection(reflection)
|
||||
, mRefraction(refraction)
|
||||
, mRipples(ripples)
|
||||
, mProgram(program)
|
||||
, mNormalMap(normalMap)
|
||||
, mProgram(std::move(program))
|
||||
, mNormalMap(std::move(normalMap))
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -714,7 +714,7 @@ namespace MWRender
|
|||
node->setUpdateCallback(mRainIntensityUpdater);
|
||||
|
||||
mShaderWaterStateSetUpdater
|
||||
= new ShaderWaterStateSetUpdater(this, mReflection, mRefraction, mRipples, program, normalMap);
|
||||
= new ShaderWaterStateSetUpdater(this, mReflection, mRefraction, mRipples, std::move(program), normalMap);
|
||||
node->addCullCallback(mShaderWaterStateSetUpdater);
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ namespace MWWorld
|
|||
{
|
||||
PreloadEntry(double timestamp, osg::ref_ptr<SceneUtil::WorkItem> workItem)
|
||||
: mTimeStamp(timestamp)
|
||||
, mWorkItem(workItem)
|
||||
, mWorkItem(std::move(workItem))
|
||||
{
|
||||
}
|
||||
PreloadEntry()
|
||||
|
|
|
@ -254,7 +254,7 @@ namespace MWWorld
|
|||
SceneUtil::AssignControllerSourcesVisitor assignVisitor(state.mEffectAnimationTime);
|
||||
state.mNode->accept(assignVisitor);
|
||||
|
||||
MWRender::overrideFirstRootTexture(texture, mResourceSystem, projectile);
|
||||
MWRender::overrideFirstRootTexture(texture, mResourceSystem, std::move(projectile));
|
||||
}
|
||||
|
||||
void ProjectileManager::update(State& state, float duration)
|
||||
|
|
|
@ -336,7 +336,7 @@ namespace Debug
|
|||
}
|
||||
|
||||
Debug::DebugDrawer::DebugDrawer(Shader::ShaderManager& shaderManager, osg::ref_ptr<osg::Group> parentNode)
|
||||
: mParentNode(parentNode)
|
||||
: mParentNode(std::move(parentNode))
|
||||
{
|
||||
mCurrentFrame = 0;
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace Resource
|
|||
const VFS::Manager* vfs)
|
||||
: osg::NodeVisitor(TRAVERSE_ALL_CHILDREN)
|
||||
, mTarget(target)
|
||||
, mAnimationManager(animationManager)
|
||||
, mAnimationManager(std::move(animationManager))
|
||||
, mNormalized(normalized)
|
||||
, mVFS(vfs)
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace SceneUtil
|
|||
public:
|
||||
CopyRigVisitor(osg::ref_ptr<osg::Group> parent, std::string_view filter)
|
||||
: osg::NodeVisitor(TRAVERSE_ALL_CHILDREN)
|
||||
, mParent(parent)
|
||||
, mParent(std::move(parent))
|
||||
, mFilter(filter)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace SceneUtil
|
|||
}
|
||||
|
||||
osg::ref_ptr<OsgaRigGeometry> rigGeometry = new OsgaRigGeometry(*copy.getSourceRigGeometry(), copyop);
|
||||
setSourceRigGeometry(rigGeometry);
|
||||
setSourceRigGeometry(std::move(rigGeometry));
|
||||
}
|
||||
|
||||
RigGeometryHolder::RigGeometryHolder(const osgAnimation::RigGeometry& copy, const osg::CopyOp& copyop)
|
||||
|
@ -80,7 +80,7 @@ namespace SceneUtil
|
|||
setUseVertexBufferObjects(true);
|
||||
|
||||
osg::ref_ptr<OsgaRigGeometry> rigGeometry = new OsgaRigGeometry(copy, copyop);
|
||||
setSourceRigGeometry(rigGeometry);
|
||||
setSourceRigGeometry(std::move(rigGeometry));
|
||||
}
|
||||
|
||||
void RigGeometryHolder::setSourceRigGeometry(osg::ref_ptr<OsgaRigGeometry> sourceRigGeometry)
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace SDLUtil
|
|||
|
||||
InputWrapper::InputWrapper(SDL_Window* window, osg::ref_ptr<osgViewer::Viewer> viewer, bool grab)
|
||||
: mSDLWindow(window)
|
||||
, mViewer(viewer)
|
||||
, mViewer(std::move(viewer))
|
||||
, mMouseListener(nullptr)
|
||||
, mSensorListener(nullptr)
|
||||
, mKeyboardListener(nullptr)
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace SDLUtil
|
|||
|
||||
VideoWrapper::VideoWrapper(SDL_Window* window, osg::ref_ptr<osgViewer::Viewer> viewer)
|
||||
: mWindow(window)
|
||||
, mViewer(viewer)
|
||||
, mViewer(std::move(viewer))
|
||||
, mGamma(1.f)
|
||||
, mContrast(1.f)
|
||||
, mHasSetGammaContrast(false)
|
||||
|
|
2
extern/osgQt/osgQOpenGLWidget.cpp
vendored
2
extern/osgQt/osgQOpenGLWidget.cpp
vendored
|
@ -83,7 +83,7 @@ CompositeOsgRenderer* osgQOpenGLWidget::getCompositeViewer()
|
|||
|
||||
void osgQOpenGLWidget::setGraphicsWindowEmbedded(osg::ref_ptr<osgViewer::GraphicsWindowEmbedded> osgWinEmb)
|
||||
{
|
||||
if (m_renderer) m_renderer->setGraphicsWindowEmbedded(osgWinEmb);
|
||||
if (m_renderer) m_renderer->setGraphicsWindowEmbedded(std::move(osgWinEmb));
|
||||
}
|
||||
|
||||
void osgQOpenGLWidget::createRenderer()
|
||||
|
|
Loading…
Reference in a new issue