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

Method Deserialize

Source/Engine/Core/Config/GameSettings.cpp:233–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233void GameSettings::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)
234{
235 // Load properties
236 ProductName = JsonTools::GetString(stream, "ProductName");
237 CompanyName = JsonTools::GetString(stream, "CompanyName");
238 CopyrightNotice = JsonTools::GetString(stream, "CopyrightNotice");
239 Version = JsonTools::GetString(stream, "Version");
240 Icon = JsonTools::GetGuid(stream, "Icon");
241 FirstScene = JsonTools::GetGuid(stream, "FirstScene");
242 NoSplashScreen = JsonTools::GetBool(stream, "NoSplashScreen", NoSplashScreen);
243 SplashScreen = JsonTools::GetGuid(stream, "SplashScreen");
244 CustomSettings.Clear();
245 const auto customSettings = stream.FindMember("CustomSettings");
246 if (customSettings != stream.MemberEnd() && (customSettings->value.IsObject() || customSettings->value.IsArray()))
247 {
248 auto& items = customSettings->value;
249 for (auto it = items.MemberBegin(); it != items.MemberEnd(); ++it)
250 {
251 if (it->value.IsString() && it->value.GetStringLength() == 32)
252 {
253 String key = it->name.GetText();
254 const Guid value = JsonTools::GetGuid(it->value);
255 CustomSettings[key] = value;
256 }
257 }
258 }
259
260 // Settings containers
261 DESERIALIZE(Time);
262 DESERIALIZE(Audio);
263 DESERIALIZE(LayersAndTags);
264 DESERIALIZE(Physics);
265 DESERIALIZE(Input);
266 DESERIALIZE(Graphics);
267 DESERIALIZE(Network);
268 DESERIALIZE(Navigation);
269 DESERIALIZE(Localization);
270 DESERIALIZE(GameCooking);
271 DESERIALIZE(Streaming);
272
273 // Per-platform settings containers
274 DESERIALIZE(WindowsPlatform);
275 DESERIALIZE(UWPPlatform);
276 DESERIALIZE(LinuxPlatform);
277 DESERIALIZE(PS4Platform);
278 DESERIALIZE(XboxOnePlatform);
279 DESERIALIZE(XboxScarlettPlatform);
280 DESERIALIZE(AndroidPlatform);
281 DESERIALIZE(SwitchPlatform);
282 DESERIALIZE(PS5Platform);
283 DESERIALIZE(MacPlatform);
284 DESERIALIZE(iOSPlatform);
285 DESERIALIZE(WebPlatform);
286}
287
288#if USE_EDITOR
289

Callers

nothing calls this directly

Calls 12

GetGuidFunction · 0.85
FindMemberMethod · 0.80
MemberEndMethod · 0.80
MemberBeginMethod · 0.80
GetStringFunction · 0.50
GetBoolFunction · 0.50
ClearMethod · 0.45
GetStringLengthMethod · 0.45
GetTextMethod · 0.45
EnsureCapacityMethod · 0.45
SizeMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected