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

Method InitLandscape

engine/Poseidon/World/WorldInit.cpp:824–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

822}
823
824void World::InitLandscape(Landscape* landscape)
825{
826 _preloadedVType[VTypeStatic] = NewAIType("Static");
827 _preloadedVType[VTypeBuilding] = NewAIType("Building");
828 _preloadedVType[VTypeStrategic] = NewAIType("Strategic");
829 _preloadedVType[VTypeNonStrategic] = NewAIType("NonStrategic");
830 _preloadedVType[VTypeTarget] = NewAIType("Target");
831 _preloadedVType[VTypeAllVehicles] = NewAIType("AllVehicles");
832 _preloadedVType[VTypeAir] = NewAIType("Air");
833 _preloadedVType[VTypePlane] = NewAIType("Plane");
834 _preloadedVType[VTypeShip] = NewAIType("Ship");
835 _preloadedVType[VTypeBigShip] = NewAIType("BigShip");
836 _preloadedVType[VTypeAPC] = NewAIType("APC");
837 _preloadedVType[VTypeTank] = NewAIType("Tank");
838 _preloadedVType[VTypeCar] = NewAIType("Car");
839 _preloadedVType[VTypeMan] = NewAIType("Man");
840
841 Clear();
842
843 if (!ENGINE_CONFIG.landEditor || (Pars >> "CfgWorlds").FindEntry(Glob.header.worldname))
844 {
845 const ParamEntry& world = Pars >> "CfgWorlds" >> Glob.header.worldname;
846 InitGeneral(world);
847
848 ProgressRefresh();
849
850 const ParamEntry& ilsPos = world >> "ilsPosition";
851 const ParamEntry& ilsDir = world >> "ilsDirection";
852 Vector3 mainIlsPos;
853 Vector3 mainIlsDir;
854 mainIlsPos.Init();
855 mainIlsDir.Init();
856 mainIlsPos[0] = ilsPos[0];
857 mainIlsPos[2] = ilsPos[1];
858 mainIlsPos[1] = GLOB_LAND->SurfaceY(mainIlsPos[0], mainIlsPos[2]);
859 mainIlsDir[0] = ilsDir[0];
860 mainIlsDir[1] = ilsDir[1];
861 mainIlsDir[2] = ilsDir[2];
862 mainIlsDir.Normalize();
863
864 _ilsPosWest = mainIlsPos;
865 _ilsDirWest = mainIlsDir;
866
867 GetPosArray(_taxiInPathsWest, world >> "ilsTaxiIn");
868 GetPosArray(_taxiOffPathsWest, world >> "ilsTaxiOff");
869 }
870
871 _scene.Init(_engine, landscape);
872
873 ProgressRefresh();
874
875 if (!_ui && !ENGINE_CONFIG.doCreateDedicatedServer && !AppConfig::Instance().IsViewerMode())
876 {
877 _ui = CreateInGameUI();
878 }
879
880 GScene = GetScene();
881 GLandscape = _scene.GetLandscape();

Callers 1

World_InitLandscapeFunction · 0.80

Calls 14

NewAITypeFunction · 0.85
ProgressRefreshFunction · 0.85
GetPosArrayFunction · 0.85
CreateInGameUIFunction · 0.85
InitEnvSoundsFunction · 0.85
SurfaceYMethod · 0.80
IsViewerModeMethod · 0.80
GetLandscapeMethod · 0.80
InitDynSoundsMethod · 0.80
InitGeographyMethod · 0.80
InitObjectVehiclesMethod · 0.80
FindEntryMethod · 0.45

Tested by

no test coverage detected