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

Method DeserializePatch

Source/Editor/Tools/Terrain/TerrainTools.cpp:288–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288void TerrainTools::DeserializePatch(Terrain* terrain, const Int2& patchCoord, const StringAnsiView& value)
289{
290 CHECK(terrain);
291 auto patch = terrain->GetPatch(patchCoord);
292 CHECK(patch);
293
294 rapidjson_flax::Document document;
295 document.Parse(value.Get(), value.Length());
296 CHECK(!document.HasParseError());
297
298 auto modifier = Cache::ISerializeModifier.Get();
299 modifier->EngineBuild = FLAXENGINE_VERSION_BUILD;
300 Scripting::ObjectsLookupIdMapping.Set(&modifier.Value->IdsMapping);
301
302 patch->Deserialize(document, modifier.Value);
303 patch->UpdatePostManualDeserialization();
304}
305
306bool TerrainTools::InitializePatch(Terrain* terrain, const Int2& patchCoord)
307{

Callers 1

UndoMethod · 0.80

Calls 8

GetPatchMethod · 0.80
ParseMethod · 0.45
GetMethod · 0.45
LengthMethod · 0.45
HasParseErrorMethod · 0.45
SetMethod · 0.45
DeserializeMethod · 0.45

Tested by

no test coverage detected