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

Method SaveHeader

Source/Engine/Content/Assets/Model.cpp:322–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320#if USE_EDITOR
321
322bool Model::SaveHeader(WriteStream& stream) const
323{
324 if (ModelBase::SaveHeader(stream))
325 return true;
326 static_assert(MODEL_HEADER_VERSION == 2, "Update code");
327
328 // LODs
329 stream.Write((byte)LODs.Count());
330 for (int32 lodIndex = 0; lodIndex < LODs.Count(); lodIndex++)
331 {
332 auto& lod = LODs[lodIndex];
333 stream.Write(lod.ScreenSize);
334
335 // Meshes
336 stream.Write((uint16)lod.Meshes.Count());
337 for (const auto& mesh : lod.Meshes)
338 {
339 stream.Write(mesh.GetMaterialSlotIndex());
340 stream.Write(mesh.GetBox());
341 stream.Write(mesh.GetSphere());
342 stream.Write((int8)mesh.LightmapUVsIndex);
343 }
344 }
345
346 return false;
347}
348
349bool Model::SaveHeader(WriteStream& stream, const ModelData& modelData)
350{

Callers

nothing calls this directly

Calls 5

GetSphereMethod · 0.80
CalculateBoundsMethod · 0.80
WriteMethod · 0.45
CountMethod · 0.45
GetBoxMethod · 0.45

Tested by

no test coverage detected