add render_widgets to perf history
This commit is contained in:
@@ -147,6 +147,7 @@ namespace OpenRA
|
||||
|
||||
PerfHistory.items["render"].Tick();
|
||||
PerfHistory.items["batches"].Tick();
|
||||
PerfHistory.items["render_widgets"].Tick();
|
||||
|
||||
afterTickActions.PerformActions();
|
||||
}
|
||||
@@ -301,6 +302,7 @@ namespace OpenRA
|
||||
|
||||
PerfHistory.items["render"].hasNormalTick = false;
|
||||
PerfHistory.items["batches"].hasNormalTick = false;
|
||||
PerfHistory.items["render_widgets"].hasNormalTick = false;
|
||||
|
||||
JoinLocal();
|
||||
viewport = new Viewport(new int2(Renderer.Resolution), Rectangle.Empty, Renderer);
|
||||
|
||||
@@ -12,6 +12,7 @@ using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.Widgets;
|
||||
using OpenRA.Support;
|
||||
|
||||
namespace OpenRA.Graphics
|
||||
{
|
||||
@@ -34,7 +35,7 @@ namespace OpenRA.Graphics
|
||||
|
||||
public void Scroll(float2 delta)
|
||||
{
|
||||
this.Scroll(delta, false);
|
||||
Scroll(delta, false);
|
||||
}
|
||||
|
||||
public void Scroll(float2 delta, bool ignoreBorders)
|
||||
@@ -85,6 +86,8 @@ namespace OpenRA.Graphics
|
||||
if (wr != null)
|
||||
wr.Draw();
|
||||
|
||||
using( new PerfSample("render_widgets") )
|
||||
{
|
||||
Widget.DoDraw();
|
||||
var cursorName = Widget.RootWidget.GetCursorOuter(Viewport.LastMousePos) ?? "default";
|
||||
var cursorSequence = CursorProvider.GetCursorSequence(cursorName);
|
||||
@@ -92,6 +95,7 @@ namespace OpenRA.Graphics
|
||||
cursorSequence.GetSprite((int)cursorFrame).DrawAt(
|
||||
Viewport.LastMousePos + Location - cursorSequence.Hotspot,
|
||||
Game.modData.Palette.GetPaletteIndex(cursorSequence.Palette));
|
||||
}
|
||||
|
||||
renderer.EndFrame( inputHandler );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user