You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Parameters must be registered with the UOL module in much the same way as fragment types. Tidied up globals into a singleton Registry class. Added a function to FUniversalObjectLocator that allows manual addition of fragments. Also removed the defunct IActorLocatorFragmentResolver interface in favor of supplying these parameters externally. Corrected Anim Instance locators being always used when trying to address skeletal mesh components. #rb david.bromberg [CL 29890178 by andrew rodham in ue5-main branch]
55 lines
1.1 KiB
C++
55 lines
1.1 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "UniversalObjectLocatorResolveParams.h"
|
|
#include "UniversalObjectLocatorFragmentType.h"
|
|
#include "UniversalObjectLocatorFragmentTypeHandle.h"
|
|
|
|
namespace UE::UniversalObjectLocator
|
|
{
|
|
|
|
FResolveParameterBuffer::FResolveParameterBuffer()
|
|
: Memory(nullptr)
|
|
, AllParameters(0u)
|
|
, Capacity(0u)
|
|
, Num(0u)
|
|
{
|
|
}
|
|
|
|
FResolveParameterBuffer::~FResolveParameterBuffer()
|
|
{
|
|
Destroy();
|
|
}
|
|
|
|
void FResolveParameterBuffer::Destroy()
|
|
{
|
|
check((Memory == nullptr) == (Num == 0));
|
|
|
|
if (Memory)
|
|
{
|
|
uint8 Index = 0;
|
|
uint32 RemainingParameters = AllParameters;
|
|
while (RemainingParameters != 0)
|
|
{
|
|
// Get the bit offset of the next reminaing bit
|
|
const uint8 BitIndex = static_cast<uint8>(FMath::CountTrailingZeros(RemainingParameters));
|
|
UScriptStruct* Type = FParameterTypeHandle(BitIndex).Resolve();
|
|
|
|
void* Ptr = GetHeader(Index).Resolve(Memory);
|
|
++Index;
|
|
|
|
if (ensure(Type))
|
|
{
|
|
Type->DestroyStruct(Ptr);
|
|
}
|
|
|
|
RemainingParameters = RemainingParameters & ~(1u << BitIndex);
|
|
}
|
|
|
|
if (bCanFreeMemory)
|
|
{
|
|
FMemory::Free(Memory);
|
|
}
|
|
}
|
|
}
|
|
|
|
} // namespace UE::UniversalObjectLocator
|