2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-14 02:46:09 +00:00

Runtime: Make use of std::make_unique where applicable

Makes use of the C++14 make_unique allocation function to allocate class
instances where applicable instead of a reset with a new operator within
it.

This doesn't touch cases where buffers are allocated, given make_unique
would zero-initialize them.
This commit is contained in:
Lioncash
2019-09-11 23:50:38 -04:00
parent d6166ad666
commit f9079f0215
42 changed files with 227 additions and 205 deletions

View File

@@ -17,7 +17,7 @@ CSeedling::CSeedling(TUniqueId uid, std::string_view name, const CEntityInfo& in
EMovementType::Ground, EColliderType::Zero, EBodyType::WallWalker, actParms, f1, f2,
EKnockBackVariant::Small, f3, EWalkerType::Seedling, f4, false)
, x5d8_searchPath(nullptr, 1, pInfo.GetPathfindingIndex(), 1.f, 1.f)
, x6bc_spikeData(new CModelData(CStaticRes(needleId, GetModelData()->GetScale())))
, x6bc_spikeData(std::make_unique<CModelData>(CStaticRes(needleId, GetModelData()->GetScale())))
, x6c0_projectileInfo(weaponId, dInfo1)
, x6e8_deathDamage(dInfo2)
, x722_24_renderOnlyClusterA(true)