mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 05:02:34 +00:00
Use GlStateManager
This commit is contained in:
1 parent
31a305ffc2
commit
9c4b081f6d
24 files changed
+144
-152
No files matched your search
@@ -20,19 +20,19 @@ public class ItemMetadataRenderer //implements IItemRenderer
|
||||
//
|
||||
// @Override
|
||||
// public void renderItem(final IItemRenderer.ItemRenderType type, final ItemStack item, final Object... data) {
|
||||
// GL11.glPushMatrix();
|
||||
// GlStateManager.pushMatrix();
|
||||
// final Block block = Block.getBlockFromItem(item.getItem());
|
||||
// if (type == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON) {
|
||||
// GL11.glTranslated(0.5, 0.5, 0.5);
|
||||
// GlStateManager.translate(0.5, 0.5, 0.5);
|
||||
// }
|
||||
// if (type == IItemRenderer.ItemRenderType.INVENTORY && block.getRenderBlockPass() != 0) {
|
||||
// GL11.glAlphaFunc(516, 0.1f);
|
||||
// GL11.glEnable(3042);
|
||||
// GlStateManager.enableBlend();
|
||||
// OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
// }
|
||||
// GL11.glPushMatrix();
|
||||
// GlStateManager.pushMatrix();
|
||||
// ((RenderBlocks) data[0]).renderBlockAsItem(block, TileEntityMetadata.getItemDamage(item), 1.0f);
|
||||
// GL11.glPopMatrix();
|
||||
// GL11.glPopMatrix();
|
||||
// GlStateManager.popMatrix();
|
||||
// GlStateManager.popMatrix();
|
||||
// }
|
||||
}
|
||||
@@ -2,9 +2,9 @@ package binnie.core.machines;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class MachineRendererBlock {
|
||||
@@ -16,16 +16,16 @@ public class MachineRendererBlock {
|
||||
this.model = new ModelBlock();
|
||||
}
|
||||
|
||||
public void renderMachine(final BinnieResource texture, final double x, final double y, final double z, final float var8) {
|
||||
public void renderMachine(final BinnieResource texture, final double x, final double y, final double z, final float partialTicks) {
|
||||
this.texture = texture;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
|
||||
GL11.glRotatef(180.0f, 0.0f, 0.0f, 1.0f);
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(x + 0.5, y + 1.5, z + 0.5);
|
||||
GlStateManager.rotate(180.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
BinnieCore.proxy.bindTexture(texture);
|
||||
GL11.glPushMatrix();
|
||||
this.model.render((float) x, (float) y, (float) z, 0.0625f, 0.0625f, 0.0625f);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,9 +3,9 @@ package binnie.core.machines.storage;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
class MachineRendererCompartment {
|
||||
@@ -17,7 +17,7 @@ class MachineRendererCompartment {
|
||||
}
|
||||
|
||||
public void renderMachine(final Machine machine, final int colour, final BinnieResource texture, final double x, final double y, final double z, final float var8) {
|
||||
GL11.glPushMatrix();
|
||||
GlStateManager.pushMatrix();
|
||||
int i1 = 0;
|
||||
final int ix = machine.getTileEntity().getPos().getX();
|
||||
final int iy = machine.getTileEntity().getPos().getY();
|
||||
@@ -26,13 +26,13 @@ class MachineRendererCompartment {
|
||||
i1 = ix * iy * iz + ix * iy - ix * iz + iy * iz - ix + iy - iz;
|
||||
}
|
||||
final float phase = (float) Math.max(0.0, Math.sin((System.currentTimeMillis() + i1) * 0.003));
|
||||
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
|
||||
GL11.glRotatef(180.0f, 0.0f, 0.0f, 1.0f);
|
||||
GlStateManager.translate(x + 0.5, y + 1.5, z + 0.5);
|
||||
GlStateManager.rotate(180.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
BinnieCore.proxy.bindTexture(texture);
|
||||
GL11.glPushMatrix();
|
||||
this.model.render(null, (float) x, (float) y, (float) z, 0.0625f, 0.0625f, 0.0625f);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,7 +23,6 @@ import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
@@ -80,7 +79,6 @@ public final class BinnieProxyClient extends BinnieProxy implements IBinnieProxy
|
||||
|
||||
@Override
|
||||
public void bindTexture(final BinnieResource texture) {
|
||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
this.bindTexture(texture.getResourceLocation());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user