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

Method SaveSceneToBytes

Source/Engine/Level/Level.cpp:1574–1595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1572}
1573
1574bool Level::SaveSceneToBytes(Scene* scene, rapidjson_flax::StringBuffer& outData, bool prettyJson)
1575{
1576 ASSERT(scene);
1577 ScopeLock lock(_sceneActionsLocker);
1578 Stopwatch stopwatch;
1579 LOG(Info, "Saving scene {0} to bytes", scene->GetName());
1580
1581 // Serialize to json
1582 if (saveScene(scene, outData, prettyJson))
1583 {
1584 CallSceneEvent(SceneEventType::OnSceneSaveError, scene, scene->GetID());
1585 return true;
1586 }
1587
1588 stopwatch.Stop();
1589 LOG(Info, "Scene saved! Time {0}ms", stopwatch.GetMilliseconds());
1590
1591 // Fire event
1592 CallSceneEvent(SceneEventType::OnSceneSaved, scene, scene->GetID());
1593
1594 return false;
1595}
1596
1597Array<byte> Level::SaveSceneToBytes(Scene* scene, bool prettyJson)
1598{

Callers 2

GatherSceneDataMethod · 0.80
CreateSceneFileMethod · 0.80

Calls 6

GetIDMethod · 0.80
GetNameMethod · 0.45
StopMethod · 0.45
SetMethod · 0.45
GetStringMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected