/////////////////////////////////////////////////////////////////////
| 474 | |
| 475 | ////////////////////////////////////////////////////////////////////////// |
| 476 | void 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 | ////////////////////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected