mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 19:15:41 +00:00
Explicitly ignore result of std::unique_ptr::release call
components/nifbullet/bulletnifloader.cpp:206:13: warning: the value returned by this function should be used [bugprone-unused-return-value] boxShape.release(); ^~~~~~~~~~~~~~~~~~ components/nifbullet/bulletnifloader.cpp:232:13: warning: the value returned by this function should be used [bugprone-unused-return-value] child.release(); ^~~~~~~~~~~~~~~ components/nifbullet/bulletnifloader.cpp:233:13: warning: the value returned by this function should be used [bugprone-unused-return-value] mStaticMesh.release(); ^~~~~~~~~~~~~~~~~~~~~ components/nifbullet/bulletnifloader.cpp:240:9: warning: the value returned by this function should be used [bugprone-unused-return-value] mStaticMesh.release(); ^~~~~~~~~~~~~~~~~~~~~ components/nifbullet/bulletnifloader.cpp:246:9: warning: the value returned by this function should be used [bugprone-unused-return-value] mAvoidStaticMesh.release(); ^~~~~~~~~~~~~~~~~~~~~~~~~~ components/nifbullet/bulletnifloader.cpp:411:9: warning: the value returned by this function should be used [bugprone-unused-return-value] childMesh.release(); ^~~~~~~~~~~~~~~~~~~ components/nifbullet/bulletnifloader.cpp:425:9: warning: the value returned by this function should be used [bugprone-unused-return-value] childShape.release(); ^~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
bd7f56ddb4
commit
b4f12aace1
1 changed files with 8 additions and 7 deletions
|
@ -4,6 +4,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <variant>
|
#include <variant>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <tuple>
|
||||||
|
|
||||||
#include <BulletCollision/CollisionShapes/btBoxShape.h>
|
#include <BulletCollision/CollisionShapes/btBoxShape.h>
|
||||||
#include <BulletCollision/CollisionShapes/btTriangleMesh.h>
|
#include <BulletCollision/CollisionShapes/btTriangleMesh.h>
|
||||||
|
@ -205,7 +206,7 @@ osg::ref_ptr<Resource::BulletShape> BulletNifLoader::load(const Nif::File& nif)
|
||||||
btTransform transform = btTransform::getIdentity();
|
btTransform transform = btTransform::getIdentity();
|
||||||
transform.setOrigin(center);
|
transform.setOrigin(center);
|
||||||
compound->addChildShape(transform, boxShape.get());
|
compound->addChildShape(transform, boxShape.get());
|
||||||
boxShape.release();
|
std::ignore = boxShape.release();
|
||||||
|
|
||||||
mShape->mCollisionShape.reset(compound.release());
|
mShape->mCollisionShape.reset(compound.release());
|
||||||
return mShape;
|
return mShape;
|
||||||
|
@ -231,21 +232,21 @@ osg::ref_ptr<Resource::BulletShape> BulletNifLoader::load(const Nif::File& nif)
|
||||||
trans.setIdentity();
|
trans.setIdentity();
|
||||||
std::unique_ptr<btCollisionShape> child = std::make_unique<Resource::TriangleMeshShape>(mStaticMesh.get(), true);
|
std::unique_ptr<btCollisionShape> child = std::make_unique<Resource::TriangleMeshShape>(mStaticMesh.get(), true);
|
||||||
mCompoundShape->addChildShape(trans, child.get());
|
mCompoundShape->addChildShape(trans, child.get());
|
||||||
child.release();
|
std::ignore = child.release();
|
||||||
mStaticMesh.release();
|
std::ignore = mStaticMesh.release();
|
||||||
}
|
}
|
||||||
mShape->mCollisionShape = std::move(mCompoundShape);
|
mShape->mCollisionShape = std::move(mCompoundShape);
|
||||||
}
|
}
|
||||||
else if (mStaticMesh != nullptr && mStaticMesh->getNumTriangles() > 0)
|
else if (mStaticMesh != nullptr && mStaticMesh->getNumTriangles() > 0)
|
||||||
{
|
{
|
||||||
mShape->mCollisionShape.reset(new Resource::TriangleMeshShape(mStaticMesh.get(), true));
|
mShape->mCollisionShape.reset(new Resource::TriangleMeshShape(mStaticMesh.get(), true));
|
||||||
mStaticMesh.release();
|
std::ignore = mStaticMesh.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mAvoidStaticMesh != nullptr && mAvoidStaticMesh->getNumTriangles() > 0)
|
if (mAvoidStaticMesh != nullptr && mAvoidStaticMesh->getNumTriangles() > 0)
|
||||||
{
|
{
|
||||||
mShape->mAvoidCollisionShape.reset(new Resource::TriangleMeshShape(mAvoidStaticMesh.get(), false));
|
mShape->mAvoidCollisionShape.reset(new Resource::TriangleMeshShape(mAvoidStaticMesh.get(), false));
|
||||||
mAvoidStaticMesh.release();
|
std::ignore = mAvoidStaticMesh.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
return mShape;
|
return mShape;
|
||||||
|
@ -410,7 +411,7 @@ void BulletNifLoader::handleNiTriShape(const Nif::NiGeometry& niGeometry, const
|
||||||
mCompoundShape.reset(new btCompoundShape);
|
mCompoundShape.reset(new btCompoundShape);
|
||||||
|
|
||||||
auto childShape = std::make_unique<Resource::TriangleMeshShape>(childMesh.get(), true);
|
auto childShape = std::make_unique<Resource::TriangleMeshShape>(childMesh.get(), true);
|
||||||
childMesh.release();
|
std::ignore = childMesh.release();
|
||||||
|
|
||||||
float scale = niGeometry.trafo.scale;
|
float scale = niGeometry.trafo.scale;
|
||||||
for (const Nif::Parent* parent = nodeParent; parent != nullptr; parent = parent->mParent)
|
for (const Nif::Parent* parent = nodeParent; parent != nullptr; parent = parent->mParent)
|
||||||
|
@ -424,7 +425,7 @@ void BulletNifLoader::handleNiTriShape(const Nif::NiGeometry& niGeometry, const
|
||||||
mShape->mAnimatedShapes.emplace(niGeometry.recIndex, mCompoundShape->getNumChildShapes());
|
mShape->mAnimatedShapes.emplace(niGeometry.recIndex, mCompoundShape->getNumChildShapes());
|
||||||
|
|
||||||
mCompoundShape->addChildShape(trans, childShape.get());
|
mCompoundShape->addChildShape(trans, childShape.get());
|
||||||
childShape.release();
|
std::ignore = childShape.release();
|
||||||
}
|
}
|
||||||
else if (avoid)
|
else if (avoid)
|
||||||
fillTriangleMesh(mAvoidStaticMesh, niGeometry, transform);
|
fillTriangleMesh(mAvoidStaticMesh, niGeometry, transform);
|
||||||
|
|
Loading…
Reference in a new issue