1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-30 07:21:12 +00:00

make use of std::make_unique to test that MSVC2015 can handle that

This commit is contained in:
Bret Curtis 2019-04-10 11:09:44 +02:00
parent df9a8cf957
commit 2ab7f903d7
3 changed files with 3 additions and 4 deletions

View File

@ -261,7 +261,7 @@ const MWMechanics::PathgridGraph& MWMechanics::AiPackage::getPathGridGraph(const
CacheMap::iterator found = cache.find(id); CacheMap::iterator found = cache.find(id);
if (found == cache.end()) if (found == cache.end())
{ {
cache.insert(std::make_pair(id, std::unique_ptr<MWMechanics::PathgridGraph>(new MWMechanics::PathgridGraph(cell)))); cache.insert(std::make_pair(id, std::make_unique<MWMechanics::PathgridGraph>(MWMechanics::PathgridGraph(cell))));
} }
return *cache[id].get(); return *cache[id].get();
} }

View File

@ -92,7 +92,6 @@ osg::ref_ptr<Resource::BulletShape> BulletNifLoader::load(const Nif::File& nif)
if (findBoundingBox(node)) if (findBoundingBox(node))
{ {
std::unique_ptr<btCompoundShape> compound (new btCompoundShape); std::unique_ptr<btCompoundShape> compound (new btCompoundShape);
std::unique_ptr<btBoxShape> boxShape(new btBoxShape(getbtVector(mShape->mCollisionBoxHalfExtents))); std::unique_ptr<btBoxShape> boxShape(new btBoxShape(getbtVector(mShape->mCollisionBoxHalfExtents)));
btTransform transform = btTransform::getIdentity(); btTransform transform = btTransform::getIdentity();
transform.setOrigin(getbtVector(mShape->mCollisionBoxTranslate)); transform.setOrigin(getbtVector(mShape->mCollisionBoxTranslate));

View File

@ -10,10 +10,10 @@ BsaArchive::BsaArchive(const std::string &filename)
Bsa::BsaVersion bsaVersion = Bsa::CompressedBSAFile::detectVersion(filename); Bsa::BsaVersion bsaVersion = Bsa::CompressedBSAFile::detectVersion(filename);
if (bsaVersion == Bsa::BSAVER_COMPRESSED) { if (bsaVersion == Bsa::BSAVER_COMPRESSED) {
mFile = std::unique_ptr<Bsa::CompressedBSAFile>(new Bsa::CompressedBSAFile()); mFile = std::make_unique<Bsa::CompressedBSAFile>(Bsa::CompressedBSAFile());
} }
else { else {
mFile = std::unique_ptr<Bsa::BSAFile>(new Bsa::BSAFile()); mFile = std::make_unique<Bsa::BSAFile>(Bsa::BSAFile());
} }
mFile->open(filename); mFile->open(filename);