MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / LoadConfig

Method LoadConfig

engine/Poseidon/World/Scene/Scene.cpp:626–680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

624
625 return buffer;
626}
627void Scene::LoadConfig()
628{
629 RString name = Poseidon::GetUserParams();
630
631 ParamFile cfg;
632 cfg.Parse(name);
633 if (cfg.FindEntry("frameRate"))
634 {
635 float value = cfg >> "frameRate";
636 SetFrameRateSettings(value);
637 }
638 else
639 {
640 SetFrameRateSettings(15);
641 }
642 if (cfg.FindEntry("visualQuality"))
643 {
644 float value = cfg >> "visualQuality";
645 SetQualitySettings(value);
646 }
647 else
648 {
649 const float qFactor = ENGINE_CONFIG.lodCoef * 2 / GEngine->Width();
650
651 SetQualitySettings(qFactor);
652 }
653
654 if (cfg.FindEntry("objectShadows"))
655 {
656 bool value = cfg >> "objectShadows";
657 SetObjectShadows(value);
658 }
659 if (cfg.FindEntry("vehicleShadows"))
660 {
661 bool value = cfg >> "vehicleShadows";
662 SetVehicleShadows(value);
663 }
664 if (cfg.FindEntry("cloudlets"))
665 {
666 bool value = cfg >> "cloudlets";
667 SetCloudlets(value);
668 }
669 if (cfg.FindEntry("viewDistance"))
670 {
671 float value = cfg >> "viewDistance";
672 SetPreferredViewDistance(value);
673 }
674 if (cfg.FindEntry("terrainGrid"))
675 {
676 float value = cfg >> "terrainGrid";
677 SetPreferredTerrainGrid(value);
678 }
679
680 SetPreferredViewDistance(GetSelectedPreferredViewDistance());
681}
682
683void Scene::SaveConfig() const

Callers 2

InitializeSoundMethod · 0.45
UpdateUserProfileFunction · 0.45

Calls 5

GetUserParamsFunction · 0.85
ParseMethod · 0.45
FindEntryMethod · 0.45
WidthMethod · 0.45

Tested by

no test coverage detected