本文整理汇总了C++中FArchive::DoDelta方法的典型用法代码示例。如果您正苦于以下问题:C++ FArchive::DoDelta方法的具体用法?C++ FArchive::DoDelta怎么用?C++ FArchive::DoDelta使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FArchive
的用法示例。
在下文中一共展示了FArchive::DoDelta方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SerializeTaggedProperties
void UUserDefinedStruct::SerializeTaggedProperties(FArchive& Ar, uint8* Data, UStruct* DefaultsStruct, uint8* Defaults, const UObject* BreakRecursionIfFullyLoad) const
{
#if WITH_EDITOR
/* The following code is responsible for UUserDefinedStruct's default values serialization. */
auto UDDefaultsStruct = Cast<UUserDefinedStruct>(DefaultsStruct);
const bool bDuplicate = (0 != (Ar.GetPortFlags() & PPF_Duplicate));
/* When saving delta, we want the difference between current data and true structure's default values.
When Defaults is NULL then zeroed data will be used for comparison.*/
const bool bUseNewDefaults = !Defaults
&& UDDefaultsStruct
&& Ar.DoDelta()
&& Ar.IsSaving()
&& !bDuplicate
&& !Ar.IsCooking();
/* Object serialized from delta will have missing properties filled with zeroed data,
we want structure's default data instead */
const bool bLoadDefaultFirst = UDDefaultsStruct
&& !bDuplicate
&& Ar.IsLoading();
const bool bPrepareDefaultStruct = bUseNewDefaults || bLoadDefaultFirst;
FStructOnScope StructDefaultMem(bPrepareDefaultStruct ? UDDefaultsStruct : NULL);
if (bPrepareDefaultStruct)
{
FStructureEditorUtils::Fill_MakeStructureDefaultValue(UDDefaultsStruct, StructDefaultMem.GetStructMemory());
}
if (bUseNewDefaults)
{
Defaults = StructDefaultMem.GetStructMemory();
}
if (bLoadDefaultFirst)
{
if (Defaults == nullptr)
{
Defaults = StructDefaultMem.GetStructMemory();
}
UDDefaultsStruct->CopyScriptStruct(Data, Defaults);
}
#endif // WITH_EDITOR
Super::SerializeTaggedProperties(Ar, Data, DefaultsStruct, Defaults);
}