public WarningLine(MySimpleProfiler.PerformanceWarning warning, MyGuiScreenPerformanceWarnings screen) { Parent = new MyGuiControlParent(); m_name = new MyGuiControlLabel(text: Truncate(warning.Block.DisplayName), position: new Vector2(-0.43f, 0), originAlign: VRage.Utils.MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, font: VRage.Game.MyFontEnum.Red); m_description = new MyGuiControlLabel ( text: String.IsNullOrEmpty(warning.Block.Description.String) ? MyTexts.GetString(MyCommonTexts.PerformanceWarningTooManyBlocks) : MyTexts.GetString(warning.Block.Description), position: new Vector2(-0.24f, 0), originAlign: VRage.Utils.MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER ); m_separator = new MyGuiControlSeparatorList(); Parent.Size = new Vector2(Parent.Size.X, m_description.Size.Y); m_separator.AddVertical(new Vector2(-0.25f, -Parent.Size.Y / 2 - 0.006f), Parent.Size.Y + 0.016f); m_separator.AddVertical(new Vector2(0.35f, -Parent.Size.Y / 2 - 0.006f), Parent.Size.Y + 0.016f); m_time = new MyGuiControlLabel(position: new Vector2(0.43f, 0), originAlign: VRage.Utils.MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_CENTER); switch (warning.Block.type) { case MySimpleProfiler.MySimpleProfilingBlock.ProfilingBlockType.GRAPHICS: screen.m_areaTitleGraphics.Warnings.Add(this); break; case MySimpleProfiler.MySimpleProfilingBlock.ProfilingBlockType.BLOCK: screen.m_areaTitleBlocks.Warnings.Add(this); break; case MySimpleProfiler.MySimpleProfilingBlock.ProfilingBlockType.OTHER: screen.m_areaTitleOther.Warnings.Add(this); break; } this.Warning = warning; }
private void Draw() { MySimpleProfiler.Begin("Render"); ProfilerShort.Begin("BeginScene"); MyRenderProxy.DrawBegin(); ProfilerShort.End(); ProfilerShort.Begin("Clear"); // TODO: OP! This should be done only to prevent weird things on screen, not every frame //MyRenderProxy.ClearBackbuffer(new ColorBGRA(0.0f)); MyRenderProxy.ClearLargeMessages(); ProfilerShort.End(); ProfilerShort.Begin("MyRenderProxy.Draw"); MyRenderProxy.Draw(); ProfilerShort.End(); MyRenderProxy.GetRenderProfiler().Draw(); ProfilerShort.Begin("EndScene"); MyRenderProxy.DrawEnd(); ProfilerShort.End(); MySimpleProfiler.End("Render"); }
/// <summary> /// Send performance warnings to clients /// </summary> void PerformanceWarning(MySimpleProfiler.MySimpleProfilingBlock block) { MyMultiplayer.RaiseStaticEvent(s => OnServerPerformanceWarning, (block.Name)); }