mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-10-25 20:22:20 +00:00
Cache Tessellator#instance in local var (#321)
This commit is contained in:
1 parent
ae7af4e712
commit
1e66772abc
5 files changed
+43
-37
No files matched your search
@@ -344,7 +344,8 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
/* Draws the top part. */
|
||||
drawTexturedModalRect(offsetX, offsetY, 0, 0, xSize, HEADER_HEIGHT);
|
||||
/* Draws the middle part. */
|
||||
Tessellator.instance.startDrawingQuads();
|
||||
final Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
addTexturedRectToTesselator(
|
||||
offsetX,
|
||||
offsetY + HEADER_HEIGHT,
|
||||
@@ -355,7 +356,7 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
(HEADER_HEIGHT + LevelTerminalSection.TITLE_HEIGHT + 1.0f) / 256.0f,
|
||||
xSize / 256.0f,
|
||||
(HEADER_HEIGHT + 106.0f) / 256.0f);
|
||||
Tessellator.instance.draw();
|
||||
tess.draw();
|
||||
/* Draw the bottom part */
|
||||
drawTexturedModalRect(offsetX, offsetY + HEADER_HEIGHT + viewHeight, 0, 158, xSize, INV_HEIGHT);
|
||||
if (online) {
|
||||
@@ -483,7 +484,8 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
private int drawEntry(LevelTerminalEntry entry, int viewY, int titleBottom, int relMouseX, int relMouseY) {
|
||||
final EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
mc.getTextureManager().bindTexture(TEX_BG);
|
||||
Tessellator.instance.startDrawingQuads();
|
||||
final Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
int relY = 0;
|
||||
final int slotLeftMargin = (VIEW_WIDTH - entry.rowSize * 18);
|
||||
float lastZLevel = renderItem.zLevel;
|
||||
@@ -512,7 +514,7 @@ public class GuiLevelTerminal extends FCBaseMEGui implements IDropToFillTextFiel
|
||||
(173 + 18) / 256f);
|
||||
}
|
||||
}
|
||||
Tessellator.instance.draw();
|
||||
tess.draw();
|
||||
/* Draw button */
|
||||
if (viewY + entry.highlightButton.height > 0 && viewY < viewHeight) {
|
||||
entry.highlightButton.yPosition = viewY + 1;
|
||||
|
||||
@@ -316,9 +316,10 @@ public class PartFluidLevelEmitter extends PartUpgradeable implements IStackWatc
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderInventory(final IPartRenderHelper rh, final RenderBlocks renderer) {
|
||||
rh.setTexture(this.getItemStack().getIconIndex());
|
||||
Tessellator.instance.startDrawingQuads();
|
||||
final Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
this.renderTorchAtAngle(0, -0.5, 0);
|
||||
Tessellator.instance.draw();
|
||||
tess.draw();
|
||||
}
|
||||
|
||||
private void renderTorchAtAngle(double baseX, double baseY, double baseZ) {
|
||||
|
||||
@@ -366,21 +366,22 @@ public abstract class FCPart extends AEBasePart
|
||||
rh.setBounds(2, 2, 14, 14, 14, 16);
|
||||
rh.renderBlock(x, y, z, renderer);
|
||||
|
||||
final Tessellator tess = Tessellator.instance;
|
||||
if (this.getLightLevel() > 0) {
|
||||
final int l = 13;
|
||||
Tessellator.instance.setBrightness(l << 20 | l << 4);
|
||||
tess.setBrightness(l << 20 | l << 4);
|
||||
}
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = this
|
||||
.getSpin();
|
||||
|
||||
Tessellator.instance.setColorOpaque_I(this.getColor().whiteVariant);
|
||||
tess.setColorOpaque_I(this.getColor().whiteVariant);
|
||||
rh.renderFace(x, y, z, this.getFrontBright().getIcon(), ForgeDirection.SOUTH, renderer);
|
||||
|
||||
Tessellator.instance.setColorOpaque_I(this.getColor().mediumVariant);
|
||||
tess.setColorOpaque_I(this.getColor().mediumVariant);
|
||||
rh.renderFace(x, y, z, this.getFrontDark().getIcon(), ForgeDirection.SOUTH, renderer);
|
||||
|
||||
Tessellator.instance.setColorOpaque_I(this.getColor().blackVariant);
|
||||
tess.setColorOpaque_I(this.getColor().blackVariant);
|
||||
rh.renderFace(x, y, z, this.getFrontColored().getIcon(), ForgeDirection.SOUTH, renderer);
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
@@ -404,15 +405,15 @@ public abstract class FCPart extends AEBasePart
|
||||
|
||||
if (hasChan) {
|
||||
final int l = 14;
|
||||
Tessellator.instance.setBrightness(l << 20 | l << 4);
|
||||
Tessellator.instance.setColorOpaque_I(this.getColor().blackVariant);
|
||||
tess.setBrightness(l << 20 | l << 4);
|
||||
tess.setColorOpaque_I(this.getColor().blackVariant);
|
||||
} else if (hasPower) {
|
||||
final int l = 9;
|
||||
Tessellator.instance.setBrightness(l << 20 | l << 4);
|
||||
Tessellator.instance.setColorOpaque_I(this.getColor().whiteVariant);
|
||||
tess.setBrightness(l << 20 | l << 4);
|
||||
tess.setColorOpaque_I(this.getColor().whiteVariant);
|
||||
} else {
|
||||
Tessellator.instance.setBrightness(0);
|
||||
Tessellator.instance.setColorOpaque_I(0x000000);
|
||||
tess.setBrightness(0);
|
||||
tess.setColorOpaque_I(0x000000);
|
||||
}
|
||||
|
||||
final IIcon sideStatusLightTexture = CableBusTextures.PartMonitorSidesStatusLights.getIcon();
|
||||
|
||||
@@ -399,21 +399,22 @@ public abstract class FCPartMonitor extends AbstractPartDisplay implements IPart
|
||||
rh.setBounds(2, 2, 14, 14, 14, 16);
|
||||
rh.renderBlock(x, y, z, renderer);
|
||||
|
||||
final Tessellator tess = Tessellator.instance;
|
||||
if (this.getLightLevel() > 0) {
|
||||
final int l = 13;
|
||||
Tessellator.instance.setBrightness(l << 20 | l << 4);
|
||||
tess.setBrightness(l << 20 | l << 4);
|
||||
}
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = this
|
||||
.getSpin();
|
||||
|
||||
Tessellator.instance.setColorOpaque_I(this.getColor().whiteVariant);
|
||||
tess.setColorOpaque_I(this.getColor().whiteVariant);
|
||||
rh.renderFace(x, y, z, this.getFrontBright().getIcon(), ForgeDirection.SOUTH, renderer);
|
||||
|
||||
Tessellator.instance.setColorOpaque_I(this.getColor().mediumVariant);
|
||||
tess.setColorOpaque_I(this.getColor().mediumVariant);
|
||||
rh.renderFace(x, y, z, this.getFrontDark().getIcon(), ForgeDirection.SOUTH, renderer);
|
||||
|
||||
Tessellator.instance.setColorOpaque_I(this.getColor().blackVariant);
|
||||
tess.setColorOpaque_I(this.getColor().blackVariant);
|
||||
rh.renderFace(x, y, z, this.getFrontColored().getIcon(), ForgeDirection.SOUTH, renderer);
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
@@ -437,15 +438,15 @@ public abstract class FCPartMonitor extends AbstractPartDisplay implements IPart
|
||||
|
||||
if (hasChan) {
|
||||
final int l = 14;
|
||||
Tessellator.instance.setBrightness(l << 20 | l << 4);
|
||||
Tessellator.instance.setColorOpaque_I(this.getColor().blackVariant);
|
||||
tess.setBrightness(l << 20 | l << 4);
|
||||
tess.setColorOpaque_I(this.getColor().blackVariant);
|
||||
} else if (hasPower) {
|
||||
final int l = 9;
|
||||
Tessellator.instance.setBrightness(l << 20 | l << 4);
|
||||
Tessellator.instance.setColorOpaque_I(this.getColor().whiteVariant);
|
||||
tess.setBrightness(l << 20 | l << 4);
|
||||
tess.setColorOpaque_I(this.getColor().whiteVariant);
|
||||
} else {
|
||||
Tessellator.instance.setBrightness(0);
|
||||
Tessellator.instance.setColorOpaque_I(0x000000);
|
||||
tess.setBrightness(0);
|
||||
tess.setColorOpaque_I(0x000000);
|
||||
}
|
||||
|
||||
final IIcon sideStatusLightTexture = CableBusTextures.PartMonitorSidesStatusLights.getIcon();
|
||||
|
||||
@@ -27,20 +27,21 @@ public final class RenderUtil {
|
||||
if (icon == null) {
|
||||
return;
|
||||
}
|
||||
Tessellator.instance.startDrawingQuads();
|
||||
Tessellator.instance.setNormal(nx, ny, nz);
|
||||
final Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
tess.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());
|
||||
tess.addVertexWithUV(xStart, yStart, z, icon.getMinU(), icon.getMinV());
|
||||
tess.addVertexWithUV(xEnd, yStart, z, icon.getMaxU(), icon.getMinV());
|
||||
tess.addVertexWithUV(xEnd, yEnd, z, icon.getMaxU(), icon.getMaxV());
|
||||
tess.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());
|
||||
tess.addVertexWithUV(xStart, yEnd, z, icon.getMinU(), icon.getMaxV());
|
||||
tess.addVertexWithUV(xEnd, yEnd, z, icon.getMaxU(), icon.getMaxV());
|
||||
tess.addVertexWithUV(xEnd, yStart, z, icon.getMaxU(), icon.getMinV());
|
||||
tess.addVertexWithUV(xStart, yStart, z, icon.getMinU(), icon.getMinV());
|
||||
}
|
||||
Tessellator.instance.draw();
|
||||
tess.draw();
|
||||
}
|
||||
|
||||
public static void renderFluidIntoGui(Gui gui, int x, int y, int width, int height,
|
||||
|
||||
Reference in new issue
Block a user