本文整理汇总了C++中FArchive::IsAllowingLazyLoading方法的典型用法代码示例。如果您正苦于以下问题:C++ FArchive::IsAllowingLazyLoading方法的具体用法?C++ FArchive::IsAllowingLazyLoading怎么用?C++ FArchive::IsAllowingLazyLoading使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FArchive
的用法示例。
在下文中一共展示了FArchive::IsAllowingLazyLoading方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Serialize
//.........这里部分代码省略.........
// We're loading from the persistent archive.
if( Ar.IsLoading() )
{
Filename = TEXT("");
// @todo when Landscape (and others?) only Lock/Unlock once, we can enable this
if (false) // FPlatformProperties::RequiresCookedData())
{
// Bulk data that is being serialized via seekfree loading is single use only. This allows us
// to free the memory as e.g. the bulk data won't be attached to an archive in the case of
// seek free loading.
BulkDataFlags |= BULKDATA_SingleUse;
}
// Size on disk, which in the case of compression is != GetBulkDataSize()
Ar << BulkDataSizeOnDisk;
Ar << BulkDataOffsetInFile;
// fix up the file offset
if (Owner != NULL && Owner->GetLinker())
{
BulkDataOffsetInFile += Owner->GetLinker()->Summary.BulkDataStartOffset;
}
// determine whether the payload is stored inline or at the end of the file
bool bPayloadInline = !(BulkDataFlags&BULKDATA_PayloadAtEndOfFile);
// check( (bPayloadInline && BulkDataOffsetInFile == Ar.Tell()) ||
// (!bPayloadInline && BulkDataOffsetInFile > Ar.Tell()));
// We're allowing defered serialization.
if( Ar.IsAllowingLazyLoading() && Owner != NULL)
{
Linker = Owner->GetLinker();
#if WITH_EDITOR
check(Linker);
Ar.AttachBulkData( Owner, this );
AttachedAr = &Ar;
#else
check(Linker.IsValid());
Filename = Linker->Filename;
#endif // WITH_EDITOR
// only skip over payload, if it's stored inline
if (bPayloadInline)
{
Ar.Seek( Ar.Tell() + BulkDataSizeOnDisk );
}
}
// Serialize the bulk data right away.
else
{
// memory for bulk data can come from preallocated GPU-accessible resource memory or default to system memory
BulkData = GetBulkDataResourceMemory(Owner,Idx);
if( !BulkData )
{
BulkData = FMemory::Realloc( BulkData, GetBulkDataSize() );
}
if (bPayloadInline)
{
// if the payload is stored inline, just serialize it
SerializeBulkData( Ar, BulkData );