mirror of
https://github.com/zeldaret/botw
synced 2026-05-23 06:54:18 -04:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user