| 678 | } |
| 679 | |
| 680 | bool Editor::Init() |
| 681 | { |
| 682 | // Scripts project files generation from command line |
| 683 | if (CommandLine::Options.GenProjectFiles.IsTrue()) |
| 684 | { |
| 685 | const String customArgs = TEXT("-verbose -log -logfile=\"Cache/Intermediate/ProjectFileLog.txt\""); |
| 686 | const bool failed = ScriptsBuilder::GenerateProject(customArgs); |
| 687 | exit(failed ? 1 : 0); |
| 688 | return true; |
| 689 | } |
| 690 | PROFILE_CPU(); |
| 691 | PROFILE_MEM(Editor); |
| 692 | |
| 693 | // If during last lightmaps baking engine crashed we could try to restore the progress |
| 694 | ShadowsOfMordor::Builder::Instance()->CheckIfRestoreState(); |
| 695 | |
| 696 | Engine::Update.Bind(&EditorImpl::OnUpdate); |
| 697 | Managed = New<ManagedEditor>(); |
| 698 | |
| 699 | // Show splash screen |
| 700 | if (!CommandLine::Options.Headless.IsTrue()) |
| 701 | { |
| 702 | PROFILE_CPU_NAMED("Splash"); |
| 703 | if (EditorImpl::Splash == nullptr) |
| 704 | EditorImpl::Splash = New<SplashScreen>(); |
| 705 | EditorImpl::Splash->SetTitle(Project->Name); |
| 706 | EditorImpl::Splash->Show(); |
| 707 | } |
| 708 | |
| 709 | // Initialize managed editor |
| 710 | Managed->Init(); |
| 711 | |
| 712 | // Start play if requested by cmd line |
| 713 | if (CommandLine::Options.Play.HasValue()) |
| 714 | { |
| 715 | Managed->RequestStartPlayOnEditMode(); |
| 716 | } |
| 717 | |
| 718 | return false; |
| 719 | } |
| 720 | |
| 721 | void Editor::BeforeRun() |
| 722 | { |
nothing calls this directly
no test coverage detected