OpenGL constants

This commit is contained in:
Sen 2025-03-19 23:31:33 +01:00
parent e2f2417695
commit abc2f6ab50
31 changed files with 179 additions and 362 deletions

View file

@ -470,16 +470,16 @@ public class Game implements IThreadListener {
Colorizer.reload();
GlState.enableTexture2D();
GlState.shadeModel(GL11.GL_SMOOTH);
GlState.clearDepth(1.0D);
GL11.glClearDepth(1.0D);
GlState.enableDepth();
GlState.depthFunc(515);
GlState.depthFunc(GL11.GL_LEQUAL);
GlState.enableAlpha();
GlState.alphaFunc(516, 0.1F);
GlState.cullFace(1029);
GlState.alphaFunc(GL11.GL_GREATER, 0.1F);
GlState.cullFace(GL11.GL_BACK);
GlState.enableCull();
GL11.glMatrixMode(5889);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
this.textureMap = new TextureMap();
this.textureManager.loadTexture(TextureMap.locationBlocksTexture, this.textureMap);
this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
@ -892,7 +892,7 @@ public class Game implements IThreadListener {
GlState.enableRescaleNormal();
GlState.enableBlend();
GlState.color(1.0F, 1.0F, 1.0F, 1.0F);
// GlState.tryBlendFuncSeparate(770, 771, 1, 0);
// GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
ItemRenderer.enableGUIStandardItemLighting();
// this.getTextureManager().bindTexture("textures/gui/inventory.png");
GL11.glPushMatrix();
@ -1993,10 +1993,10 @@ public class Game implements IThreadListener {
GlState.setActiveTexture(GL13.GL_TEXTURE0);
GlState.color(1.0f, 1.0f, 1.0f, 1.0f);
GL11.glClear(256);
GL11.glMatrixMode(5889);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0.0D, (double)this.fb_x, (double)this.fb_y, 0.0D, 1000.0D, 3000.0D);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
GL11.glTranslatef(0.0F, 0.0F, -2000.0F);
}
@ -2989,7 +2989,7 @@ public class Game implements IThreadListener {
private void renderWorldDirections(float partialTicks) {
GlState.enableBlend();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GL11.glLineWidth(1.0F);
GlState.disableTexture2D();
GlState.depthMask(false);

View file

@ -242,7 +242,7 @@ public abstract class Gui {
// RenderBuffer worldrenderer = Tessellator.getBuffer();
// GlState.enableBlend();
// GlState.disableTexture2D();
// GlState.tryBlendFuncSeparate(770, 771, 1, 0);
// GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
// GlState.color(f, f1, f2, f3);
// worldrenderer.begin(7, DefaultVertexFormats.POSITION);
// worldrenderer.pos((double)left, (double)bottom, 0.0D).endVertex();
@ -293,7 +293,7 @@ public abstract class Gui {
// GlState.disableTexture2D();
// GlState.enableBlend();
// GlState.disableAlpha();
// GlState.tryBlendFuncSeparate(770, 771, 1, 0);
// GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
// GlState.shadeModel(GL11.GL_SMOOTH);
// RenderBuffer worldrenderer = Tessellator.getBuffer();
// worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);

View file

@ -185,7 +185,7 @@ public abstract class GuiList<T extends ListEntry> extends Gui
this.overlayBackground(this.bottom, this.height, 255, 255);
GlState.enableBlend();
GlState.tryBlendFuncSeparate(770, 771, 0, 1);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ZERO, GL11.GL_ONE);
GlState.disableAlpha();
GlState.shadeModel(GL11.GL_SMOOTH);
GlState.disableTexture2D();

View file

@ -46,7 +46,7 @@ public abstract class Drawing {
GlState.enableTexture2D();
GlState.enableBlend();
GlState.disableAlpha();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GlState.shadeModel(GL11.GL_SMOOTH);
GlState.color(1.0f, 1.0f, 1.0f, 1.0f);
Font.bindTexture();
@ -305,7 +305,7 @@ public abstract class Drawing {
GlState.enableTexture2D();
GlState.enableBlend();
GlState.disableAlpha();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GlState.shadeModel(GL11.GL_SMOOTH);
GlState.color(1.0f, 1.0f, 1.0f, 1.0f);
Font.bindTexture();
@ -416,7 +416,7 @@ public abstract class Drawing {
GlState.disableTexture2D();
GlState.enableBlend();
GlState.disableAlpha();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GlState.shadeModel(GL11.GL_SMOOTH);
RenderBuffer buf = Tessellator.getBuffer();
buf.begin(7, DefaultVertexFormats.POSITION_COLOR);
@ -436,7 +436,7 @@ public abstract class Drawing {
GlState.disableTexture2D();
GlState.enableBlend();
GlState.disableAlpha();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GlState.shadeModel(GL11.GL_SMOOTH);
RenderBuffer buf = Tessellator.getBuffer();
buf.begin(7, DefaultVertexFormats.POSITION_COLOR);
@ -457,7 +457,7 @@ public abstract class Drawing {
GlState.enableBlend();
GlState.disableAlpha();
GlState.disableTexture2D();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GlState.shadeModel(GL11.GL_SMOOTH);
GlState.color(color);
rb.begin(7, DefaultVertexFormats.POSITION);

View file

@ -574,7 +574,7 @@ public class EntityRenderer {
private void setupCameraTransform(float partialTicks)
{
this.farPlaneDistance = (float)(this.gm.renderDistance * 16);
GL11.glMatrixMode(5889);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
float f = 0.07F;
@ -590,7 +590,7 @@ public class EntityRenderer {
// }
Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.gm.fb_x / (float)this.gm.fb_y, 0.05F, this.farPlaneDistance * SQRT_2);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
// if (this.gm.anaglyph)
@ -658,7 +658,7 @@ public class EntityRenderer {
{
// if (!this.debugView)
// {
GL11.glMatrixMode(5889);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
float f = 0.07F;
@ -668,7 +668,7 @@ public class EntityRenderer {
// }
Project.gluPerspective(this.getFOVModifier(partialTicks, false), (float)this.gm.fb_x / (float)this.gm.fb_y, 0.05F, this.farPlaneDistance * 2.0F);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
// if (this.gm.anaglyph)
@ -718,12 +718,12 @@ public class EntityRenderer {
public void enableLightmap()
{
GlState.setActiveTexture(GL13.GL_TEXTURE1);
GL11.glMatrixMode(5890);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
float f = 0.00390625F;
GL11.glScalef(f, f, f);
GL11.glTranslatef(8.0F, 8.0F, 8.0F);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
this.gm.getTextureManager().bindTexture(locationLightMap);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
@ -932,7 +932,7 @@ public class EntityRenderer {
this.getMouseOver(partialTicks);
GlState.enableDepth();
GlState.enableAlpha();
GlState.alphaFunc(516, 0.5F);
GlState.alphaFunc(GL11.GL_GREATER, 0.5F);
// if (this.gm.anaglyph)
// {
@ -967,15 +967,15 @@ public class EntityRenderer {
if (this.gm.renderDistance >= 4)
{
this.setupFog(-1, partialTicks);
GL11.glMatrixMode(5889);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.gm.fb_x / (float)this.gm.fb_y, 0.05F, this.farPlaneDistance * 2.0F);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
renderglobal.renderSky(partialTicks);
GL11.glMatrixMode(5889);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.gm.fb_x / (float)this.gm.fb_y, 0.05F, this.farPlaneDistance * SQRT_2);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
this.setupFog(0, partialTicks);
@ -990,7 +990,7 @@ public class EntityRenderer {
ItemRenderer.disableStandardItemLighting();
renderglobal.setupTerrain(entity, (double)partialTicks, this.frameCount++, this.gm.thePlayer.noclip);
this.gm.renderGlobal.updateChunks(finishTimeNano);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPushMatrix();
GlState.disableAlpha();
renderglobal.renderBlockLayer(BlockLayer.SOLID, (double)partialTicks, entity);
@ -1000,18 +1000,18 @@ public class EntityRenderer {
renderglobal.renderBlockLayer(BlockLayer.CUTOUT, (double)partialTicks, entity);
// this.gm.getTextureManager().getTexture(TextureMap.locationBlocksTexture).restoreLastMipmap();
GlState.shadeModel(GL11.GL_FLAT);
GlState.alphaFunc(516, 0.1F);
GlState.alphaFunc(GL11.GL_GREATER, 0.1F);
// if (!this.debugView)
// {
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPopMatrix();
GL11.glPushMatrix();
ItemRenderer.enableStandardItemLighting();
renderglobal.renderEntities(entity, partialTicks);
ItemRenderer.disableStandardItemLighting();
this.disableLightmap();
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPopMatrix();
GL11.glPushMatrix();
@ -1024,7 +1024,7 @@ public class EntityRenderer {
}
// }
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPopMatrix();
if (flag && this.gm.pointed != null && !entity.isInsideOfLiquid())
@ -1035,7 +1035,7 @@ public class EntityRenderer {
GlState.enableAlpha();
}
GlState.enableBlend();
GlState.tryBlendFuncSeparate(770, 1, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE, GL11.GL_ZERO);
// this.gm.getTextureManager().getTexture(TextureMap.locationBlocksTexture).unsetMipmap();
// Tessellator.getInstance();
renderglobal.drawBlockDamageTexture(Tessellator.getBuffer(), entity, partialTicks);
@ -1059,8 +1059,8 @@ public class EntityRenderer {
// renderglobal.renderWorldBorder(entity, partialTicks);
GlState.disableBlend();
GlState.enableCull();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.alphaFunc(516, 0.1F);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GlState.alphaFunc(GL11.GL_GREATER, 0.1F);
this.setupFog(0, partialTicks);
GlState.enableBlend();
GlState.depthMask(false);
@ -1089,10 +1089,10 @@ public class EntityRenderer {
{
if (this.gm.renderDistance >= 4)
{
GL11.glMatrixMode(5889);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.gm.fb_x / (float)this.gm.fb_y, 0.05F, this.farPlaneDistance * 4.0F);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPushMatrix();
this.setupFog(0, partialTicks);
// renderGlobalIn.renderClouds(partialTicks);
@ -1100,10 +1100,10 @@ public class EntityRenderer {
renderGlobalIn.renderClouds(partialTicks);
GlState.disableFog();
GL11.glPopMatrix();
GL11.glMatrixMode(5889);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.gm.fb_x / (float)this.gm.fb_y, 0.05F, this.farPlaneDistance * SQRT_2);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
}
@ -1225,8 +1225,8 @@ public class EntityRenderer {
GlState.disableCull();
GL11.glNormal3f(0.0F, 1.0F, 0.0F);
GlState.enableBlend();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.alphaFunc(516, 0.1F);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GlState.alphaFunc(GL11.GL_GREATER, 0.1F);
double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks;
double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks;
double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)partialTicks;
@ -1383,7 +1383,7 @@ public class EntityRenderer {
worldrenderer.setTranslation(0.0D, 0.0D, 0.0D);
GlState.enableCull();
GlState.disableBlend();
GlState.alphaFunc(516, 0.1F);
GlState.alphaFunc(GL11.GL_GREATER, 0.1F);
this.disableLightmap();
}
}

View file

@ -7,23 +7,20 @@ import org.lwjgl.opengl.GL14;
public class GlState
{
private static GlState.AlphaState alphaState = new GlState.AlphaState();
private static GlState.BooleanState lightingState = new GlState.BooleanState(2896);
private static GlState.BooleanState[] lightState = new GlState.BooleanState[8];
private static GlState.BooleanState lightingState = new GlState.BooleanState(GL11.GL_LIGHTING);
private static GlState.BooleanState[] lightState = new GlState.BooleanState[2];
private static GlState.ColorMaterialState colorMaterialState = new GlState.ColorMaterialState();
private static GlState.BlendState blendState = new GlState.BlendState();
private static GlState.DepthState depthState = new GlState.DepthState();
private static GlState.FogState fogState = new GlState.FogState();
private static GlState.CullState cullState = new GlState.CullState();
private static GlState.PolygonOffsetState polygonOffsetState = new GlState.PolygonOffsetState();
// private static GlState.ColorLogicState colorLogicState = new GlState.ColorLogicState();
// private static GlState.TexGenState texGenState = new GlState.TexGenState();
private static GlState.ClearState clearState = new GlState.ClearState();
// private static GlState.StencilState stencilState = new GlState.StencilState();
private static GlState.BooleanState normalizeState = new GlState.BooleanState(2977);
private static GlState.Color clearState = new GlState.Color();
private static GlState.BooleanState normalizeState = new GlState.BooleanState(GL11.GL_NORMALIZE);
private static int activeTextureUnit = 0;
private static GlState.TextureState[] textureState = new GlState.TextureState[8];
private static int activeShadeModel = 7425;
private static GlState.BooleanState rescaleNormalState = new GlState.BooleanState(32826);
private static GlState.TextureState[] textureState = new GlState.TextureState[2];
private static int activeShadeModel = GL11.GL_SMOOTH;
private static GlState.BooleanState rescaleNormalState = new GlState.BooleanState(GL13.GL_RESCALE_NORMAL);
private static GlState.ColorMask colorMaskState = new GlState.ColorMask();
private static GlState.Color colorState = new GlState.Color();
@ -217,7 +214,7 @@ public class GlState
cullState.cullFace.setDisabled();
}
public static boolean isCullEbabled()
public static boolean isCullEnabled()
{
return cullState.cullFace.currentState;
}
@ -251,72 +248,6 @@ public class GlState
}
}
// public static void enableColorLogic()
// {
// colorLogicState.colorLogicOp.setEnabled();
// }
//
// public static void disableColorLogic()
// {
// colorLogicState.colorLogicOp.setDisabled();
// }
//
// public static void colorLogicOp(int opcode)
// {
// if (opcode != colorLogicState.opcode)
// {
// colorLogicState.opcode = opcode;
// SKC.glLogicOp(opcode);
// }
// }
// public static void enableTexGenCoord(GlState.TexGen p_179087_0_)
// {
// texGenCoord(p_179087_0_).textureGen.setEnabled();
// }
//
// public static void disableTexGenCoord(GlState.TexGen p_179100_0_)
// {
// texGenCoord(p_179100_0_).textureGen.setDisabled();
// }
//
// public static void texGen(GlState.TexGen texGen, int param)
// {
// GlState.TexGenCoord glstatemanager$texgencoord = texGenCoord(texGen);
//
// if (param != glstatemanager$texgencoord.param)
// {
// glstatemanager$texgencoord.param = param;
// SKC.glTexGeni(glstatemanager$texgencoord.coord, SKC.GL_TEXTURE_GEN_MODE, param);
// }
// }
//
// public static void texGen(GlState.TexGen p_179105_0_, int pname, FloatBuffer params)
// {
// SKC.glTexGen(texGenCoord(p_179105_0_).coord, pname, params);
// }
//
// private static GlState.TexGenCoord texGenCoord(GlState.TexGen p_179125_0_)
// {
// switch (p_179125_0_)
// {
// case S:
// return texGenState.s;
//
// case T:
// return texGenState.t;
//
// case R:
// return texGenState.r;
//
// case Q:
// return texGenState.q;
//
// default:
// return texGenState.s;
// }
// }
public static void setActiveTexture(int texture)
{
if (activeTextureUnit != texture - GL13.GL_TEXTURE0)
@ -358,12 +289,6 @@ public class GlState
}
}
public static void resetTextures()
{
textureState[0].textureName = 0;
textureState[1].textureName = 0;
}
public static void enableNormalize()
{
normalizeState.setEnabled();
@ -405,23 +330,14 @@ public class GlState
}
}
public static void clearDepth(double depth)
{
if (depth != clearState.depth)
{
clearState.depth = depth;
GL11.glClearDepth(depth);
}
}
public static void clearColor(float red, float green, float blue, float alpha)
{
if (red != clearState.color.red || green != clearState.color.green || blue != clearState.color.blue || alpha != clearState.color.alpha)
if (red != clearState.red || green != clearState.green || blue != clearState.blue || alpha != clearState.alpha)
{
clearState.color.red = red;
clearState.color.green = green;
clearState.color.blue = blue;
clearState.color.alpha = alpha;
clearState.red = red;
clearState.green = green;
clearState.blue = blue;
clearState.alpha = alpha;
GL11.glClearColor(red, green, blue, alpha);
}
}
@ -451,19 +367,14 @@ public class GlState
colorState.red = colorState.green = colorState.blue = colorState.alpha = -1.0F;
}
public static void resetClear()
{
clearState.color.red = clearState.color.green = clearState.color.blue = clearState.color.alpha = -1.0F;
}
static
{
for (int i = 0; i < 8; ++i)
for (int i = 0; i < lightState.length; ++i)
{
lightState[i] = new GlState.BooleanState(16384 + i);
lightState[i] = new GlState.BooleanState(GL11.GL_LIGHT0 + i);
}
for (int j = 0; j < 8; ++j)
for (int j = 0; j < textureState.length; ++j)
{
textureState[j] = new GlState.TextureState();
}
@ -477,8 +388,8 @@ public class GlState
private AlphaState()
{
this.alphaTest = new GlState.BooleanState(3008);
this.func = 519;
this.alphaTest = new GlState.BooleanState(GL11.GL_ALPHA_TEST);
this.func = GL11.GL_ALWAYS;
this.ref = -1.0F;
}
}
@ -493,11 +404,11 @@ public class GlState
private BlendState()
{
this.blend = new GlState.BooleanState(3042);
this.srcFactor = 1;
this.dstFactor = 0;
this.srcFactorAlpha = 1;
this.dstFactorAlpha = 0;
this.blend = new GlState.BooleanState(GL11.GL_BLEND);
this.srcFactor = GL11.GL_ONE;
this.dstFactor = GL11.GL_ZERO;
this.srcFactorAlpha = GL11.GL_ONE;
this.dstFactorAlpha = GL11.GL_ZERO;
}
}
@ -539,20 +450,6 @@ public class GlState
}
}
static class ClearState
{
public double depth;
public GlState.Color color;
public int field_179204_c;
private ClearState()
{
this.depth = 1.0D;
this.color = new GlState.Color(0.0F, 0.0F, 0.0F, 0.0F);
this.field_179204_c = 0;
}
}
static class Color
{
public float red = 1.0F;
@ -563,26 +460,6 @@ public class GlState
public Color()
{
}
public Color(float redIn, float greenIn, float blueIn, float alphaIn)
{
this.red = redIn;
this.green = greenIn;
this.blue = blueIn;
this.alpha = alphaIn;
}
}
static class ColorLogicState
{
public GlState.BooleanState colorLogicOp;
public int opcode;
private ColorLogicState()
{
this.colorLogicOp = new GlState.BooleanState(3058);
this.opcode = 5379;
}
}
static class ColorMask
@ -622,8 +499,8 @@ public class GlState
private CullState()
{
this.cullFace = new GlState.BooleanState(2884);
this.mode = 1029;
this.cullFace = new GlState.BooleanState(GL11.GL_CULL_FACE);
this.mode = GL11.GL_BACK;
}
}
@ -635,9 +512,9 @@ public class GlState
private DepthState()
{
this.depthTest = new GlState.BooleanState(2929);
this.depthTest = new GlState.BooleanState(GL11.GL_DEPTH_TEST);
this.maskEnabled = true;
this.depthFunc = 513;
this.depthFunc = GL11.GL_LESS;
}
}
@ -670,82 +547,13 @@ public class GlState
private PolygonOffsetState()
{
this.polygonOffsetFill = new GlState.BooleanState(32823);
this.polygonOffsetLine = new GlState.BooleanState(10754);
this.polygonOffsetFill = new GlState.BooleanState(GL11.GL_POLYGON_OFFSET_FILL);
this.polygonOffsetLine = new GlState.BooleanState(GL11.GL_POLYGON_OFFSET_LINE);
this.factor = 0.0F;
this.units = 0.0F;
}
}
static class StencilFunc
{
public int field_179081_a;
public int field_179079_b;
public int field_179080_c;
private StencilFunc()
{
this.field_179081_a = 519;
this.field_179079_b = 0;
this.field_179080_c = -1;
}
}
// static class StencilState
// {
// public GlState.StencilFunc field_179078_a;
// public int field_179076_b;
// public int field_179077_c;
// public int field_179074_d;
// public int field_179075_e;
//
// private StencilState()
// {
// this.field_179078_a = new GlState.StencilFunc();
// this.field_179076_b = -1;
// this.field_179077_c = 7680;
// this.field_179074_d = 7680;
// this.field_179075_e = 7680;
// }
// }
// public static enum TexGen
// {
// S,
// T,
// R,
// Q;
// }
// static class TexGenCoord
// {
// public GlState.BooleanState textureGen;
// public int coord;
// public int param = -1;
//
// public TexGenCoord(int p_i46254_1_, int p_i46254_2_)
// {
// this.coord = p_i46254_1_;
// this.textureGen = new GlState.BooleanState(p_i46254_2_);
// }
// }
//
// static class TexGenState
// {
// public GlState.TexGenCoord s;
// public GlState.TexGenCoord t;
// public GlState.TexGenCoord r;
// public GlState.TexGenCoord q;
//
// private TexGenState()
// {
// this.s = new GlState.TexGenCoord(8192, 3168);
// this.t = new GlState.TexGenCoord(8193, 3169);
// this.r = new GlState.TexGenCoord(8194, 3170);
// this.q = new GlState.TexGenCoord(8195, 3171);
// }
// }
static class TextureState
{
public GlState.BooleanState texture2DState;
@ -753,7 +561,7 @@ public class GlState
private TextureState()
{
this.texture2DState = new GlState.BooleanState(3553);
this.texture2DState = new GlState.BooleanState(GL11.GL_TEXTURE_2D);
this.textureName = 0;
}
}

View file

@ -548,10 +548,10 @@ public class ItemRenderer
// Tessellator tessellator = Tessellator.getInstance();
RenderBuffer worldrenderer = Tessellator.getBuffer();
GlState.color(1.0F, 1.0F, 1.0F, 0.9F);
GlState.depthFunc(519);
GlState.depthFunc(GL11.GL_ALWAYS);
GlState.depthMask(false);
GlState.enableBlend();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
float f = 1.0F;
for (int i = 0; i < 2; ++i)
@ -582,7 +582,7 @@ public class ItemRenderer
GlState.color(1.0F, 1.0F, 1.0F, 1.0F);
GlState.disableBlend();
GlState.depthMask(true);
GlState.depthFunc(515);
GlState.depthFunc(GL11.GL_LEQUAL);
}
public void updateEquippedItem()

View file

@ -521,11 +521,11 @@ public class RenderGlobal
if (this.gm.tileOverlay)
{
GlState.depthFunc(519);
GlState.depthFunc(GL11.GL_ALWAYS);
GlState.disableFog();
ItemRenderer.disableStandardItemLighting();
GlState.enableBlend();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GL11.glLineWidth(2.0F);
GlState.disableTexture2D();
GlState.depthMask(false);
@ -554,18 +554,18 @@ public class RenderGlobal
GlState.depthMask(true);
GlState.enableFog();
GlState.enableColorMaterial();
GlState.depthFunc(515);
GlState.depthFunc(GL11.GL_LEQUAL);
GlState.enableDepth();
GlState.enableAlpha();
}
if (this.gm.renderOutlines && this.gm.thePlayer != null)
{
GlState.depthFunc(519);
GlState.depthFunc(GL11.GL_ALWAYS);
GlState.disableFog();
ItemRenderer.disableStandardItemLighting();
GlState.enableBlend();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GL11.glLineWidth(2.0F);
GlState.disableTexture2D();
GlState.depthMask(false);
@ -593,7 +593,7 @@ public class RenderGlobal
GlState.depthMask(true);
GlState.enableFog();
GlState.enableColorMaterial();
GlState.depthFunc(515);
GlState.depthFunc(GL11.GL_LEQUAL);
GlState.enableDepth();
GlState.enableAlpha();
}
@ -1072,7 +1072,7 @@ public class RenderGlobal
GlState.disableFog();
GlState.disableAlpha();
GlState.enableBlend();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
ItemRenderer.disableStandardItemLighting();
GlState.depthMask(false);
this.renderEngine.bindTexture(texture);
@ -1171,7 +1171,7 @@ public class RenderGlobal
GlState.disableFog();
GlState.disableAlpha();
GlState.enableBlend();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
ItemRenderer.disableStandardItemLighting();
float[] afloat = this.theWorld.dimension.getType().days ?
@ -1216,7 +1216,7 @@ public class RenderGlobal
}
GlState.enableTexture2D();
GlState.tryBlendFuncSeparate(770, 1, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE, GL11.GL_ZERO);
GL11.glPushMatrix();
float f16 = 1.0F - Math.max(this.theWorld.getRainStrength(), this.theWorld.getFogStrength());
GlState.color(1.0F, 1.0F, 1.0F, f16);
@ -1333,7 +1333,7 @@ public class RenderGlobal
d2 = d2 - (double)(j * 2048);
this.renderEngine.bindTexture(this.gm.theWorld.dimension.getCloudTexture());
GlState.enableBlend();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
Vec3 vec3 = this.theWorld.getCloudColour(this.gm.getRenderViewEntity(), partialTicks);
float f4 = (float)vec3.xCoord;
float f5 = (float)vec3.yCoord;
@ -1502,12 +1502,12 @@ public class RenderGlobal
private void preRenderDamagedBlocks()
{
GlState.tryBlendFuncSeparate(774, 768, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_DST_COLOR, GL11.GL_SRC_COLOR, GL11.GL_ONE, GL11.GL_ZERO);
GlState.enableBlend();
GlState.color(1.0F, 1.0F, 1.0F, 0.5F);
GlState.doPolygonOffset(-3.0F, -3.0F);
GlState.enablePolygonOffset();
GlState.alphaFunc(516, 0.1F);
GlState.alphaFunc(GL11.GL_GREATER, 0.1F);
GlState.enableAlpha();
GL11.glPushMatrix();
}
@ -1583,7 +1583,7 @@ public class RenderGlobal
if (movingObjectPositionIn.type == HitPosition.ObjectType.BLOCK)
{
GlState.enableBlend();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GlState.color(0.0F, 0.0F, 0.0F, 0.4F);
GL11.glLineWidth(2.0F);
GlState.disableTexture2D();
@ -1797,7 +1797,7 @@ public class RenderGlobal
// WCF.glDisableClientState(WCF.GL_VERTEX_ARRAY);
GlState.disableAlpha();
GlState.enableBlend();
GlState.tryBlendFuncSeparate(770, 1, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE, GL11.GL_ZERO);
ItemRenderer.disableStandardItemLighting();
GlState.color((float)stars.xCoord, (float)stars.yCoord, (float)stars.zCoord, 1.0f);
this.starVBO.bindBuffer();

View file

@ -157,7 +157,7 @@ public abstract class Render<T extends Entity>
// private void renderShadow(Entity entityIn, double x, double y, double z, float shadowAlpha, float partialTicks)
// {
// GlState.enableBlend();
// GlState.blendFunc(770, 771);
// GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
// this.renderManager.renderEngine.bindTexture(shadowTextures);
// World world = this.getWorldFromRenderManager();
// GlState.depthMask(false);
@ -336,7 +336,7 @@ public abstract class Render<T extends Entity>
GlState.depthMask(false);
// GlState.disableDepth();
GlState.enableBlend();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
// Tessellator tessellator = Tessellator.getInstance();
RenderBuffer worldrenderer = Tessellator.getBuffer();
// int i = 0;

View file

@ -53,7 +53,7 @@ public class RenderBlockEntity extends Render<Entity>
// GlStateManager.disableTexture2D();
// GlStateManager.disableLighting();
// GlStateManager.enableBlend();
// GlStateManager.blendFunc(770, 772);
// GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
// GlStateManager.color(1.0F, 1.0F, 1.0F, f2);
// GlStateManager.doPolygonOffset(-3.0F, -3.0F);
// GlStateManager.enablePolygonOffset();

View file

@ -54,13 +54,13 @@ public class RenderDragon extends RenderLiving<EntityDragon>
// if (entitylivingbaseIn.deathTicks > 0)
// {
// float f = (float)entitylivingbaseIn.deathTicks / 200.0F;
// GlState.depthFunc(515);
// GlState.depthFunc(GL11.GL_LEQUAL);
// GlState.enableAlpha();
// GlState.alphaFunc(516, f);
// GlState.alphaFunc(GL11.GL_GREATER, f);
// this.bindTexture(enderDragonExplodingTextures);
// this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, scaleFactor);
// GlState.alphaFunc(516, 0.1F);
// GlState.depthFunc(514);
// GlState.alphaFunc(GL11.GL_GREATER, 0.1F);
// GlState.depthFunc(GL11.GL_EQUAL);
// }
this.bindEntityTexture(entitylivingbaseIn);
@ -68,15 +68,15 @@ public class RenderDragon extends RenderLiving<EntityDragon>
if (entitylivingbaseIn.hurtTime > 0)
{
GlState.depthFunc(514);
GlState.depthFunc(GL11.GL_EQUAL);
GlState.disableTexture2D();
GlState.enableBlend();
GlState.blendFunc(770, 771);
GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlState.color(1.0F, 0.0F, 0.0F, 0.5F);
this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, scaleFactor);
GlState.enableTexture2D();
GlState.disableBlend();
GlState.depthFunc(515);
GlState.depthFunc(GL11.GL_LEQUAL);
}
}

View file

@ -104,9 +104,9 @@ public class RenderEntityItem extends Render<EntityItem>
// }
GlState.enableRescaleNormal();
GlState.alphaFunc(516, 0.1F);
GlState.alphaFunc(GL11.GL_GREATER, 0.1F);
GlState.enableBlend();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GL11.glPushMatrix();
IBakedModel ibakedmodel = this.itemRenderer.getItemModelMesher().getItemModel(itemstack);
int i = this.func_177077_a(entity, x, y, z, partialTicks, ibakedmodel);

View file

@ -117,11 +117,11 @@ public class RenderItem
private void renderEffect(IBakedModel model)
{
GlState.depthMask(false);
GlState.depthFunc(514);
GlState.depthFunc(GL11.GL_EQUAL);
GlState.disableLighting();
GlState.blendFunc(768, 1);
GlState.blendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
this.textureManager.bindTexture(RES_ITEM_GLINT);
GL11.glMatrixMode(5890);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPushMatrix();
GL11.glScalef(8.0F, 8.0F, 8.0F);
float f = (float)(System.currentTimeMillis() % 3000L) / 3000.0F / 8.0F;
@ -136,10 +136,10 @@ public class RenderItem
GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
this.renderModel(model, -8372020);
GL11.glPopMatrix();
GL11.glMatrixMode(5888);
GlState.blendFunc(770, 771);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlState.enableLighting();
GlState.depthFunc(515);
GlState.depthFunc(GL11.GL_LEQUAL);
GlState.depthMask(true);
this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
}
@ -266,20 +266,20 @@ public class RenderItem
// this.textureManager.getTexture(TextureMap.locationBlocksTexture).unsetMipmap();
this.preTransform(stack);
GlState.enableRescaleNormal();
GlState.alphaFunc(516, 0.1F);
GlState.alphaFunc(GL11.GL_GREATER, 0.1F);
GlState.enableBlend();
GlState.tryBlendFuncSeparate(770, 771, 1, 0);
GlState.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GL11.glPushMatrix();
Transforms itemcameratransforms = model.getItemCameraTransforms();
itemcameratransforms.apply(cameraTransformType);
if (this.isThereOneNegativeScale(itemcameratransforms.get(cameraTransformType)))
{
GlState.cullFace(1028);
GlState.cullFace(GL11.GL_FRONT);
}
this.renderItem(stack, model);
GlState.cullFace(1029);
GlState.cullFace(GL11.GL_BACK);
GL11.glPopMatrix();
GlState.disableRescaleNormal();
GlState.disableBlend();
@ -305,9 +305,9 @@ public class RenderItem
// this.textureManager.getTexture(TextureMap.locationBlocksTexture).unsetMipmap();
GlState.enableRescaleNormal();
GlState.enableAlpha();
GlState.alphaFunc(516, 0.1F);
GlState.alphaFunc(GL11.GL_GREATER, 0.1F);
GlState.enableBlend();
GlState.blendFunc(770, 771);
GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlState.color(1.0F, 1.0F, 1.0F, 1.0F);
this.setupGuiTransform(x, y, ibakedmodel.isGui3d());
ibakedmodel.getItemCameraTransforms().apply(Transforms.Camera.GUI);

View file

@ -1,5 +1,7 @@
package game.renderer.entity;
import org.lwjgl.opengl.GL11;
import game.entity.effect.EntityLightning;
import game.renderer.DefaultVertexFormats;
import game.renderer.GlState;
@ -25,7 +27,7 @@ public class RenderLightning extends Render<EntityLightning>
GlState.disableTexture2D();
GlState.disableLighting();
GlState.enableBlend();
GlState.blendFunc(770, 1);
GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
double[] adouble = new double[8];
double[] adouble1 = new double[8];
double d0 = 0.0D;

View file

@ -39,7 +39,7 @@ public class RenderTntMinecart extends RenderMinecart<EntityTntCart>
GlState.disableTexture2D();
GlState.disableLighting();
GlState.enableBlend();
GlState.blendFunc(770, 772);
GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
GlState.color(1.0F, 1.0F, 1.0F, (1.0F - ((float)i - partialTicks + 1.0F) / 100.0F) * 0.8F);
GL11.glPushMatrix();
blockrendererdispatcher.renderBlockBrightness(Blocks.tnt.getState(), 1.0F);

View file

@ -50,7 +50,7 @@ public class RenderTntPrimed extends Render<EntityTnt>
GlState.disableTexture2D();
GlState.disableLighting();
GlState.enableBlend();
GlState.blendFunc(770, 772);
GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
GlState.color(1.0F, 1.0F, 1.0F, f2);
GlState.doPolygonOffset(-3.0F, -3.0F);
GlState.enablePolygonOffset();

View file

@ -262,8 +262,8 @@ public abstract class RendererLivingEntity<T extends EntityLiving> extends Rende
// GlState.color(entity.getRenderColor() | (vis ? 0x50000000 : 0x26000000));
GlState.depthMask(false);
GlState.enableBlend();
GlState.blendFunc(770, 771);
GlState.alphaFunc(516, 0.003921569F);
GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlState.alphaFunc(GL11.GL_GREATER, 0.003921569F);
}
if(entity.isGlowing())
@ -276,7 +276,7 @@ public abstract class RendererLivingEntity<T extends EntityLiving> extends Rende
if (ghost)
{
GlState.disableBlend();
GlState.alphaFunc(516, 0.1F);
GlState.alphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glPopMatrix();
GlState.depthMask(true);
}

View file

@ -107,7 +107,7 @@ public class LayerArmor implements LayerRenderer<EntityLiving>
float f = (float)entitylivingbaseIn.ticksExisted + partialTicks;
this.renderer.bindTexture(ENCHANTED_ITEM_GLINT_RES);
GlState.enableBlend();
GlState.depthFunc(514);
GlState.depthFunc(GL11.GL_EQUAL);
GlState.depthMask(false);
float f1 = 0.5F;
GlState.color(f1, f1, f1, 1.0F);
@ -115,25 +115,25 @@ public class LayerArmor implements LayerRenderer<EntityLiving>
for (int i = 0; i < 2; ++i)
{
GlState.disableLighting();
GlState.blendFunc(768, 1);
GlState.blendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
float f2 = 0.76F;
GlState.color(0.5F * f2, 0.25F * f2, 0.8F * f2, 1.0F);
GL11.glMatrixMode(5890);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
float f3 = 0.33333334F;
GL11.glScalef(f3, f3, f3);
GL11.glRotatef(30.0F - (float)i * 60.0F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(0.0F, f * (0.001F + (float)i * 0.003F) * 20.0F, 0.0F);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
modelbaseIn.render(entitylivingbaseIn, p_177183_3_, p_177183_4_, p_177183_6_, p_177183_7_, p_177183_8_, scale);
}
GL11.glMatrixMode(5890);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GlState.enableLighting();
GlState.depthMask(true);
GlState.depthFunc(515);
GlState.depthFunc(GL11.GL_LEQUAL);
GlState.disableBlend();
}

View file

@ -27,23 +27,23 @@ public class LayerCharge implements LayerRenderer<EntityNPC>
// boolean flag = entitylivingbaseIn.isInvisible();
GlState.depthMask(true);
this.main.bindTexture(LIGHTNING_TEXTURE);
GL11.glMatrixMode(5890);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
float f = (float)entitylivingbaseIn.ticksExisted + partialTicks;
GL11.glTranslatef(f * 0.01F, f * 0.01F, 0.0F);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GlState.enableBlend();
float f1 = 0.5F;
GlState.color(f1, f1, f1, 1.0F);
GlState.disableLighting();
GlState.blendFunc(1, 1);
GlState.blendFunc(GL11.GL_ONE, GL11.GL_ONE);
this.charge.setModelAttributes(this.main.getMainModel());
GL11.glScalef(entitylivingbaseIn.height, entitylivingbaseIn.height, entitylivingbaseIn.height);
GL11.glTranslatef(0.0f, -0.25f, 0.0f);
this.charge.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
GL11.glMatrixMode(5890);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GlState.enableLighting();
GlState.disableBlend();
GlState.depthMask(false);

View file

@ -1,5 +1,6 @@
package game.renderer.layers;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL13;
import game.entity.animal.EntityDragon;
@ -22,9 +23,9 @@ public class LayerEnderDragonEyes implements LayerRenderer<EntityDragon>
this.dragonRenderer.bindTexture(TEXTURE);
GlState.enableBlend();
GlState.disableAlpha();
GlState.blendFunc(1, 1);
GlState.blendFunc(GL11.GL_ONE, GL11.GL_ONE);
GlState.disableLighting();
GlState.depthFunc(514);
GlState.depthFunc(GL11.GL_EQUAL);
int i = 61680;
int j = i % 65536;
int k = i / 65536;
@ -35,7 +36,7 @@ public class LayerEnderDragonEyes implements LayerRenderer<EntityDragon>
this.dragonRenderer.setLightmap(entitylivingbaseIn, partialTicks);
GlState.disableBlend();
GlState.enableAlpha();
GlState.depthFunc(515);
GlState.depthFunc(GL11.GL_LEQUAL);
}
public boolean shouldCombineTextures()

View file

@ -31,7 +31,7 @@ public class LayerEntityBreak implements LayerRenderer<EntityDragon>
GlState.disableTexture2D();
GlState.shadeModel(GL11.GL_SMOOTH);
GlState.enableBlend();
GlState.blendFunc(770, 1);
GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GlState.disableAlpha();
GlState.enableCull();
GlState.depthMask(false);

View file

@ -27,7 +27,7 @@ public class LayerMooshroomMushroom implements LayerRenderer<EntityMooshroom>
BlockRenderer blockrendererdispatcher = Game.getGame().getBlockRendererDispatcher();
this.mooshroomRenderer.bindTexture(TextureMap.locationBlocksTexture);
GlState.enableCull();
GlState.cullFace(1028);
GlState.cullFace(GL11.GL_FRONT);
GL11.glPushMatrix();
GL11.glScalef(1.0F, -1.0F, 1.0F);
GL11.glTranslatef(0.2F, 0.35F, 0.5F);
@ -51,7 +51,7 @@ public class LayerMooshroomMushroom implements LayerRenderer<EntityMooshroom>
GL11.glTranslatef(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getState(), 1.0F);
GL11.glPopMatrix();
GlState.cullFace(1029);
GlState.cullFace(GL11.GL_BACK);
GlState.disableCull();
}
}

View file

@ -1,5 +1,7 @@
package game.renderer.layers;
import org.lwjgl.opengl.GL11;
import game.entity.npc.EntityNPC;
import game.renderer.GlState;
import game.renderer.entity.RenderSlime;
@ -23,7 +25,7 @@ public class LayerSlimeGel implements LayerRenderer<EntityNPC>
GlState.color(1.0F, 1.0F, 1.0F, 1.0F);
GlState.enableNormalize();
GlState.enableBlend();
GlState.blendFunc(770, 771);
GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
this.slimeModel.setModelAttributes(this.slimeRenderer.getMainModel());
this.slimeModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
GlState.disableBlend();

View file

@ -209,12 +209,12 @@ public class ModelDragon extends ModelBase
if (j == 0)
{
GlState.cullFace(1028);
GlState.cullFace(GL11.GL_FRONT);
}
}
GL11.glPopMatrix();
GlState.cullFace(1029);
GlState.cullFace(GL11.GL_BACK);
GlState.disableCull();
float f10 = -((float)Math.sin((double)(f * (float)Math.PI * 2.0F))) * 0.0F;
f8 = f * (float)Math.PI * 2.0F;

View file

@ -3,6 +3,8 @@ package game.renderer.particle;
import java.util.List;
import java.util.Map;
import org.lwjgl.opengl.GL11;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@ -219,8 +221,8 @@ public class EffectRenderer
EntityFX.interpPosY = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks;
EntityFX.interpPosZ = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks;
GlState.enableBlend();
GlState.blendFunc(770, 771);
GlState.alphaFunc(516, 0.003921569F);
GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlState.alphaFunc(GL11.GL_GREATER, 0.003921569F);
for (int i = 0; i < 3; ++i)
{
@ -270,7 +272,7 @@ public class EffectRenderer
GlState.depthMask(true);
GlState.disableBlend();
GlState.alphaFunc(516, 0.1F);
GlState.alphaFunc(GL11.GL_GREATER, 0.1F);
}
public void renderLitParticles(Entity entityIn, float partialTick)

View file

@ -1,5 +1,7 @@
package game.renderer.particle;
import org.lwjgl.opengl.GL11;
import game.Game;
import game.entity.Entity;
import game.renderer.DefaultVertexFormats;
@ -52,7 +54,7 @@ public class EntityFootStepFX extends EntityFX
float f6 = this.worldObj.getLightBrightness(new BlockPos(this));
this.currentFootSteps.bindTexture(EffectRenderer.particleTextures);
GlState.enableBlend();
GlState.blendFunc(770, 771);
GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
worldRendererIn.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldRendererIn.pos((double)(f3 - 0.125F), (double)f4, (double)(f5 + 0.125F)).tex(u1, u3).color(f6, f6, f6, f1).endVertex();
worldRendererIn.pos((double)(f3 + 0.125F), (double)f4, (double)(f5 + 0.125F)).tex(u1, u2).color(f6, f6, f6, f1).endVertex();

View file

@ -42,7 +42,7 @@ public class TileEntityChestRenderer extends TileEntitySpecialRenderer<TileEntit
public void renderTileEntityAt(TileEntityChest te, double x, double y, double z, float partialTicks, int destroyStage)
{
GlState.enableDepth();
GlState.depthFunc(515);
GlState.depthFunc(GL11.GL_LEQUAL);
GlState.depthMask(true);
int i;
@ -75,11 +75,11 @@ public class TileEntityChestRenderer extends TileEntitySpecialRenderer<TileEntit
if (destroyStage >= 0)
{
this.bindTexture(DESTROY_STAGES[destroyStage]);
GL11.glMatrixMode(5890);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPushMatrix();
GL11.glScalef(4.0F, 4.0F, 1.0F);
GL11.glTranslatef(0.0625F, 0.0625F, 0.0625F);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
// else if (this.isChristmas)
// {
@ -101,11 +101,11 @@ public class TileEntityChestRenderer extends TileEntitySpecialRenderer<TileEntit
if (destroyStage >= 0)
{
this.bindTexture(DESTROY_STAGES[destroyStage]);
GL11.glMatrixMode(5890);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPushMatrix();
GL11.glScalef(8.0F, 4.0F, 1.0F);
GL11.glTranslatef(0.0625F, 0.0625F, 0.0625F);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
// else if (this.isChristmas)
// {
@ -198,9 +198,9 @@ public class TileEntityChestRenderer extends TileEntitySpecialRenderer<TileEntit
if (destroyStage >= 0)
{
GL11.glMatrixMode(5890);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPopMatrix();
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
}
}

View file

@ -47,7 +47,7 @@ public class TileEntityItemStackRenderer
GL11.glPushMatrix();
GL11.glTranslatef(-0.5F, 0.0F, -0.5F);
GL11.glScalef(2.0F, 2.0F, 2.0F);
boolean flag = GlState.isCullEbabled();
boolean flag = GlState.isCullEnabled();
GlState.disableCull();
TileEntitySkullRenderer.instance.renderSkull(0.0F, 0.0F, 0.0F, Facing.UP, 0.0F, -1);
if(flag)

View file

@ -36,7 +36,7 @@ public class TileEntityPistonRenderer extends TileEntitySpecialRenderer<TileEnti
RenderBuffer worldrenderer = Tessellator.getBuffer();
this.bindTexture(TextureMap.locationBlocksTexture);
ItemRenderer.disableStandardItemLighting();
GlState.blendFunc(770, 771);
GlState.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlState.enableBlend();
GlState.disableCull();

View file

@ -60,11 +60,11 @@ public class TileEntitySignRenderer extends TileEntitySpecialRenderer<TileEntity
if (destroyStage >= 0)
{
this.bindTexture(DESTROY_STAGES[destroyStage]);
GL11.glMatrixMode(5890);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPushMatrix();
GL11.glScalef(4.0F, 2.0F, 1.0F);
GL11.glTranslatef(0.0625F, 0.0625F, 0.0625F);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
else
{
@ -116,9 +116,9 @@ public class TileEntitySignRenderer extends TileEntitySpecialRenderer<TileEntity
if (destroyStage >= 0)
{
GL11.glMatrixMode(5890);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPopMatrix();
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
}

View file

@ -34,11 +34,11 @@ public class TileEntitySkullRenderer extends TileEntitySpecialRenderer<TileEntit
if (destroyStage >= 0)
{
this.bindTexture(DESTROY_STAGES[destroyStage]);
GL11.glMatrixMode(5890);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPushMatrix();
GL11.glScalef(4.0F, 2.0F, 1.0F);
GL11.glTranslatef(0.0625F, 0.0625F, 0.0625F);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
else
{
@ -116,9 +116,9 @@ public class TileEntitySkullRenderer extends TileEntitySpecialRenderer<TileEntit
if (destroyStage >= 0)
{
GL11.glMatrixMode(5890);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPopMatrix();
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
}
}