private void timer1_Tick(object sender, EventArgs e) { if (EditorUtility.IsDesignerHosted(this)) { return; } if (!loaded) { return; } if (MainWidget) { //!!!!! //!!!!где еще вызывать? if (EngineApp.Instance != null) { EngineApp.DoTick(); } //!!!! //UpdateSoundSystem(); //if( needClose ) //{ // needClose = false; // Close(); //} //if( firstTick ) //{ // firstTick = false; //} canSaveConfig = true; //firstTick = false; } }
private void timer1_Tick(object sender, EventArgs e) { if (EditorUtility.IsDesignerHosted(this)) { return; } if (!loaded) { return; } //!!!!!slowly? //!!!!!! //if( needSelectResource != null ) //{ // var selectResource = needSelectResource; // needSelectResource = null; // //ContentObjectSettings.Instance.SelectResource( selectResource ); //} //UpdatePagesVisibility(); //!!!!! //!!!!где еще вызывать? if (EngineApp.Instance != null) { EngineApp.DoTick(); } if (EngineApp.GetSystemTime() - lastSlowUpdatingTime > 0.2 && !firstTick) { QATButtonsUpdate(); RibbonUpdate(); UpdateText(); lastSlowUpdatingTime = EngineApp.GetSystemTime(); } //save editor settings EditorSettingsSerialization.Dump(); ScreenNotifications.Update(); if (!needClose) { EditorAPI.SelectedDocumentWindowChangedUpdate(); } if (!needClose) { foreach (var document in EditorAPI.Documents) { document.EditorUpdateWhenDocumentModified_Tick(); } } if (!needClose) { PreviewIconsManager.Update(); } ////!!!!temp //CheckRestartApplicationToApplyChanged(); if (!needClose) { UpdateSoundSystem(); } //save editor settings if (!needClose) { KryptonAutoHiddenSlidePanel.Animate = ProjectSettings.Get.AnimateWindowsAutoHiding; } //if( !needClose ) // ScriptEditorEngine.Instance.UpdateSettings(); UpdateVisibilityOfFloatingWindows(); if (needClose) { needClose = false; Close(); } if (firstTick) { //!!!!new firstTick = false; if (SplashForm.Instance != null) { SplashForm.Instance.AllowClose = true; } // hide cover show ribbon. kryptonRibbon.Visible = true; if (coverControl != null) { Controls.Remove(coverControl); } //coverControl.Visible = false; if (EditorSettingsSerialization.ShowTipsAsStartup) { EditorAPI.ShowTips(); } } canSaveConfig = true; firstTick = false; }
private void timer1_Tick(object sender, EventArgs e) { if (!IsHandleCreated || WinFormsUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication) { return; } if (!loaded) { return; } //!!!!!slowly? //!!!!!! //if( needSelectResource != null ) //{ // var selectResource = needSelectResource; // needSelectResource = null; // //ContentObjectSettings.Instance.SelectResource( selectResource ); //} //UpdatePagesVisibility(); //!!!!! //!!!!где еще вызывать? if (EngineApp.Instance != null) { EngineApp.DoTick(); } if (EngineApp.GetSystemTime() - lastSlowUpdatingTime > 0.2 && !firstTick) { QATButtonsUpdate(); RibbonUpdate(); UpdateText(); lastSlowUpdatingTime = EngineApp.GetSystemTime(); } //save editor settings EditorSettingsSerialization.Dump(); ScreenNotifications.Update(); if (!needClose) { EditorAPI.SelectedDocumentWindowChangedUpdate(); } if (!needClose) { foreach (var document in EditorAPI.Documents) { document.EditorUpdateWhenDocumentModified_Tick(); } } //if( !needClose ) // PreviewImagesManager.Update(); ////!!!!temp //CheckRestartApplicationToApplyChanged(); if (!needClose) { UpdateSoundSystem(); } //save editor settings if (!needClose) { KryptonAutoHiddenSlidePanel.Animate = ProjectSettings.Get.AnimateWindowsAutoHiding; } //if( !needClose ) // ScriptEditorEngine.Instance.UpdateSettings(); UpdateVisibilityOfFloatingWindows(); if (needClose) { needClose = false; Close(); } //open file at startup if (firstTick && !needClose) { var realFileName = EditorSettingsSerialization.OpenFileAtStartup; EditorSettingsSerialization.OpenFileAtStartup = ""; if (File.Exists(realFileName)) { //select new file in Resources window EditorAPI.SelectFilesOrDirectoriesInMainResourcesWindow(new string[] { realFileName }); //open file EditorAPI.OpenFileAsDocument(realFileName, true, true); } } if (firstTick) { firstTick = false; if (SplashForm.Instance != null) { SplashForm.Instance.AllowClose = true; } // hide cover show ribbon. kryptonRibbon.Visible = true; if (coverControl != null) { Controls.Remove(coverControl); } //coverControl.Visible = false; Invalidate(true); if (EditorSettingsSerialization.ShowTipsAsStartup) { EditorAPI.ShowTips(); } } if (unlockFormUpdateInTimer.HasValue && (DateTime.Now - unlockFormUpdateInTimer.Value).TotalSeconds > 0) { KryptonWinFormsUtility.LockFormUpdate(null); unlockFormUpdateInTimer = null; } if (!needClose) { EngineToolTipManager.Update(); } canSaveConfig = true; }
public void TryRender() { if (DrawSplashScreen) { return; } if (!IsAllowRender()) { ////!!!!new //DestroyRenderTarget(); return; } UpdateInput(); //!!!!в OnPaint рисовать? //create render window if (needCreateRenderWindow && allowCreateRenderWindow && !disableRecreationRenderWindow && EngineApp.Instance != null && EngineApp.Created) { if (CreateRenderTarget()) { needCreateRenderWindow = false; } } //!!!!где еще такое RendererWorld.ViewportsDuringUpdate.Contains(viewport) if (renderWindow != null && !RenderingSystem.ViewportsDuringUpdate.Contains(viewport)) { //!!!!? double time = EngineApp.GetSystemTime(); //double time = EngineApp.Instance.EngineTime; if (lastRenderTime == 0) { lastRenderTime = time; } double step = time - lastRenderTime; float invFPS = 0; if (automaticUpdateFPS != 0) { invFPS = 1.0f / automaticUpdateFPS; } if (automaticUpdateFPS == 0 || step >= invFPS) { lastRenderTime = time; OneFrameChangeCursor = viewport.MouseRelativeMode ? GetHidedCursor() : Cursors.Default; //OneFrameChangeCursor = Cursors.Default; //!!!!new. тут? EngineApp.DoTick(); //!!!!так ли. где еще if (!DrawSplashScreen) { viewport.PerformTick((float)step); } //!!!! ////tick and entity world tick //if( WinFormsAppEngineApp.Instance != null ) // WinFormsAppEngineApp.Instance.DoTick(); //!!!!!было //if( renderWindow.Size.X != 0 && renderWindow.Size.Y != 0 ) // camera.AspectRatio = (float)renderWindow.Size.X / (float)renderWindow.Size.Y; //if( renderWindow.Size.X != 0 && renderWindow.Size.Y != 0 ) // guiRenderer.AspectRatio = (float)renderWindow.Size.X / (float)renderWindow.Size.Y; //update //!!!!так? viewport.Update(true, OverrideCameraSettings); // false ); //!!!!возможно надо свапать только раз. делать цепь из всех существующих. //!!!!wait vsync? //viewport.Parent.SwapBuffers( false ); //!!!! //Log.Fatal( "viewport.Parent.SwapBuffers( true )" ); //viewport.Parent.SwapBuffers( true ); //renderWindow.Update( true ); //!!!!так? if (Cursor != OneFrameChangeCursor) { Cursor = OneFrameChangeCursor; } OneFrameChangeCursor = viewport.MouseRelativeMode ? GetHidedCursor() : Cursors.Default; //OneFrameChangeCursor = Cursors.Default; WinFormsUtility.InvalidateParentComposedStyleControl(this); } } }