diff options
| author | Léo Lam <leo@leolam.fr> | 2022-01-31 12:43:29 +0100 |
|---|---|---|
| committer | Léo Lam <leo@leolam.fr> | 2022-01-31 12:43:50 +0100 |
| commit | e5962967993cb60ca7e758da4e4abcf608468fa5 (patch) | |
| tree | d731378351f2bd188932f2563647c8682ec4f5ee /src | |
| parent | 5c6f24368d5f928078fad813b0f9a6f2f48eba31 (diff) | |
ksys/phys: Use util::allocStorage in CapsuleShape to simplify allocation
Removes the need to write sizeof(T) and alignof(T).
Diffstat (limited to 'src')
| -rw-r--r-- | src/KingSystem/Physics/RigidBody/Shape/physCapsuleShape.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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 <heap/seadHeap.h> #include <math/seadMathCalcCommon.h> #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<hkpCapsuleShape>(heap); if (ptr == nullptr) return nullptr; |
