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

Function WriteObjectToBytes

Source/Engine/Level/Actor.cpp:1771–1784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1769}
1770
1771void WriteObjectToBytes(SceneObject* obj, rapidjson_flax::StringBuffer& buffer, MemoryWriteStream& output)
1772{
1773 // Create JSON
1774 CompactJsonWriter writer(buffer);
1775 writer.SceneObject(obj);
1776
1777 // Write json to output
1778 // TODO: maybe compress json or use binary serialization
1779 output.WriteInt32((int32)buffer.GetSize());
1780 output.WriteBytes((byte*)buffer.GetString(), (int32)buffer.GetSize());
1781
1782 // Reuse string buffer
1783 buffer.Clear();
1784}
1785
1786bool Actor::ToBytes(const Array<Actor*>& actors, MemoryWriteStream& output)
1787{

Callers

nothing calls this directly

Calls 6

SceneObjectMethod · 0.45
WriteInt32Method · 0.45
GetSizeMethod · 0.45
WriteBytesMethod · 0.45
GetStringMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected