MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / Load

Method Load

Editor/CryEditDoc.cpp:476–620  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

474
475//////////////////////////////////////////////////////////////////////////
476void CCryEditDoc::Load( CXmlArchive& xmlAr,const CString &szFilename,bool bReloadEngineLevel )
477{
478 CLogFile::FormatLine("Loading from %s...", (const char*)szFilename );
479 CString currentMissionName;
480 CString szLevelPath = Path::GetPath(szFilename);
481
482 AutoSuspendTimeQuota AutoSuspender(GetIEditor()->GetSystem()->GetStreamEngine());
483 // Start recording errors.
484 CErrorsRecorder errorsRecorder;
485
486 m_bDocumentReady = false;
487 int t0 = GetTickCount();
488
489#ifdef PROFILE_LOADING_WITH_VTUNE
490 VTResume();
491#endif
492
493 GetIEditor()->GetSystem()->GetISoundSystem()->Mute(true);
494
495 //////////////////////////////////////////////////////////////////////////
496 //////////////////////////////////////////////////////////////////////////
497 // Serialize Missions //////////////////////////////////////////////////
498 SerializeMissions( xmlAr,currentMissionName );
499
500 // If multiple missions, select specific mission to load.
501 if (GetMissionCount() > 1)
502 {
503 CMissionSelectDialog dlg;
504 if (dlg.DoModal() == IDOK)
505 {
506 currentMissionName = dlg.GetSelected();
507 }
508 }
509
510 if (bReloadEngineLevel)
511 {
512 //////////////////////////////////////////////////////////////////////////
513 // Load Level to The engine
514 // Must appear before loading any objects.
515 // Load level in engine.
516 GetIEditor()->GetGameEngine()->LoadLevel( szLevelPath,currentMissionName,true,true );
517 //////////////////////////////////////////////////////////////////////////
518 }
519
520 // Load water color.
521 xmlAr.root->getAttr( "WaterColor",m_waterColor );
522
523 //////////////////////////////////////////////////////////////////////////
524 // Load materials.
525 //////////////////////////////////////////////////////////////////////////
526 GetIEditor()->GetMaterialManager()->Serialize( xmlAr.root, xmlAr.bLoading );
527
528 //////////////////////////////////////////////////////////////////////////
529 // Load Particles.
530 //////////////////////////////////////////////////////////////////////////
531 GetIEditor()->GetParticleManager()->Serialize( xmlAr.root, xmlAr.bLoading );
532
533 //////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 15

GetIEditorFunction · 0.85
GetStreamEngineMethod · 0.80
GetISoundSystemMethod · 0.80
GetSelectedMethod · 0.80
GetGameEngineMethod · 0.80
GetMaterialManagerMethod · 0.80
GetParticleManagerMethod · 0.80
GetMusicManagerMethod · 0.80
GetEquipPackLibMethod · 0.80
GetEntityProtManagerMethod · 0.80
GetPrefabManagerMethod · 0.80
SyncContentMethod · 0.80

Tested by

no test coverage detected