虚幻4 加载蓝图过程(2)——读取文件过程

来源:互联网 发布:mac 无线传文件 安卓 编辑:程序博客网 时间:2024/05/21 06:16

读取文件过程

/UnrealEngine/Engine/Source/Runtime/CoreUObject/Private/UObject/LinkerLoad.cpp


/** * Ticks an in-flight linker and spends InTimeLimit seconds on creation. This is a soft time limit used * if bInUseTimeLimit is true. * * @paramInTimeLimitSoft time limit to use if bInUseTimeLimit is true * @parambInUseTimeLimitWhether to use a (soft) timelimit * @parambInUseFullTimeLimitWhether to use the entire time limit, even if blocked on I/O *  * @returntrue if linker has finished creation, false if it is still in flight */FLinkerLoad::ELinkerStatus FLinkerLoad::Tick( float InTimeLimit, bool bInUseTimeLimit, bool bInUseFullTimeLimit ){ELinkerStatus Status = LINKER_Loaded;if( bHasFinishedInitialization == false ){// Store variables used by functions below.TickStartTime= FPlatformTime::Seconds();bTimeLimitExceeded= false;bUseTimeLimit= bInUseTimeLimit;bUseFullTimeLimit= bInUseFullTimeLimit;TimeLimit= InTimeLimit;do{bool bCanSerializePackageFileSummary = false;if (GEventDrivenLoaderEnabled){check(Loader || bDynamicClassLinker);bCanSerializePackageFileSummary = true;}else{// Create loader, aka FArchive used for serialization and also precache the package file summary.// false is returned until any precaching is complete.SCOPED_LOADTIMER(LinkerLoad_CreateLoader);Status = CreateLoader(TFunction<void()>([]() {}));bCanSerializePackageFileSummary = (Status == LINKER_Loaded);}// Serialize the package file summary and presize the various arrays (name, import & export map)if (bCanSerializePackageFileSummary){SCOPED_LOADTIMER(LinkerLoad_SerializePackageFileSummary);Status = SerializePackageFileSummary();}// Serialize the name map and register the names.if( Status == LINKER_Loaded ){SCOPED_LOADTIMER(LinkerLoad_SerializeNameMap);Status = SerializeNameMap();}// Serialize the gatherable text data map.if( Status == LINKER_Loaded ){SCOPED_LOADTIMER(LinkerLoad_SerializeGatherableTextDataMap);Status = SerializeGatherableTextDataMap();}// Serialize the import map.if( Status == LINKER_Loaded ){SCOPED_LOADTIMER(LinkerLoad_SerializeImportMap);Status = SerializeImportMap();}// Serialize the export map.if( Status == LINKER_Loaded ){SCOPED_LOADTIMER(LinkerLoad_SerializeExportMap);Status = SerializeExportMap();}// Fix up import map for backward compatible serialization.if( Status == LINKER_Loaded ){SCOPED_LOADTIMER(LinkerLoad_FixupImportMap);Status = FixupImportMap();}// Fix up export map for object class conversion if( Status == LINKER_Loaded ){SCOPED_LOADTIMER(LinkerLoad_FixupExportMap);Status = FixupExportMap();}// Serialize the dependency map.if( Status == LINKER_Loaded ){SCOPED_LOADTIMER(LinkerLoad_SerializeDependsMap);Status = SerializeDependsMap();}// Hash exports.if( Status == LINKER_Loaded ){SCOPED_LOADTIMER(LinkerLoad_CreateExportHash);Status = CreateExportHash();}// Find existing objects matching exports and associate them with this linker.if( Status == LINKER_Loaded ){SCOPED_LOADTIMER(LinkerLoad_FindExistingExports);Status = FindExistingExports();}if (Status == LINKER_Loaded){SCOPED_LOADTIMER(LinkerLoad_SerializePreloadDependencies);Status = SerializePreloadDependencies();}// Finalize creation process.if( Status == LINKER_Loaded ){SCOPED_LOADTIMER(LinkerLoad_FinalizeCreation);Status = FinalizeCreation();}}// Loop till we are done if no time limit is specified, or loop until the real time limit is up if we want to use full timewhile (Status == LINKER_TimedOut && (!bUseTimeLimit || (bUseFullTimeLimit && !IsTimeLimitExceeded(TEXT("Checking Full Timer")))));}if (Status == LINKER_Failed){LinkerRoot->LinkerLoad = nullptr;#if WITH_EDITORdelete LoadProgressScope;LoadProgressScope = nullptr;#endif}// Return whether we completed or not.return Status;}


原创粉丝点击