mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-15 16:46:10 +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:
@@ -103,7 +103,8 @@ const SSphereJointInfo CFlaahgraTentacle::skJointList[3] = {{"Arm_8", 2.f}, {"Ar
|
||||
void CFlaahgraTentacle::SetupCollisionManager(CStateManager& mgr) {
|
||||
std::vector<CJointCollisionDescription> jointList;
|
||||
AddSphereCollisionList(skJointList, 3, jointList);
|
||||
x56c_collisionManager.reset(new CCollisionActorManager(mgr, GetUniqueId(), GetAreaIdAlways(), jointList, true));
|
||||
x56c_collisionManager =
|
||||
std::make_unique<CCollisionActorManager>(mgr, GetUniqueId(), GetAreaIdAlways(), jointList, true);
|
||||
|
||||
for (u32 i = 0; i < x56c_collisionManager->GetNumCollisionActors(); ++i) {
|
||||
const CJointCollisionDescription& desc = x56c_collisionManager->GetCollisionDescFromIndex(i);
|
||||
|
||||
Reference in New Issue
Block a user