| 1 | package net.minecraft.client.renderer;
|
| 2 |
|
| 3 | import java.nio.FloatBuffer;
|
| 4 | import org.lwjgl.opengl.GL11;
|
| 5 |
|
| 6 | public class GlStateManager
|
| 7 | {
|
| 8 | private static GlStateManager.AlphaState alphaState = new GlStateManager.AlphaState();
|
| 9 | private static GlStateManager.BooleanState lightingState = new GlStateManager.BooleanState(2896);
|
| 10 | private static GlStateManager.BooleanState[] lightState = new GlStateManager.BooleanState[8];
|
| 11 | private static GlStateManager.ColorMaterialState colorMaterialState = new GlStateManager.ColorMaterialState();
|
| 12 | private static GlStateManager.BlendState blendState = new GlStateManager.BlendState();
|
| 13 | private static GlStateManager.DepthState depthState = new GlStateManager.DepthState();
|
| 14 | private static GlStateManager.FogState fogState = new GlStateManager.FogState();
|
| 15 | private static GlStateManager.CullState cullState = new GlStateManager.CullState();
|
| 16 | private static GlStateManager.PolygonOffsetState polygonOffsetState = new GlStateManager.PolygonOffsetState();
|
| 17 | private static GlStateManager.ColorLogicState colorLogicState = new GlStateManager.ColorLogicState();
|
| 18 | private static GlStateManager.TexGenState texGenState = new GlStateManager.TexGenState();
|
| 19 | private static GlStateManager.ClearState clearState = new GlStateManager.ClearState();
|
| 20 | private static GlStateManager.StencilState stencilState = new GlStateManager.StencilState();
|
| 21 | private static GlStateManager.BooleanState normalizeState = new GlStateManager.BooleanState(2977);
|
| 22 | private static int activeTextureUnit = 0;
|
| 23 | private static GlStateManager.TextureState[] textureState = new GlStateManager.TextureState[8];
|
| 24 | private static int activeShadeModel = 7425;
|
| 25 | private static GlStateManager.BooleanState rescaleNormalState = new GlStateManager.BooleanState(32826);
|
| 26 | private static GlStateManager.ColorMask colorMaskState = new GlStateManager.ColorMask();
|
| 27 | private static GlStateManager.Color colorState = new GlStateManager.Color();
|
| 28 |
|
| 29 | public static void pushAttrib()
|
| 30 | {
|
| 31 | GL11.glPushAttrib(8256);
|
| 32 | }
|
| 33 |
|
| 34 | public static void popAttrib()
|
| 35 | {
|
| 36 | GL11.glPopAttrib();
|
| 37 | }
|
| 38 |
|
| 39 | public static void disableAlpha()
|
| 40 | {
|
| 41 | alphaState.alphaTest.setDisabled();
|
| 42 | }
|
| 43 |
|
| 44 | public static void enableAlpha()
|
| 45 | {
|
| 46 | alphaState.alphaTest.setEnabled();
|
| 47 | }
|
| 48 |
|
| 49 | public static void alphaFunc(int func, float ref)
|
| 50 | {
|
| 51 | if (func != alphaState.func || ref != alphaState.ref)
|
| 52 | {
|
| 53 | alphaState.func = func;
|
| 54 | alphaState.ref = ref;
|
| 55 | GL11.glAlphaFunc(func, ref);
|
| 56 | }
|
| 57 | }
|
| 58 |
|
| 59 | public static void enableLighting()
|
| 60 | {
|
| 61 | lightingState.setEnabled();
|
| 62 | }
|
| 63 |
|
| 64 | public static void disableLighting()
|
| 65 | {
|
| 66 | lightingState.setDisabled();
|
| 67 | }
|
| 68 |
|
| 69 | public static void enableLight(int light)
|
| 70 | {
|
| 71 | lightState[light].setEnabled();
|
| 72 | }
|
| 73 |
|
| 74 | public static void disableLight(int light)
|
| 75 | {
|
| 76 | lightState[light].setDisabled();
|
| 77 | }
|
| 78 |
|
| 79 | public static void enableColorMaterial()
|
| 80 | {
|
| 81 | colorMaterialState.colorMaterial.setEnabled();
|
| 82 | }
|
| 83 |
|
| 84 | public static void disableColorMaterial()
|
| 85 | {
|
| 86 | colorMaterialState.colorMaterial.setDisabled();
|
| 87 | }
|
| 88 |
|
| 89 | public static void colorMaterial(int face, int mode)
|
| 90 | {
|
| 91 | if (face != colorMaterialState.face || mode != colorMaterialState.mode)
|
| 92 | {
|
| 93 | colorMaterialState.face = face;
|
| 94 | colorMaterialState.mode = mode;
|
| 95 | GL11.glColorMaterial(face, mode);
|
| 96 | }
|
| 97 | }
|
| 98 |
|
| 99 | public static void disableDepth()
|
| 100 | {
|
| 101 | depthState.depthTest.setDisabled();
|
| 102 | }
|
| 103 |
|
| 104 | public static void enableDepth()
|
| 105 | {
|
| 106 | depthState.depthTest.setEnabled();
|
| 107 | }
|
| 108 |
|
| 109 | public static void depthFunc(int depthFunc)
|
| 110 | {
|
| 111 | if (depthFunc != depthState.depthFunc)
|
| 112 | {
|
| 113 | depthState.depthFunc = depthFunc;
|
| 114 | GL11.glDepthFunc(depthFunc);
|
| 115 | }
|
| 116 | }
|
| 117 |
|
| 118 | public static void depthMask(boolean flagIn)
|
| 119 | {
|
| 120 | if (flagIn != depthState.maskEnabled)
|
| 121 | {
|
| 122 | depthState.maskEnabled = flagIn;
|
| 123 | GL11.glDepthMask(flagIn);
|
| 124 | }
|
| 125 | }
|
| 126 |
|
| 127 | public static void disableBlend()
|
| 128 | {
|
| 129 | blendState.blend.setDisabled();
|
| 130 | }
|
| 131 |
|
| 132 | public static void enableBlend()
|
| 133 | {
|
| 134 | blendState.blend.setEnabled();
|
| 135 | }
|
| 136 |
|
| 137 | public static void blendFunc(int srcFactor, int dstFactor)
|
| 138 | {
|
| 139 | if (srcFactor != blendState.srcFactor || dstFactor != blendState.dstFactor)
|
| 140 | {
|
| 141 | blendState.srcFactor = srcFactor;
|
| 142 | blendState.dstFactor = dstFactor;
|
| 143 | GL11.glBlendFunc(srcFactor, dstFactor);
|
| 144 | }
|
| 145 | }
|
| 146 |
|
| 147 | public static void tryBlendFuncSeparate(int srcFactor, int dstFactor, int srcFactorAlpha, int dstFactorAlpha)
|
| 148 | {
|
| 149 | if (srcFactor != blendState.srcFactor || dstFactor != blendState.dstFactor || srcFactorAlpha != blendState.srcFactorAlpha || dstFactorAlpha != blendState.dstFactorAlpha)
|
| 150 | {
|
| 151 | blendState.srcFactor = srcFactor;
|
| 152 | blendState.dstFactor = dstFactor;
|
| 153 | blendState.srcFactorAlpha = srcFactorAlpha;
|
| 154 | blendState.dstFactorAlpha = dstFactorAlpha;
|
| 155 | OpenGlHelper.glBlendFunc(srcFactor, dstFactor, srcFactorAlpha, dstFactorAlpha);
|
| 156 | }
|
| 157 | }
|
| 158 |
|
| 159 | public static void enableFog()
|
| 160 | {
|
| 161 | fogState.fog.setEnabled();
|
| 162 | }
|
| 163 |
|
| 164 | public static void disableFog()
|
| 165 | {
|
| 166 | fogState.fog.setDisabled();
|
| 167 | }
|
| 168 |
|
| 169 | public static void setFog(int param)
|
| 170 | {
|
| 171 | if (param != fogState.mode)
|
| 172 | {
|
| 173 | fogState.mode = param;
|
| 174 | GL11.glFogi(GL11.GL_FOG_MODE, param);
|
| 175 | }
|
| 176 | }
|
| 177 |
|
| 178 | public static void setFogDensity(float param)
|
| 179 | {
|
| 180 | if (param != fogState.density)
|
| 181 | {
|
| 182 | fogState.density = param;
|
| 183 | GL11.glFogf(GL11.GL_FOG_DENSITY, param);
|
| 184 | }
|
| 185 | }
|
| 186 |
|
| 187 | public static void setFogStart(float param)
|
| 188 | {
|
| 189 | if (param != fogState.start)
|
| 190 | {
|
| 191 | fogState.start = param;
|
| 192 | GL11.glFogf(GL11.GL_FOG_START, param);
|
| 193 | }
|
| 194 | }
|
| 195 |
|
| 196 | public static void setFogEnd(float param)
|
| 197 | {
|
| 198 | if (param != fogState.end)
|
| 199 | {
|
| 200 | fogState.end = param;
|
| 201 | GL11.glFogf(GL11.GL_FOG_END, param);
|
| 202 | }
|
| 203 | }
|
| 204 |
|
| 205 | public static void enableCull()
|
| 206 | {
|
| 207 | cullState.cullFace.setEnabled();
|
| 208 | }
|
| 209 |
|
| 210 | public static void disableCull()
|
| 211 | {
|
| 212 | cullState.cullFace.setDisabled();
|
| 213 | }
|
| 214 |
|
| 215 | public static void cullFace(int mode)
|
| 216 | {
|
| 217 | if (mode != cullState.mode)
|
| 218 | {
|
| 219 | cullState.mode = mode;
|
| 220 | GL11.glCullFace(mode);
|
| 221 | }
|
| 222 | }
|
| 223 |
|
| 224 | public static void enablePolygonOffset()
|
| 225 | {
|
| 226 | polygonOffsetState.polygonOffsetFill.setEnabled();
|
| 227 | }
|
| 228 |
|
| 229 | public static void disablePolygonOffset()
|
| 230 | {
|
| 231 | polygonOffsetState.polygonOffsetFill.setDisabled();
|
| 232 | }
|
| 233 |
|
| 234 | public static void doPolygonOffset(float factor, float units)
|
| 235 | {
|
| 236 | if (factor != polygonOffsetState.factor || units != polygonOffsetState.units)
|
| 237 | {
|
| 238 | polygonOffsetState.factor = factor;
|
| 239 | polygonOffsetState.units = units;
|
| 240 | GL11.glPolygonOffset(factor, units);
|
| 241 | }
|
| 242 | }
|
| 243 |
|
| 244 | public static void enableColorLogic()
|
| 245 | {
|
| 246 | colorLogicState.colorLogicOp.setEnabled();
|
| 247 | }
|
| 248 |
|
| 249 | public static void disableColorLogic()
|
| 250 | {
|
| 251 | colorLogicState.colorLogicOp.setDisabled();
|
| 252 | }
|
| 253 |
|
| 254 | public static void colorLogicOp(int opcode)
|
| 255 | {
|
| 256 | if (opcode != colorLogicState.opcode)
|
| 257 | {
|
| 258 | colorLogicState.opcode = opcode;
|
| 259 | GL11.glLogicOp(opcode);
|
| 260 | }
|
| 261 | }
|
| 262 |
|
| 263 | public static void enableTexGenCoord(GlStateManager.TexGen p_179087_0_)
|
| 264 | {
|
| 265 | texGenCoord(p_179087_0_).textureGen.setEnabled();
|
| 266 | }
|
| 267 |
|
| 268 | public static void disableTexGenCoord(GlStateManager.TexGen p_179100_0_)
|
| 269 | {
|
| 270 | texGenCoord(p_179100_0_).textureGen.setDisabled();
|
| 271 | }
|
| 272 |
|
| 273 | public static void texGen(GlStateManager.TexGen texGen, int param)
|
| 274 | {
|
| 275 | GlStateManager.TexGenCoord glstatemanager$texgencoord = texGenCoord(texGen);
|
| 276 |
|
| 277 | if (param != glstatemanager$texgencoord.param)
|
| 278 | {
|
| 279 | glstatemanager$texgencoord.param = param;
|
| 280 | GL11.glTexGeni(glstatemanager$texgencoord.coord, GL11.GL_TEXTURE_GEN_MODE, param);
|
| 281 | }
|
| 282 | }
|
| 283 |
|
| 284 | public static void texGen(GlStateManager.TexGen p_179105_0_, int pname, FloatBuffer params)
|
| 285 | {
|
| 286 | GL11.glTexGen(texGenCoord(p_179105_0_).coord, pname, params);
|
| 287 | }
|
| 288 |
|
| 289 | private static GlStateManager.TexGenCoord texGenCoord(GlStateManager.TexGen p_179125_0_)
|
| 290 | {
|
| 291 | switch (p_179125_0_)
|
| 292 | {
|
| 293 | case S:
|
| 294 | return texGenState.s;
|
| 295 |
|
| 296 | case T:
|
| 297 | return texGenState.t;
|
| 298 |
|
| 299 | case R:
|
| 300 | return texGenState.r;
|
| 301 |
|
| 302 | case Q:
|
| 303 | return texGenState.q;
|
| 304 |
|
| 305 | default:
|
| 306 | return texGenState.s;
|
| 307 | }
|
| 308 | }
|
| 309 |
|
| 310 | public static void setActiveTexture(int texture)
|
| 311 | {
|
| 312 | if (activeTextureUnit != texture - OpenGlHelper.defaultTexUnit)
|
| 313 | {
|
| 314 | activeTextureUnit = texture - OpenGlHelper.defaultTexUnit;
|
| 315 | OpenGlHelper.setActiveTexture(texture);
|
| 316 | }
|
| 317 | }
|
| 318 |
|
| 319 | public static void enableTexture2D()
|
| 320 | {
|
| 321 | textureState[activeTextureUnit].texture2DState.setEnabled();
|
| 322 | }
|
| 323 |
|
| 324 | public static void disableTexture2D()
|
| 325 | {
|
| 326 | textureState[activeTextureUnit].texture2DState.setDisabled();
|
| 327 | }
|
| 328 |
|
| 329 | public static int generateTexture()
|
| 330 | {
|
| 331 | return GL11.glGenTextures();
|
| 332 | }
|
| 333 |
|
| 334 | public static void deleteTexture(int texture)
|
| 335 | {
|
| 336 | GL11.glDeleteTextures(texture);
|
| 337 |
|
| 338 | for (GlStateManager.TextureState glstatemanager$texturestate : textureState)
|
| 339 | {
|
| 340 | if (glstatemanager$texturestate.textureName == texture)
|
| 341 | {
|
| 342 | glstatemanager$texturestate.textureName = -1;
|
| 343 | }
|
| 344 | }
|
| 345 | }
|
| 346 |
|
| 347 | public static void bindTexture(int texture)
|
| 348 | {
|
| 349 | if (texture != textureState[activeTextureUnit].textureName)
|
| 350 | {
|
| 351 | textureState[activeTextureUnit].textureName = texture;
|
| 352 | GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture);
|
| 353 | }
|
| 354 | }
|
| 355 |
|
| 356 | public static void enableNormalize()
|
| 357 | {
|
| 358 | normalizeState.setEnabled();
|
| 359 | }
|
| 360 |
|
| 361 | public static void disableNormalize()
|
| 362 | {
|
| 363 | normalizeState.setDisabled();
|
| 364 | }
|
| 365 |
|
| 366 | public static void shadeModel(int mode)
|
| 367 | {
|
| 368 | if (mode != activeShadeModel)
|
| 369 | {
|
| 370 | activeShadeModel = mode;
|
| 371 | GL11.glShadeModel(mode);
|
| 372 | }
|
| 373 | }
|
| 374 |
|
| 375 | public static void enableRescaleNormal()
|
| 376 | {
|
| 377 | rescaleNormalState.setEnabled();
|
| 378 | }
|
| 379 |
|
| 380 | public static void disableRescaleNormal()
|
| 381 | {
|
| 382 | rescaleNormalState.setDisabled();
|
| 383 | }
|
| 384 |
|
| 385 | public static void viewport(int x, int y, int width, int height)
|
| 386 | {
|
| 387 | GL11.glViewport(x, y, width, height);
|
| 388 | }
|
| 389 |
|
| 390 | public static void colorMask(boolean red, boolean green, boolean blue, boolean alpha)
|
| 391 | {
|
| 392 | if (red != colorMaskState.red || green != colorMaskState.green || blue != colorMaskState.blue || alpha != colorMaskState.alpha)
|
| 393 | {
|
| 394 | colorMaskState.red = red;
|
| 395 | colorMaskState.green = green;
|
| 396 | colorMaskState.blue = blue;
|
| 397 | colorMaskState.alpha = alpha;
|
| 398 | GL11.glColorMask(red, green, blue, alpha);
|
| 399 | }
|
| 400 | }
|
| 401 |
|
| 402 | public static void clearDepth(double depth)
|
| 403 | {
|
| 404 | if (depth != clearState.depth)
|
| 405 | {
|
| 406 | clearState.depth = depth;
|
| 407 | GL11.glClearDepth(depth);
|
| 408 | }
|
| 409 | }
|
| 410 |
|
| 411 | public static void clearColor(float red, float green, float blue, float alpha)
|
| 412 | {
|
| 413 | if (red != clearState.color.red || green != clearState.color.green || blue != clearState.color.blue || alpha != clearState.color.alpha)
|
| 414 | {
|
| 415 | clearState.color.red = red;
|
| 416 | clearState.color.green = green;
|
| 417 | clearState.color.blue = blue;
|
| 418 | clearState.color.alpha = alpha;
|
| 419 | GL11.glClearColor(red, green, blue, alpha);
|
| 420 | }
|
| 421 | }
|
| 422 |
|
| 423 | public static void clear(int mask)
|
| 424 | {
|
| 425 | GL11.glClear(mask);
|
| 426 | }
|
| 427 |
|
| 428 | public static void matrixMode(int mode)
|
| 429 | {
|
| 430 | GL11.glMatrixMode(mode);
|
| 431 | }
|
| 432 |
|
| 433 | public static void loadIdentity()
|
| 434 | {
|
| 435 | GL11.glLoadIdentity();
|
| 436 | }
|
| 437 |
|
| 438 | public static void pushMatrix()
|
| 439 | {
|
| 440 | GL11.glPushMatrix();
|
| 441 | }
|
| 442 |
|
| 443 | public static void popMatrix()
|
| 444 | {
|
| 445 | GL11.glPopMatrix();
|
| 446 | }
|
| 447 |
|
| 448 | public static void getFloat(int pname, FloatBuffer params)
|
| 449 | {
|
| 450 | GL11.glGetFloat(pname, params);
|
| 451 | }
|
| 452 |
|
| 453 | public static void ortho(double left, double right, double bottom, double top, double zNear, double zFar)
|
| 454 | {
|
| 455 | GL11.glOrtho(left, right, bottom, top, zNear, zFar);
|
| 456 | }
|
| 457 |
|
| 458 | public static void rotate(float angle, float x, float y, float z)
|
| 459 | {
|
| 460 | GL11.glRotatef(angle, x, y, z);
|
| 461 | }
|
| 462 |
|
| 463 | public static void scale(float x, float y, float z)
|
| 464 | {
|
| 465 | GL11.glScalef(x, y, z);
|
| 466 | }
|
| 467 |
|
| 468 | public static void scale(double x, double y, double z)
|
| 469 | {
|
| 470 | GL11.glScaled(x, y, z);
|
| 471 | }
|
| 472 |
|
| 473 | public static void translate(float x, float y, float z)
|
| 474 | {
|
| 475 | GL11.glTranslatef(x, y, z);
|
| 476 | }
|
| 477 |
|
| 478 | public static void translate(double x, double y, double z)
|
| 479 | {
|
| 480 | GL11.glTranslated(x, y, z);
|
| 481 | }
|
| 482 |
|
| 483 | public static void multMatrix(FloatBuffer matrix)
|
| 484 | {
|
| 485 | GL11.glMultMatrix(matrix);
|
| 486 | }
|
| 487 |
|
| 488 | public static void color(float colorRed, float colorGreen, float colorBlue, float colorAlpha)
|
| 489 | {
|
| 490 | if (colorRed != colorState.red || colorGreen != colorState.green || colorBlue != colorState.blue || colorAlpha != colorState.alpha)
|
| 491 | {
|
| 492 | colorState.red = colorRed;
|
| 493 | colorState.green = colorGreen;
|
| 494 | colorState.blue = colorBlue;
|
| 495 | colorState.alpha = colorAlpha;
|
| 496 | GL11.glColor4f(colorRed, colorGreen, colorBlue, colorAlpha);
|
| 497 | }
|
| 498 | }
|
| 499 |
|
| 500 | public static void color(float colorRed, float colorGreen, float colorBlue)
|
| 501 | {
|
| 502 | color(colorRed, colorGreen, colorBlue, 1.0F);
|
| 503 | }
|
| 504 |
|
| 505 | public static void resetColor()
|
| 506 | {
|
| 507 | colorState.red = colorState.green = colorState.blue = colorState.alpha = -1.0F;
|
| 508 | }
|
| 509 |
|
| 510 | public static void callList(int list)
|
| 511 | {
|
| 512 | GL11.glCallList(list);
|
| 513 | }
|
| 514 |
|
| 515 | static
|
| 516 | {
|
| 517 | for (int i = 0; i < 8; ++i)
|
| 518 | {
|
| 519 | lightState[i] = new GlStateManager.BooleanState(16384 + i);
|
| 520 | }
|
| 521 |
|
| 522 | for (int j = 0; j < 8; ++j)
|
| 523 | {
|
| 524 | textureState[j] = new GlStateManager.TextureState();
|
| 525 | }
|
| 526 | }
|
| 527 |
|
| 528 | static class AlphaState
|
| 529 | {
|
| 530 | public GlStateManager.BooleanState alphaTest;
|
| 531 | public int func;
|
| 532 | public float ref;
|
| 533 |
|
| 534 | private AlphaState()
|
| 535 | {
|
| 536 | this.alphaTest = new GlStateManager.BooleanState(3008);
|
| 537 | this.func = 519;
|
| 538 | this.ref = -1.0F;
|
| 539 | }
|
| 540 | }
|
| 541 |
|
| 542 | static class BlendState
|
| 543 | {
|
| 544 | public GlStateManager.BooleanState blend;
|
| 545 | public int srcFactor;
|
| 546 | public int dstFactor;
|
| 547 | public int srcFactorAlpha;
|
| 548 | public int dstFactorAlpha;
|
| 549 |
|
| 550 | private BlendState()
|
| 551 | {
|
| 552 | this.blend = new GlStateManager.BooleanState(3042);
|
| 553 | this.srcFactor = 1;
|
| 554 | this.dstFactor = 0;
|
| 555 | this.srcFactorAlpha = 1;
|
| 556 | this.dstFactorAlpha = 0;
|
| 557 | }
|
| 558 | }
|
| 559 |
|
| 560 | static class BooleanState
|
| 561 | {
|
| 562 | private final int capability;
|
| 563 | private boolean currentState = false;
|
| 564 |
|
| 565 | public BooleanState(int capabilityIn)
|
| 566 | {
|
| 567 | this.capability = capabilityIn;
|
| 568 | }
|
| 569 |
|
| 570 | public void setDisabled()
|
| 571 | {
|
| 572 | this.setState(false);
|
| 573 | }
|
| 574 |
|
| 575 | public void setEnabled()
|
| 576 | {
|
| 577 | this.setState(true);
|
| 578 | }
|
| 579 |
|
| 580 | public void setState(boolean state)
|
| 581 | {
|
| 582 | if (state != this.currentState)
|
| 583 | {
|
| 584 | this.currentState = state;
|
| 585 |
|
| 586 | if (state)
|
| 587 | {
|
| 588 | GL11.glEnable(this.capability);
|
| 589 | }
|
| 590 | else
|
| 591 | {
|
| 592 | GL11.glDisable(this.capability);
|
| 593 | }
|
| 594 | }
|
| 595 | }
|
| 596 | }
|
| 597 |
|
| 598 | static class ClearState
|
| 599 | {
|
| 600 | public double depth;
|
| 601 | public GlStateManager.Color color;
|
| 602 | public int field_179204_c;
|
| 603 |
|
| 604 | private ClearState()
|
| 605 | {
|
| 606 | this.depth = 1.0D;
|
| 607 | this.color = new GlStateManager.Color(0.0F, 0.0F, 0.0F, 0.0F);
|
| 608 | this.field_179204_c = 0;
|
| 609 | }
|
| 610 | }
|
| 611 |
|
| 612 | static class Color
|
| 613 | {
|
| 614 | public float red = 1.0F;
|
| 615 | public float green = 1.0F;
|
| 616 | public float blue = 1.0F;
|
| 617 | public float alpha = 1.0F;
|
| 618 |
|
| 619 | public Color()
|
| 620 | {
|
| 621 | }
|
| 622 |
|
| 623 | public Color(float redIn, float greenIn, float blueIn, float alphaIn)
|
| 624 | {
|
| 625 | this.red = redIn;
|
| 626 | this.green = greenIn;
|
| 627 | this.blue = blueIn;
|
| 628 | this.alpha = alphaIn;
|
| 629 | }
|
| 630 | }
|
| 631 |
|
| 632 | static class ColorLogicState
|
| 633 | {
|
| 634 | public GlStateManager.BooleanState colorLogicOp;
|
| 635 | public int opcode;
|
| 636 |
|
| 637 | private ColorLogicState()
|
| 638 | {
|
| 639 | this.colorLogicOp = new GlStateManager.BooleanState(3058);
|
| 640 | this.opcode = 5379;
|
| 641 | }
|
| 642 | }
|
| 643 |
|
| 644 | static class ColorMask
|
| 645 | {
|
| 646 | public boolean red;
|
| 647 | public boolean green;
|
| 648 | public boolean blue;
|
| 649 | public boolean alpha;
|
| 650 |
|
| 651 | private ColorMask()
|
| 652 | {
|
| 653 | this.red = true;
|
| 654 | this.green = true;
|
| 655 | this.blue = true;
|
| 656 | this.alpha = true;
|
| 657 | }
|
| 658 | }
|
| 659 |
|
| 660 | static class ColorMaterialState
|
| 661 | {
|
| 662 | public GlStateManager.BooleanState colorMaterial;
|
| 663 | public int face;
|
| 664 | public int mode;
|
| 665 |
|
| 666 | private ColorMaterialState()
|
| 667 | {
|
| 668 | this.colorMaterial = new GlStateManager.BooleanState(2903);
|
| 669 | this.face = 1032;
|
| 670 | this.mode = 5634;
|
| 671 | }
|
| 672 | }
|
| 673 |
|
| 674 | static class CullState
|
| 675 | {
|
| 676 | public GlStateManager.BooleanState cullFace;
|
| 677 | public int mode;
|
| 678 |
|
| 679 | private CullState()
|
| 680 | {
|
| 681 | this.cullFace = new GlStateManager.BooleanState(2884);
|
| 682 | this.mode = 1029;
|
| 683 | }
|
| 684 | }
|
| 685 |
|
| 686 | static class DepthState
|
| 687 | {
|
| 688 | public GlStateManager.BooleanState depthTest;
|
| 689 | public boolean maskEnabled;
|
| 690 | public int depthFunc;
|
| 691 |
|
| 692 | private DepthState()
|
| 693 | {
|
| 694 | this.depthTest = new GlStateManager.BooleanState(2929);
|
| 695 | this.maskEnabled = true;
|
| 696 | this.depthFunc = 513;
|
| 697 | }
|
| 698 | }
|
| 699 |
|
| 700 | static class FogState
|
| 701 | {
|
| 702 | public GlStateManager.BooleanState fog;
|
| 703 | public int mode;
|
| 704 | public float density;
|
| 705 | public float start;
|
| 706 | public float end;
|
| 707 |
|
| 708 | private FogState()
|
| 709 | {
|
| 710 | this.fog = new GlStateManager.BooleanState(2912);
|
| 711 | this.mode = 2048;
|
| 712 | this.density = 1.0F;
|
| 713 | this.start = 0.0F;
|
| 714 | this.end = 1.0F;
|
| 715 | }
|
| 716 | }
|
| 717 |
|
| 718 | static class PolygonOffsetState
|
| 719 | {
|
| 720 | public GlStateManager.BooleanState polygonOffsetFill;
|
| 721 | public GlStateManager.BooleanState polygonOffsetLine;
|
| 722 | public float factor;
|
| 723 | public float units;
|
| 724 |
|
| 725 | private PolygonOffsetState()
|
| 726 | {
|
| 727 | this.polygonOffsetFill = new GlStateManager.BooleanState(32823);
|
| 728 | this.polygonOffsetLine = new GlStateManager.BooleanState(10754);
|
| 729 | this.factor = 0.0F;
|
| 730 | this.units = 0.0F;
|
| 731 | }
|
| 732 | }
|
| 733 |
|
| 734 | static class StencilFunc
|
| 735 | {
|
| 736 | public int field_179081_a;
|
| 737 | public int field_179079_b;
|
| 738 | public int field_179080_c;
|
| 739 |
|
| 740 | private StencilFunc()
|
| 741 | {
|
| 742 | this.field_179081_a = 519;
|
| 743 | this.field_179079_b = 0;
|
| 744 | this.field_179080_c = -1;
|
| 745 | }
|
| 746 | }
|
| 747 |
|
| 748 | static class StencilState
|
| 749 | {
|
| 750 | public GlStateManager.StencilFunc field_179078_a;
|
| 751 | public int field_179076_b;
|
| 752 | public int field_179077_c;
|
| 753 | public int field_179074_d;
|
| 754 | public int field_179075_e;
|
| 755 |
|
| 756 | private StencilState()
|
| 757 | {
|
| 758 | this.field_179078_a = new GlStateManager.StencilFunc();
|
| 759 | this.field_179076_b = -1;
|
| 760 | this.field_179077_c = 7680;
|
| 761 | this.field_179074_d = 7680;
|
| 762 | this.field_179075_e = 7680;
|
| 763 | }
|
| 764 | }
|
| 765 |
|
| 766 | public static enum TexGen
|
| 767 | {
|
| 768 | S,
|
| 769 | T,
|
| 770 | R,
|
| 771 | Q;
|
| 772 | }
|
| 773 |
|
| 774 | static class TexGenCoord
|
| 775 | {
|
| 776 | public GlStateManager.BooleanState textureGen;
|
| 777 | public int coord;
|
| 778 | public int param = -1;
|
| 779 |
|
| 780 | public TexGenCoord(int p_i46254_1_, int p_i46254_2_)
|
| 781 | {
|
| 782 | this.coord = p_i46254_1_;
|
| 783 | this.textureGen = new GlStateManager.BooleanState(p_i46254_2_);
|
| 784 | }
|
| 785 | }
|
| 786 |
|
| 787 | static class TexGenState
|
| 788 | {
|
| 789 | public GlStateManager.TexGenCoord s;
|
| 790 | public GlStateManager.TexGenCoord t;
|
| 791 | public GlStateManager.TexGenCoord r;
|
| 792 | public GlStateManager.TexGenCoord q;
|
| 793 |
|
| 794 | private TexGenState()
|
| 795 | {
|
| 796 | this.s = new GlStateManager.TexGenCoord(8192, 3168);
|
| 797 | this.t = new GlStateManager.TexGenCoord(8193, 3169);
|
| 798 | this.r = new GlStateManager.TexGenCoord(8194, 3170);
|
| 799 | this.q = new GlStateManager.TexGenCoord(8195, 3171);
|
| 800 | }
|
| 801 | }
|
| 802 |
|
| 803 | static class TextureState
|
| 804 | {
|
| 805 | public GlStateManager.BooleanState texture2DState;
|
| 806 | public int textureName;
|
| 807 |
|
| 808 | private TextureState()
|
| 809 | {
|
| 810 | this.texture2DState = new GlStateManager.BooleanState(3553);
|
| 811 | this.textureName = 0;
|
| 812 | }
|
| 813 | }
|
| 814 | }
|
| 815 |
|