From f652ccc0bfc1f5b0ca31798af36f241b5b90dc67 Mon Sep 17 00:00:00 2001 From: ganymedes01 Date: Wed, 17 Dec 2014 17:41:02 -0200 Subject: [PATCH] Tweaks to chute rendering + laser block rendering clean up (no noticeable changes) --- .../factory/render/RenderHopper.java | 9 ++--- .../silicon/SiliconRenderBlock.java | 37 ++++++------------- .../silicon/render/RenderLaserBlock.java | 17 ++------- 3 files changed, 20 insertions(+), 43 deletions(-) diff --git a/common/buildcraft/factory/render/RenderHopper.java b/common/buildcraft/factory/render/RenderHopper.java index d7497b2e..fa5fe286 100644 --- a/common/buildcraft/factory/render/RenderHopper.java +++ b/common/buildcraft/factory/render/RenderHopper.java @@ -8,8 +8,6 @@ */ package buildcraft.factory.render; -import org.lwjgl.opengl.GL11; - import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.Tessellator; @@ -18,6 +16,8 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + import buildcraft.BuildCraftCore; import buildcraft.BuildCraftCore.RenderMode; import buildcraft.core.DefaultProps; @@ -64,16 +64,15 @@ public class RenderHopper extends TileEntitySpecialRenderer implements IInventor } GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glTranslated(x, y, z); bindTexture(HOPPER_TEXTURE); top.render((float) (1.0 / 16.0)); bottom.render((float) (1.0 / 16.0)); bindTexture(HOPPER_MIDDLE_TEXTURE); + GL11.glTranslated(0.005, 0, 0.005); + GL11.glScaled(0.99, 1, 0.99); middle.render(Tessellator.instance, 1F / 16F); - GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); } } diff --git a/common/buildcraft/silicon/SiliconRenderBlock.java b/common/buildcraft/silicon/SiliconRenderBlock.java index 682bc154..dbcb71e6 100644 --- a/common/buildcraft/silicon/SiliconRenderBlock.java +++ b/common/buildcraft/silicon/SiliconRenderBlock.java @@ -43,12 +43,10 @@ public class SiliconRenderBlock implements ISimpleBlockRenderingHandler { renderblocks.uvRotateTop = 1; renderblocks.uvRotateBottom = 2; - block.setBlockBounds(0.0F, 0.0F, 0.0F, 4F / 16F, 1, 1); - renderblocks.setRenderBoundsFromBlock(block); + renderblocks.setRenderBounds(0.0F, 0.0F, 0.0F, 4F / 16F, 1, 1); renderblocks.renderStandardBlock(block, x, y, z); - block.setBlockBounds(4F / 16F, 5F / 16F, 5F / 16F, 13F / 16F, 11F / 16F, 11F / 16F); - renderblocks.setRenderBoundsFromBlock(block); + renderblocks.setRenderBounds(4F / 16F, 5F / 16F, 5F / 16F, 13F / 16F, 11F / 16F, 11F / 16F); renderblocks.renderStandardBlock(block, x, y, z); } else if (meta == ForgeDirection.WEST.ordinal()) { renderblocks.uvRotateEast = 1; @@ -56,23 +54,19 @@ public class SiliconRenderBlock implements ISimpleBlockRenderingHandler { renderblocks.uvRotateTop = 2; renderblocks.uvRotateBottom = 1; - block.setBlockBounds(1F - 4F / 16F, 0.0F, 0.0F, 1, 1, 1); - renderblocks.setRenderBoundsFromBlock(block); + renderblocks.setRenderBounds(1F - 4F / 16F, 0.0F, 0.0F, 1, 1, 1); renderblocks.renderStandardBlock(block, x, y, z); - block.setBlockBounds(1F - 13F / 16F, 5F / 16F, 5F / 16F, 1F - 4F / 16F, 11F / 16F, 11F / 16F); - renderblocks.setRenderBoundsFromBlock(block); + renderblocks.setRenderBounds(1F - 13F / 16F, 5F / 16F, 5F / 16F, 1F - 4F / 16F, 11F / 16F, 11F / 16F); renderblocks.renderStandardBlock(block, x, y, z); } else if (meta == ForgeDirection.NORTH.ordinal()) { renderblocks.uvRotateSouth = 1; renderblocks.uvRotateNorth = 2; - block.setBlockBounds(0.0F, 0.0F, 1F - 4F / 16F, 1, 1, 1); - renderblocks.setRenderBoundsFromBlock(block); + renderblocks.setRenderBounds(0.0F, 0.0F, 1F - 4F / 16F, 1, 1, 1); renderblocks.renderStandardBlock(block, x, y, z); - block.setBlockBounds(5F / 16F, 5F / 16F, 1F - 13F / 16F, 11F / 16F, 11F / 16F, 1F - 4F / 16F); - renderblocks.setRenderBoundsFromBlock(block); + renderblocks.setRenderBounds(5F / 16F, 5F / 16F, 1F - 13F / 16F, 11F / 16F, 11F / 16F, 1F - 4F / 16F); renderblocks.renderStandardBlock(block, x, y, z); } else if (meta == ForgeDirection.SOUTH.ordinal()) { renderblocks.uvRotateSouth = 2; @@ -80,12 +74,10 @@ public class SiliconRenderBlock implements ISimpleBlockRenderingHandler { renderblocks.uvRotateTop = 3; renderblocks.uvRotateBottom = 3; - block.setBlockBounds(0.0F, 0.0F, 0.0F, 1, 1, 4F / 16F); - renderblocks.setRenderBoundsFromBlock(block); + renderblocks.setRenderBounds(0.0F, 0.0F, 0.0F, 1, 1, 4F / 16F); renderblocks.renderStandardBlock(block, x, y, z); - block.setBlockBounds(5F / 16F, 5F / 16F, 4F / 16F, 11F / 16F, 11F / 16F, 13F / 16F); - renderblocks.setRenderBoundsFromBlock(block); + renderblocks.setRenderBounds(5F / 16F, 5F / 16F, 4F / 16F, 11F / 16F, 11F / 16F, 13F / 16F); renderblocks.renderStandardBlock(block, x, y, z); } else if (meta == ForgeDirection.DOWN.ordinal()) { renderblocks.uvRotateEast = 3; @@ -93,24 +85,19 @@ public class SiliconRenderBlock implements ISimpleBlockRenderingHandler { renderblocks.uvRotateSouth = 3; renderblocks.uvRotateNorth = 3; - block.setBlockBounds(0.0F, 1.0F - 4F / 16F, 0.0F, 1.0F, 1.0F, 1.0F); - renderblocks.setRenderBoundsFromBlock(block); + renderblocks.setRenderBounds(0.0F, 1.0F - 4F / 16F, 0.0F, 1.0F, 1.0F, 1.0F); renderblocks.renderStandardBlock(block, x, y, z); - block.setBlockBounds(5F / 16F, 1F - 13F / 16F, 5F / 16F, 11F / 16F, 1F - 4F / 16F, 11F / 16F); - renderblocks.setRenderBoundsFromBlock(block); + renderblocks.setRenderBounds(5F / 16F, 1F - 13F / 16F, 5F / 16F, 11F / 16F, 1F - 4F / 16F, 11F / 16F); renderblocks.renderStandardBlock(block, x, y, z); } else if (meta == ForgeDirection.UP.ordinal()) { - block.setBlockBounds(0.0F, 0.0F, 0.0F, 1, 4F / 16F, 1); - renderblocks.setRenderBoundsFromBlock(block); + renderblocks.setRenderBounds(0.0F, 0.0F, 0.0F, 1, 0.25, 1); renderblocks.renderStandardBlock(block, x, y, z); - block.setBlockBounds(5F / 16F, 4F / 16F, 5F / 16F, 11F / 16F, 13F / 16F, 11F / 16F); - renderblocks.setRenderBoundsFromBlock(block); + renderblocks.setRenderBounds(5F / 16F, 4F / 16F, 5F / 16F, 11F / 16F, 13F / 16F, 11F / 16F); renderblocks.renderStandardBlock(block, x, y, z); } - block.setBlockBounds(0.0F, 0.0F, 0.0F, 1, 1, 1); renderblocks.uvRotateEast = 0; renderblocks.uvRotateWest = 0; renderblocks.uvRotateSouth = 0; diff --git a/common/buildcraft/silicon/render/RenderLaserBlock.java b/common/buildcraft/silicon/render/RenderLaserBlock.java index d9499c4b..96301cd6 100755 --- a/common/buildcraft/silicon/render/RenderLaserBlock.java +++ b/common/buildcraft/silicon/render/RenderLaserBlock.java @@ -8,12 +8,12 @@ */ package buildcraft.silicon.render; -import org.lwjgl.opengl.GL11; - import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; + import buildcraft.core.render.RenderLaser; import buildcraft.silicon.TileLaser; @@ -25,22 +25,13 @@ public class RenderLaserBlock extends TileEntitySpecialRenderer { if (laser != null) { GL11.glPushMatrix(); - GL11.glPushAttrib(GL11.GL_ENABLE_BIT); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glTranslated(x, y, z); GL11.glTranslated(-tileentity.xCoord, -tileentity.yCoord, -tileentity.zCoord); GL11.glPushMatrix(); - RenderLaser.doRenderLaser(TileEntityRendererDispatcher.instance.field_147553_e, - laser.laser, laser.getTexture()); + RenderLaser.doRenderLaser(TileEntityRendererDispatcher.instance.field_147553_e, laser.laser, laser.getTexture()); GL11.glPopMatrix(); - - //GL11.glEnable(GL11.GL_LIGHTING); - GL11.glPopAttrib(); + GL11.glPopMatrix(); } }