| 1769 | } |
| 1770 | |
| 1771 | void 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 | |
| 1786 | bool Actor::ToBytes(const Array<Actor*>& actors, MemoryWriteStream& output) |
| 1787 | { |
nothing calls this directly
no test coverage detected