| 231 | } |
| 232 | |
| 233 | void 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 |
nothing calls this directly
no test coverage detected