MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Add

Method Add

Source/Editor/Cooker/Steps/CookAssetsStep.cpp:944–970  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

942 }
943
944 bool Add(CookingData& data, AssetsCache::Entry& entry, const String& sourcePath)
945 {
946 const uint64 size = FileSystem::GetFileSize(sourcePath);
947
948 // Check if this will step out of the limit
949 if (addedEntries.Count() + 1 > MaxAssetsPerPackage || (bytesAdded + size) > MaxPackageSize)
950 {
951 if (Package(data))
952 return true;
953 }
954
955 // Add
956 addedEntries.Add(&entry);
957 bytesAdded += size;
958
959 // Gather the asset to package it later
960 auto file = New<FlaxFile>(sourcePath);
961 if (file->Load())
962 {
963 Delete(file);
964 data.Error(TEXT("Failed to load cooked asset."));
965 return true;
966 }
967 files.Add(file);
968
969 return false;
970 }
971
972 bool Package(CookingData& data)
973 {

Callers 15

AddRootAssetMethod · 0.45
AddRootEngineAssetMethod · 0.45
GetToolsMethod · 0.45
OnCollectAssetsMethod · 0.45
BuildMethod · 0.45
PerformMethod · 0.45
CookAssetsStepMethod · 0.45
ProcessMethod · 0.45
PerformMethod · 0.45
DeployBinariesMethod · 0.45
PerformMethod · 0.45
OnDeployBinariesMethod · 0.45

Calls 4

DeleteFunction · 0.85
CountMethod · 0.45
LoadMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected