add render_flip to perf history

This commit is contained in:
Chris Forbes
2011-05-05 19:28:53 +12:00
parent fe392bd42d
commit f406504147
2 changed files with 8 additions and 2 deletions

View File

@@ -148,6 +148,7 @@ namespace OpenRA
PerfHistory.items["render"].Tick();
PerfHistory.items["batches"].Tick();
PerfHistory.items["render_widgets"].Tick();
PerfHistory.items["render_flip"].Tick();
afterTickActions.PerformActions();
}
@@ -303,6 +304,7 @@ namespace OpenRA
PerfHistory.items["render"].hasNormalTick = false;
PerfHistory.items["batches"].hasNormalTick = false;
PerfHistory.items["render_widgets"].hasNormalTick = false;
PerfHistory.items["render_flip"].hasNormalTick = false;
JoinLocal();
viewport = new Viewport(new int2(Renderer.Resolution), Rectangle.Empty, Renderer);

View File

@@ -49,7 +49,7 @@ namespace OpenRA.Graphics
scrollPosition = newScrollPosition;
}
private int2 NormalizeScrollPosition(int2 newScrollPosition)
int2 NormalizeScrollPosition(int2 newScrollPosition)
{
return newScrollPosition.Clamp(adjustedMapBounds);
}
@@ -97,8 +97,11 @@ namespace OpenRA.Graphics
Game.modData.Palette.GetPaletteIndex(cursorSequence.Palette));
}
using( new PerfSample("render_flip") )
{
renderer.EndFrame( inputHandler );
}
}
public void Tick()
{
@@ -109,6 +112,7 @@ namespace OpenRA.Graphics
{
return (1f / Game.CellSize) * (loc.ToFloat2() + Location);
}
public float2 ViewToWorld(MouseInput mi)
{
return ViewToWorld(mi.Location);