}
private void displayDebugInfo(long par1)
{
java.util.List list = Profiler.getProfilingData(debugProfilerName);
ProfilerResult profilerresult = (ProfilerResult)list.remove(0);
long l = 0xfe502aL;
if (prevFrameTime == -1L)
{
prevFrameTime = System.nanoTime();
}
long l1 = System.nanoTime();
tickTimes[numRecordedFrameTimes & frameTimes.length - 1] = par1;
frameTimes[numRecordedFrameTimes++ & frameTimes.length - 1] = l1 - prevFrameTime;
prevFrameTime = l1;
GL11.glClear(256);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
GL11.glLoadIdentity();
GL11.glOrtho(0.0D, displayWidth, displayHeight, 0.0D, 1000D, 3000D);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
GL11.glTranslatef(0.0F, 0.0F, -2000F);
GL11.glLineWidth(1.0F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawing(7);
int i = (int)(l / 0x30d40L);
tessellator.setColorOpaque_I(0x20000000);
tessellator.addVertex(0.0D, displayHeight - i, 0.0D);
tessellator.addVertex(0.0D, displayHeight, 0.0D);
tessellator.addVertex(frameTimes.length, displayHeight, 0.0D);
tessellator.addVertex(frameTimes.length, displayHeight - i, 0.0D);
tessellator.setColorOpaque_I(0x20200000);
tessellator.addVertex(0.0D, displayHeight - i * 2, 0.0D);
tessellator.addVertex(0.0D, displayHeight - i, 0.0D);
tessellator.addVertex(frameTimes.length, displayHeight - i, 0.0D);
tessellator.addVertex(frameTimes.length, displayHeight - i * 2, 0.0D);
tessellator.draw();
long l2 = 0L;
for (int j = 0; j < frameTimes.length; j++)
{
l2 += frameTimes[j];
}
int k = (int)(l2 / 0x30d40L / (long)frameTimes.length);
tessellator.startDrawing(7);
tessellator.setColorOpaque_I(0x20400000);
tessellator.addVertex(0.0D, displayHeight - k, 0.0D);
tessellator.addVertex(0.0D, displayHeight, 0.0D);
tessellator.addVertex(frameTimes.length, displayHeight, 0.0D);
tessellator.addVertex(frameTimes.length, displayHeight - k, 0.0D);
tessellator.draw();
tessellator.startDrawing(1);
for (int i1 = 0; i1 < frameTimes.length; i1++)
{
int k1 = ((i1 - numRecordedFrameTimes & frameTimes.length - 1) * 255) / frameTimes.length;
int j2 = (k1 * k1) / 255;
j2 = (j2 * j2) / 255;
int i3 = (j2 * j2) / 255;
i3 = (i3 * i3) / 255;
if (frameTimes[i1] > l)
{
tessellator.setColorOpaque_I(0xff000000 + j2 * 0x10000);
}
else
{
tessellator.setColorOpaque_I(0xff000000 + j2 * 256);
}
long l3 = frameTimes[i1] / 0x30d40L;
long l4 = tickTimes[i1] / 0x30d40L;
tessellator.addVertex((float)i1 + 0.5F, (float)((long)displayHeight - l3) + 0.5F, 0.0D);
tessellator.addVertex((float)i1 + 0.5F, (float)displayHeight + 0.5F, 0.0D);
tessellator.setColorOpaque_I(0xff000000 + j2 * 0x10000 + j2 * 256 + j2 * 1);
tessellator.addVertex((float)i1 + 0.5F, (float)((long)displayHeight - l3) + 0.5F, 0.0D);
tessellator.addVertex((float)i1 + 0.5F, (float)((long)displayHeight - (l3 - l4)) + 0.5F, 0.0D);
}
tessellator.draw();
int j1 = 160;
int i2 = displayWidth - j1 - 10;
int k2 = displayHeight - j1 * 2;
GL11.glEnable(GL11.GL_BLEND);
tessellator.startDrawingQuads();
tessellator.setColorRGBA_I(0, 200);
tessellator.addVertex((float)i2 - (float)j1 * 1.1F, (float)k2 - (float)j1 * 0.6F - 16F, 0.0D);
tessellator.addVertex((float)i2 - (float)j1 * 1.1F, k2 + j1 * 2, 0.0D);
tessellator.addVertex((float)i2 + (float)j1 * 1.1F, k2 + j1 * 2, 0.0D);
tessellator.addVertex((float)i2 + (float)j1 * 1.1F, (float)k2 - (float)j1 * 0.6F - 16F, 0.0D);
tessellator.draw();
GL11.glDisable(GL11.GL_BLEND);
double d = 0.0D;
for (int j3 = 0; j3 < list.size(); j3++)
{
ProfilerResult profilerresult1 = (ProfilerResult)list.get(j3);
int i4 = MathHelper.floor_double(profilerresult1.sectionPercentage / 4D) + 1;
tessellator.startDrawing(6);
tessellator.setColorOpaque_I(profilerresult1.getDisplayColor());
tessellator.addVertex(i2, k2, 0.0D);
for (int k4 = i4; k4 >= 0; k4--)
{
float f = (float)(((d + (profilerresult1.sectionPercentage * (double)k4) / (double)i4) * Math.PI * 2D) / 100D);
float f2 = MathHelper.sin(f) * (float)j1;
float f4 = MathHelper.cos(f) * (float)j1 * 0.5F;
tessellator.addVertex((float)i2 + f2, (float)k2 - f4, 0.0D);
}
tessellator.draw();
tessellator.startDrawing(5);
tessellator.setColorOpaque_I((profilerresult1.getDisplayColor() & 0xfefefe) >> 1);
for (int i5 = i4; i5 >= 0; i5--)
{
float f1 = (float)(((d + (profilerresult1.sectionPercentage * (double)i5) / (double)i4) * Math.PI * 2D) / 100D);
float f3 = MathHelper.sin(f1) * (float)j1;
float f5 = MathHelper.cos(f1) * (float)j1 * 0.5F;
tessellator.addVertex((float)i2 + f3, (float)k2 - f5, 0.0D);
tessellator.addVertex((float)i2 + f3, ((float)k2 - f5) + 10F, 0.0D);
}
tessellator.draw();
d += profilerresult1.sectionPercentage;
}
DecimalFormat decimalformat = new DecimalFormat("##0.00");
GL11.glEnable(GL11.GL_TEXTURE_2D);
String s = "";
if (!profilerresult.name.equals("unspecified"))
{
s = (new StringBuilder()).append(s).append("[0] ").toString();
}
if (profilerresult.name.length() == 0)
{
s = (new StringBuilder()).append(s).append("ROOT ").toString();
}
else
{
s = (new StringBuilder()).append(s).append(profilerresult.name).append(" ").toString();
}
int j4 = 0xffffff;
fontRenderer.drawStringWithShadow(s, i2 - j1, k2 - j1 / 2 - 16, j4);
fontRenderer.drawStringWithShadow(s = (new StringBuilder()).append(decimalformat.format(profilerresult.globalPercentage)).append("%").toString(), (i2 + j1) - fontRenderer.getStringWidth(s), k2 - j1 / 2 - 16, j4);
for (int k3 = 0; k3 < list.size(); k3++)
{
ProfilerResult profilerresult2 = (ProfilerResult)list.get(k3);
String s1 = "";
if (!profilerresult2.name.equals("unspecified"))
{
s1 = (new StringBuilder()).append(s1).append("[").append(k3 + 1).append("] ").toString();
}
else
{
s1 = (new StringBuilder()).append(s1).append("[?] ").toString();
}
s1 = (new StringBuilder()).append(s1).append(profilerresult2.name).toString();
fontRenderer.drawStringWithShadow(s1, i2 - j1, k2 + j1 / 2 + k3 * 8 + 20, profilerresult2.getDisplayColor());
fontRenderer.drawStringWithShadow(s1 = (new StringBuilder()).append(decimalformat.format(profilerresult2.sectionPercentage)).append("%").toString(), (i2 + j1) - 50 - fontRenderer.getStringWidth(s1), k2 + j1 / 2 + k3 * 8 + 20, profilerresult2.getDisplayColor());
fontRenderer.drawStringWithShadow(s1 = (new StringBuilder()).append(decimalformat.format(profilerresult2.globalPercentage)).append("%").toString(), (i2 + j1) - fontRenderer.getStringWidth(s1), k2 + j1 / 2 + k3 * 8 + 20, profilerresult2.getDisplayColor());
}
}