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

Method Save

Source/Engine/Render2D/FontAsset.cpp:185–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183#if USE_EDITOR
184
185bool FontAsset::Save(const StringView& path)
186{
187 if (OnCheckSave(path))
188 return true;
189 ScopeLock lock(Locker);
190
191 AssetInitData data;
192 data.SerializedVersion = SerializedVersion;
193 data.CustomData.Copy(&_options);
194 auto chunk0 = GetChunk(0);
195 _fontFile.Swap(chunk0->Data);
196 const bool saveResult = path.HasChars() ? SaveAsset(path, data) : SaveAsset(data, true);
197 _fontFile.Swap(chunk0->Data);
198 if (saveResult)
199 {
200 LOG(Error, "Cannot save '{0}'", ToString());
201 return true;
202 }
203
204 return false;
205}
206
207#endif
208

Callers

nothing calls this directly

Calls 5

GetChunkFunction · 0.85
ToStringFunction · 0.50
CopyMethod · 0.45
SwapMethod · 0.45
HasCharsMethod · 0.45

Tested by

no test coverage detected