aboutsummaryrefslogtreecommitdiff
path: root/main/java/gregtech/common/render/GT_RenderUtil.java
blob: 9a2fd8c259b8dfc9956589960d4b3abb8da15e62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package gregtech.common.render;

import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.IIcon;

public class GT_RenderUtil
{
  public static void renderItemIcon(IIcon icon, double size, double z, float nx, float ny, float nz)
  {
    renderItemIcon(icon, 0.0D, 0.0D, size, size, z, nx, ny, nz);
  }
  
  public static void renderItemIcon(IIcon icon, double xStart, double yStart, double xEnd, double yEnd, double z, float nx, float ny, float nz)
  {
    if (icon == null) {
      return;
    }
    Tessellator.instance.startDrawingQuads();
    Tessellator.instance.setNormal(nx, ny, nz);
    if (nz > 0.0F)
    {
      Tessellator.instance.addVertexWithUV(xStart, yStart, z, icon.getMinU(), icon.getMinV());
      Tessellator.instance.addVertexWithUV(xEnd, yStart, z, icon.getMaxU(), icon.getMinV());
      Tessellator.instance.addVertexWithUV(xEnd, yEnd, z, icon.getMaxU(), icon.getMaxV());
      Tessellator.instance.addVertexWithUV(xStart, yEnd, z, icon.getMinU(), icon.getMaxV());
    }
    else
    {
      Tessellator.instance.addVertexWithUV(xStart, yEnd, z, icon.getMinU(), icon.getMaxV());
      Tessellator.instance.addVertexWithUV(xEnd, yEnd, z, icon.getMaxU(), icon.getMaxV());
      Tessellator.instance.addVertexWithUV(xEnd, yStart, z, icon.getMaxU(), icon.getMinV());
      Tessellator.instance.addVertexWithUV(xStart, yStart, z, icon.getMinU(), icon.getMinV());
    }
    Tessellator.instance.draw();
  }
}



/* Location:           F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar

 * Qualified Name:     gregtech.common.render.GT_RenderUtil

 * JD-Core Version:    0.7.0.1

 */