ksys/phys: Use util::allocStorage in CapsuleShape to simplify allocation

Removes the need to write sizeof(T) and alignof(T).
This commit is contained in:
Léo Lam 2022-01-31 12:43:29 +01:00
parent 5c6f24368d
commit e596296799
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
1 changed files with 2 additions and 1 deletions

View File

@ -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;