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

Method InitEditor

engine/Poseidon/World/WorldInit.cpp:314–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312void AIGlobalInit();
313
314void World::InitEditor(Landscape* landscape, Entity* cursor)
315{
316 _scene.Init(_engine, landscape);
317
318 GScene = GetScene();
319 GLandscape = _scene.GetLandscape();
320
321 InitGeneral();
322
323 InitFinish();
324 _scene.GetLandscape()->InitObjectVehicles();
325
326 VehicleTypes.Preload();
327
328 EnvSoundPars[5].name = "SOUND\\$DEFAULT$.WSS";
329 EnvSoundParsNight[5].name = "SOUND\\$DEFAULT$.WSS";
330
331 const char* ext = strrchr(LoadFile, '.');
332 if (ext && QIFStreamB::FileExist(LoadFile))
333 {
334 if (!strcmpi(ext, ".p3d"))
335 {
336 ReloadViewer(LoadFile, "");
337 InitCameraPars();
338
339 GLOB_ENGINE->ReinitCounters();
340 return;
341 }
342 else
343 {
344 SwitchLandscape(LoadFile);
345 }
346 }
347
348 {
349 Vector3 cPos(2525, 5, 2925);
350 cursor->SetPosition(cPos);
351 AddVehicle(cursor);
352 GetGameState()->VarSet("bis_buldozer_cursor", GameValueExt(cursor), true);
353 _cameraOn = cursor;
354
355 InitCameraPars();
356 _scene.GetLandscape()->InitGeography();
357 }
358
359 RString initScript = RString("scripts\\editor.sqs");
360 if (QIFStreamB::FileExist(initScript))
361 {
362 Script* script = new Script("editor.sqs", GameValue(), INT_MAX);
363 AddScript(script);
364 SimulateScripts();
365 }
366}
367
368void World::InitCameraPars()
369{

Callers

nothing calls this directly

Calls 12

GameValueExtClass · 0.85
GetLandscapeMethod · 0.80
InitObjectVehiclesMethod · 0.80
ReinitCountersMethod · 0.80
InitGeographyMethod · 0.80
strcmpiFunction · 0.50
RStringClass · 0.50
GameValueClass · 0.50
InitMethod · 0.45
PreloadMethod · 0.45
SetPositionMethod · 0.45
VarSetMethod · 0.45

Tested by

no test coverage detected