From e5962967993cb60ca7e758da4e4abcf608468fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 31 Jan 2022 12:43:29 +0100 Subject: [PATCH] ksys/phys: Use util::allocStorage in CapsuleShape to simplify allocation Removes the need to write sizeof(T) and alignof(T). --- src/KingSystem/Physics/RigidBody/Shape/physCapsuleShape.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/KingSystem/Physics/RigidBody/Shape/physCapsuleShape.cpp b/src/KingSystem/Physics/RigidBody/Shape/physCapsuleShape.cpp index 99c71ddc..55ad7237 100644 --- a/src/KingSystem/Physics/RigidBody/Shape/physCapsuleShape.cpp +++ b/src/KingSystem/Physics/RigidBody/Shape/physCapsuleShape.cpp @@ -3,6 +3,7 @@ #include #include #include "KingSystem/Physics/physConversions.h" +#include "KingSystem/Utils/HeapUtil.h" namespace ksys::phys { @@ -21,7 +22,7 @@ void CapsuleShape::setMaterialMask(const MaterialMask& mask) { } CapsuleShape* CapsuleShapeParam::createShape(sead::Heap* heap) { - void* ptr = heap->tryAlloc(sizeof(hkpCapsuleShape), 0x10); + void* ptr = util::allocStorage(heap); if (ptr == nullptr) return nullptr;