2025-03-11 00:23:54 +01:00
|
|
|
package game.renderer;
|
|
|
|
|
2025-03-11 10:26:48 +01:00
|
|
|
import game.window.WCF;
|
2025-03-11 00:23:54 +01:00
|
|
|
|
|
|
|
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.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 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.ColorMask colorMaskState = new GlState.ColorMask();
|
|
|
|
private static GlState.Color colorState = new GlState.Color();
|
|
|
|
|
|
|
|
public static void disableAlpha()
|
|
|
|
{
|
|
|
|
alphaState.alphaTest.setDisabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void enableAlpha()
|
|
|
|
{
|
|
|
|
alphaState.alphaTest.setEnabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void alphaFunc(int func, float ref)
|
|
|
|
{
|
|
|
|
if (func != alphaState.func || ref != alphaState.ref)
|
|
|
|
{
|
|
|
|
alphaState.func = func;
|
|
|
|
alphaState.ref = ref;
|
|
|
|
WCF.glAlphaFunc(func, ref);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void enableLighting()
|
|
|
|
{
|
|
|
|
lightingState.setEnabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void disableLighting()
|
|
|
|
{
|
|
|
|
lightingState.setDisabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void enableLight(int light)
|
|
|
|
{
|
|
|
|
lightState[light].setEnabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void disableLight(int light)
|
|
|
|
{
|
|
|
|
lightState[light].setDisabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void enableColorMaterial()
|
|
|
|
{
|
|
|
|
colorMaterialState.colorMaterial.setEnabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void disableColorMaterial()
|
|
|
|
{
|
|
|
|
colorMaterialState.colorMaterial.setDisabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void colorMaterial(int face, int mode)
|
|
|
|
{
|
|
|
|
if (face != colorMaterialState.face || mode != colorMaterialState.mode)
|
|
|
|
{
|
|
|
|
colorMaterialState.face = face;
|
|
|
|
colorMaterialState.mode = mode;
|
|
|
|
WCF.glColorMaterial(face, mode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void disableDepth()
|
|
|
|
{
|
|
|
|
depthState.depthTest.setDisabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void enableDepth()
|
|
|
|
{
|
|
|
|
depthState.depthTest.setEnabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void depthFunc(int depthFunc)
|
|
|
|
{
|
|
|
|
if (depthFunc != depthState.depthFunc)
|
|
|
|
{
|
|
|
|
depthState.depthFunc = depthFunc;
|
|
|
|
WCF.glDepthFunc(depthFunc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void depthMask(boolean flagIn)
|
|
|
|
{
|
|
|
|
if (flagIn != depthState.maskEnabled)
|
|
|
|
{
|
|
|
|
depthState.maskEnabled = flagIn;
|
|
|
|
WCF.glDepthMask(flagIn);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void disableBlend()
|
|
|
|
{
|
|
|
|
blendState.blend.setDisabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void enableBlend()
|
|
|
|
{
|
|
|
|
blendState.blend.setEnabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void blendFunc(int srcFactor, int dstFactor)
|
|
|
|
{
|
|
|
|
if (srcFactor != blendState.srcFactor || dstFactor != blendState.dstFactor)
|
|
|
|
{
|
|
|
|
blendState.srcFactor = srcFactor;
|
|
|
|
blendState.dstFactor = dstFactor;
|
|
|
|
WCF.glBlendFunc(srcFactor, dstFactor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void tryBlendFuncSeparate(int srcFactor, int dstFactor, int srcFactorAlpha, int dstFactorAlpha)
|
|
|
|
{
|
|
|
|
if (srcFactor != blendState.srcFactor || dstFactor != blendState.dstFactor || srcFactorAlpha != blendState.srcFactorAlpha || dstFactorAlpha != blendState.dstFactorAlpha)
|
|
|
|
{
|
|
|
|
blendState.srcFactor = srcFactor;
|
|
|
|
blendState.dstFactor = dstFactor;
|
|
|
|
blendState.srcFactorAlpha = srcFactorAlpha;
|
|
|
|
blendState.dstFactorAlpha = dstFactorAlpha;
|
|
|
|
WCF.glBlendFuncSeparate(srcFactor, dstFactor, srcFactorAlpha, dstFactorAlpha);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void enableFog()
|
|
|
|
{
|
|
|
|
if(fogState.enabled)
|
|
|
|
fogState.fog.setEnabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void disableFog()
|
|
|
|
{
|
|
|
|
// if(fogState.enabled)
|
|
|
|
fogState.fog.setDisabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void setFogEnabled(boolean param)
|
|
|
|
{
|
|
|
|
if (param != fogState.enabled)
|
|
|
|
{
|
|
|
|
fogState.enabled = param;
|
|
|
|
}
|
|
|
|
if(param)
|
|
|
|
enableFog();
|
|
|
|
else
|
|
|
|
disableFog();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void setFog(int param)
|
|
|
|
{
|
|
|
|
if (param != fogState.mode)
|
|
|
|
{
|
|
|
|
fogState.mode = param;
|
|
|
|
WCF.glFogi(WCF.GL_FOG_MODE, param);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void setFogDensity(float param)
|
|
|
|
{
|
|
|
|
if (param != fogState.density)
|
|
|
|
{
|
|
|
|
fogState.density = param;
|
|
|
|
WCF.glFogf(WCF.GL_FOG_DENSITY, param);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void setFogStart(float param)
|
|
|
|
{
|
|
|
|
if (param != fogState.start)
|
|
|
|
{
|
|
|
|
fogState.start = param;
|
|
|
|
WCF.glFogf(WCF.GL_FOG_START, param);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void setFogEnd(float param)
|
|
|
|
{
|
|
|
|
if (param != fogState.end)
|
|
|
|
{
|
|
|
|
fogState.end = param;
|
|
|
|
WCF.glFogf(WCF.GL_FOG_END, param);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void enableCull()
|
|
|
|
{
|
|
|
|
cullState.cullFace.setEnabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void disableCull()
|
|
|
|
{
|
|
|
|
cullState.cullFace.setDisabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void cullFace(int mode)
|
|
|
|
{
|
|
|
|
if (mode != cullState.mode)
|
|
|
|
{
|
|
|
|
cullState.mode = mode;
|
|
|
|
WCF.glCullFace(mode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void enablePolygonOffset()
|
|
|
|
{
|
|
|
|
polygonOffsetState.polygonOffsetFill.setEnabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void disablePolygonOffset()
|
|
|
|
{
|
|
|
|
polygonOffsetState.polygonOffsetFill.setDisabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void doPolygonOffset(float factor, float units)
|
|
|
|
{
|
|
|
|
if (factor != polygonOffsetState.factor || units != polygonOffsetState.units)
|
|
|
|
{
|
|
|
|
polygonOffsetState.factor = factor;
|
|
|
|
polygonOffsetState.units = units;
|
|
|
|
WCF.glPolygonOffset(factor, units);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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 - WCF.GL_TEXTURE0)
|
|
|
|
{
|
|
|
|
activeTextureUnit = texture - WCF.GL_TEXTURE0;
|
|
|
|
WCF.glActiveTexture(texture);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void enableTexture2D()
|
|
|
|
{
|
|
|
|
textureState[activeTextureUnit].texture2DState.setEnabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void disableTexture2D()
|
|
|
|
{
|
|
|
|
textureState[activeTextureUnit].texture2DState.setDisabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void deleteTexture(int texture)
|
|
|
|
{
|
|
|
|
WCF.glDeleteTextures(texture);
|
|
|
|
|
|
|
|
for (GlState.TextureState glstatemanager$texturestate : textureState)
|
|
|
|
{
|
|
|
|
if (glstatemanager$texturestate.textureName == texture)
|
|
|
|
{
|
|
|
|
glstatemanager$texturestate.textureName = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void bindTexture(int texture)
|
|
|
|
{
|
|
|
|
if (texture != textureState[activeTextureUnit].textureName)
|
|
|
|
{
|
|
|
|
textureState[activeTextureUnit].textureName = texture;
|
|
|
|
WCF.glBindTexture(texture);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void resetTextures()
|
|
|
|
{
|
|
|
|
textureState[0].textureName = 0;
|
|
|
|
textureState[1].textureName = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void enableNormalize()
|
|
|
|
{
|
|
|
|
normalizeState.setEnabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void disableNormalize()
|
|
|
|
{
|
|
|
|
normalizeState.setDisabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void shadeModel(int mode)
|
|
|
|
{
|
|
|
|
if (mode != activeShadeModel)
|
|
|
|
{
|
|
|
|
activeShadeModel = mode;
|
|
|
|
WCF.glShadeModel(mode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void enableRescaleNormal()
|
|
|
|
{
|
|
|
|
rescaleNormalState.setEnabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void disableRescaleNormal()
|
|
|
|
{
|
|
|
|
rescaleNormalState.setDisabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void colorMask(boolean red, boolean green, boolean blue, boolean alpha)
|
|
|
|
{
|
|
|
|
if (red != colorMaskState.red || green != colorMaskState.green || blue != colorMaskState.blue || alpha != colorMaskState.alpha)
|
|
|
|
{
|
|
|
|
colorMaskState.red = red;
|
|
|
|
colorMaskState.green = green;
|
|
|
|
colorMaskState.blue = blue;
|
|
|
|
colorMaskState.alpha = alpha;
|
|
|
|
WCF.glColorMask(red, green, blue, alpha);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void clearDepth(double depth)
|
|
|
|
{
|
|
|
|
if (depth != clearState.depth)
|
|
|
|
{
|
|
|
|
clearState.depth = depth;
|
|
|
|
WCF.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)
|
|
|
|
{
|
|
|
|
clearState.color.red = red;
|
|
|
|
clearState.color.green = green;
|
|
|
|
clearState.color.blue = blue;
|
|
|
|
clearState.color.alpha = alpha;
|
|
|
|
WCF.glClearColor(red, green, blue, alpha);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void color(float colorRed, float colorGreen, float colorBlue, float colorAlpha)
|
|
|
|
{
|
|
|
|
if (colorRed != colorState.red || colorGreen != colorState.green || colorBlue != colorState.blue || colorAlpha != colorState.alpha)
|
|
|
|
{
|
|
|
|
colorState.red = colorRed;
|
|
|
|
colorState.green = colorGreen;
|
|
|
|
colorState.blue = colorBlue;
|
|
|
|
colorState.alpha = colorAlpha;
|
|
|
|
WCF.glColor4f(colorRed, colorGreen, colorBlue, colorAlpha);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void resetColor()
|
|
|
|
{
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
lightState[i] = new GlState.BooleanState(16384 + i);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int j = 0; j < 8; ++j)
|
|
|
|
{
|
|
|
|
textureState[j] = new GlState.TextureState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static class AlphaState
|
|
|
|
{
|
|
|
|
public GlState.BooleanState alphaTest;
|
|
|
|
public int func;
|
|
|
|
public float ref;
|
|
|
|
|
|
|
|
private AlphaState()
|
|
|
|
{
|
|
|
|
this.alphaTest = new GlState.BooleanState(3008);
|
|
|
|
this.func = 519;
|
|
|
|
this.ref = -1.0F;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static class BlendState
|
|
|
|
{
|
|
|
|
public GlState.BooleanState blend;
|
|
|
|
public int srcFactor;
|
|
|
|
public int dstFactor;
|
|
|
|
public int srcFactorAlpha;
|
|
|
|
public int dstFactorAlpha;
|
|
|
|
|
|
|
|
private BlendState()
|
|
|
|
{
|
|
|
|
this.blend = new GlState.BooleanState(3042);
|
|
|
|
this.srcFactor = 1;
|
|
|
|
this.dstFactor = 0;
|
|
|
|
this.srcFactorAlpha = 1;
|
|
|
|
this.dstFactorAlpha = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static class BooleanState
|
|
|
|
{
|
|
|
|
private final int capability;
|
|
|
|
private boolean currentState = false;
|
|
|
|
|
|
|
|
public BooleanState(int capabilityIn)
|
|
|
|
{
|
|
|
|
this.capability = capabilityIn;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDisabled()
|
|
|
|
{
|
|
|
|
this.setState(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setEnabled()
|
|
|
|
{
|
|
|
|
this.setState(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setState(boolean state)
|
|
|
|
{
|
|
|
|
if (state != this.currentState)
|
|
|
|
{
|
|
|
|
this.currentState = state;
|
|
|
|
|
|
|
|
if (state)
|
|
|
|
{
|
|
|
|
WCF.glEnable(this.capability);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WCF.glDisable(this.capability);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
public float green = 1.0F;
|
|
|
|
public float blue = 1.0F;
|
|
|
|
public float alpha = 1.0F;
|
|
|
|
|
|
|
|
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
|
|
|
|
{
|
|
|
|
public boolean red;
|
|
|
|
public boolean green;
|
|
|
|
public boolean blue;
|
|
|
|
public boolean alpha;
|
|
|
|
|
|
|
|
private ColorMask()
|
|
|
|
{
|
|
|
|
this.red = true;
|
|
|
|
this.green = true;
|
|
|
|
this.blue = true;
|
|
|
|
this.alpha = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static class ColorMaterialState
|
|
|
|
{
|
|
|
|
public GlState.BooleanState colorMaterial;
|
|
|
|
public int face;
|
|
|
|
public int mode;
|
|
|
|
|
|
|
|
private ColorMaterialState()
|
|
|
|
{
|
|
|
|
this.colorMaterial = new GlState.BooleanState(WCF.GL_COLOR_MATERIAL);
|
|
|
|
this.face = WCF.GL_FRONT_AND_BACK;
|
|
|
|
this.mode = WCF.GL_AMBIENT_AND_DIFFUSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static class CullState
|
|
|
|
{
|
|
|
|
public GlState.BooleanState cullFace;
|
|
|
|
public int mode;
|
|
|
|
|
|
|
|
private CullState()
|
|
|
|
{
|
|
|
|
this.cullFace = new GlState.BooleanState(2884);
|
|
|
|
this.mode = 1029;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static class DepthState
|
|
|
|
{
|
|
|
|
public GlState.BooleanState depthTest;
|
|
|
|
public boolean maskEnabled;
|
|
|
|
public int depthFunc;
|
|
|
|
|
|
|
|
private DepthState()
|
|
|
|
{
|
|
|
|
this.depthTest = new GlState.BooleanState(2929);
|
|
|
|
this.maskEnabled = true;
|
|
|
|
this.depthFunc = 513;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static class FogState
|
|
|
|
{
|
|
|
|
public GlState.BooleanState fog;
|
|
|
|
public boolean enabled;
|
|
|
|
public int mode;
|
|
|
|
public float density;
|
|
|
|
public float start;
|
|
|
|
public float end;
|
|
|
|
|
|
|
|
private FogState()
|
|
|
|
{
|
|
|
|
this.fog = new GlState.BooleanState(WCF.GL_FOG);
|
|
|
|
this.enabled = true;
|
|
|
|
this.mode = WCF.GL_EXP;
|
|
|
|
this.density = 1.0F;
|
|
|
|
this.start = 0.0F;
|
|
|
|
this.end = 1.0F;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static class PolygonOffsetState
|
|
|
|
{
|
|
|
|
public GlState.BooleanState polygonOffsetFill;
|
|
|
|
public GlState.BooleanState polygonOffsetLine;
|
|
|
|
public float factor;
|
|
|
|
public float units;
|
|
|
|
|
|
|
|
private PolygonOffsetState()
|
|
|
|
{
|
|
|
|
this.polygonOffsetFill = new GlState.BooleanState(32823);
|
|
|
|
this.polygonOffsetLine = new GlState.BooleanState(10754);
|
|
|
|
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;
|
|
|
|
public int textureName;
|
|
|
|
|
|
|
|
private TextureState()
|
|
|
|
{
|
|
|
|
this.texture2DState = new GlState.BooleanState(3553);
|
|
|
|
this.textureName = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|