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

Method Create

Source/Engine/Content/Storage/FlaxStorage.cpp:902–938  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

900#if USE_EDITOR
901
902bool FlaxStorage::Create(const StringView& path, Span<AssetInitData> assets, bool silentMode, const CustomData* customData)
903{
904 PROFILE_CPU();
905 ZoneText(*path, path.Length());
906 LOG(Info, "Creating package at \'{0}\'. Silent Mode: {1}", path, silentMode);
907
908 // Prepare to have access to the file
909 auto storage = ContentStorageManager::EnsureAccess(path);
910
911 // Open file
912 auto stream = FileWriteStream::Open(path);
913 if (stream == nullptr)
914 return true;
915
916 // Create package
917 bool result = Create(stream, assets, customData);
918
919 // Close file
920 Delete(stream);
921
922 // Reload storage container
923 if (storage && storage->IsLoaded())
924 {
925 if (silentMode)
926 {
927 // Silent data-only reload (loaded chunks location in file has been updated)
928 storage->ReloadSilent();
929 }
930 else
931 {
932 // Full reload
933 storage->Reload();
934 }
935 }
936
937 return result;
938}
939
940bool FlaxStorage::Create(WriteStream* stream, Span<AssetInitData> assets, const CustomData* customData)
941{

Callers 1

loadMethod · 0.45

Calls 15

DeleteFunction · 0.85
SerializedEntryV9Class · 0.85
EnumHasAnyFlagsFunction · 0.85
LZ4_compressBoundFunction · 0.85
LZ4_compress_defaultFunction · 0.85
MemoryClearFunction · 0.85
ReloadSilentMethod · 0.80
CreateFunction · 0.70
LocationClass · 0.70
LengthMethod · 0.45
IsLoadedMethod · 0.45
ReloadMethod · 0.45

Tested by

no test coverage detected