remove plenty of redundant junk
This commit is contained in:
@@ -17,8 +17,8 @@
|
||||
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#endregion
|
||||
using System.Drawing;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.Support;
|
||||
|
||||
@@ -26,36 +26,32 @@ namespace OpenRA.Widgets
|
||||
{
|
||||
class PerfGraphWidget : Widget
|
||||
{
|
||||
public PerfGraphWidget() : base() { }
|
||||
|
||||
public PerfGraphWidget(Widget other) : base(other) { }
|
||||
|
||||
public override Widget Clone() { return new PerfGraphWidget(this); }
|
||||
|
||||
public override void DrawInner(World world)
|
||||
{
|
||||
var rect = RenderBounds;
|
||||
float2 origin = Game.viewport.Location + new float2(rect.Right,rect.Bottom);
|
||||
float2 basis = new float2(-rect.Width/100,-rect.Height/100);
|
||||
|
||||
Game.chrome.lineRenderer.DrawLine(origin, origin + new float2(100, 0) * basis, Color.White, Color.White);
|
||||
Game.chrome.lineRenderer.DrawLine(origin + new float2(100,0) * basis, origin + new float2(100,100) * basis, Color.White, Color.White);
|
||||
|
||||
foreach (var item in PerfHistory.items.Values)
|
||||
{
|
||||
int n = 0;
|
||||
item.Samples().Aggregate((a, b) =>
|
||||
{
|
||||
Game.chrome.lineRenderer.DrawLine(
|
||||
origin + new float2(n, (float)a) * basis,
|
||||
origin + new float2(n+1, (float)b) * basis,
|
||||
item.c, item.c);
|
||||
++n;
|
||||
return b;
|
||||
});
|
||||
}
|
||||
|
||||
Game.chrome.lineRenderer.Flush();
|
||||
public PerfGraphWidget() : base() { }
|
||||
|
||||
public override void DrawInner(World world)
|
||||
{
|
||||
var rect = RenderBounds;
|
||||
float2 origin = Game.viewport.Location + new float2(rect.Right, rect.Bottom);
|
||||
float2 basis = new float2(-rect.Width / 100, -rect.Height / 100);
|
||||
|
||||
Game.chrome.lineRenderer.DrawLine(origin, origin + new float2(100, 0) * basis, Color.White, Color.White);
|
||||
Game.chrome.lineRenderer.DrawLine(origin + new float2(100, 0) * basis, origin + new float2(100, 100) * basis, Color.White, Color.White);
|
||||
|
||||
foreach (var item in PerfHistory.items.Values)
|
||||
{
|
||||
int n = 0;
|
||||
item.Samples().Aggregate((a, b) =>
|
||||
{
|
||||
Game.chrome.lineRenderer.DrawLine(
|
||||
origin + new float2(n, (float)a) * basis,
|
||||
origin + new float2(n + 1, (float)b) * basis,
|
||||
item.c, item.c);
|
||||
++n;
|
||||
return b;
|
||||
});
|
||||
}
|
||||
|
||||
Game.chrome.lineRenderer.Flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user