diff --git a/src/main/java/com/projecturanus/betterp2p/client/gui/widget/IGuiTextField.java b/src/main/java/com/projecturanus/betterp2p/client/gui/widget/IGuiTextField.java index d7e64e9..a80ca6a 100644 --- a/src/main/java/com/projecturanus/betterp2p/client/gui/widget/IGuiTextField.java +++ b/src/main/java/com/projecturanus/betterp2p/client/gui/widget/IGuiTextField.java @@ -1,29 +1,36 @@ package com.projecturanus.betterp2p.client.gui.widget; import appeng.client.gui.widgets.MEGuiTextField; + import com.projecturanus.betterp2p.client.gui.InfoWrapper; public class IGuiTextField extends MEGuiTextField { + InfoWrapper info = null; - public void setVisible(boolean visible){ + + public void setVisible(boolean visible) { this.field.setVisible(visible); } - public void setFocus(boolean focus,int position){ + + public void setFocus(boolean focus, int position) { this.field.setFocused(focus); this.field.setCursorPosition(position); } - public IGuiTextField(final int width, final int height, final String tooltip){ - super(width,height,tooltip); + + public IGuiTextField(final int width, final int height, final String tooltip) { + super(width, height, tooltip); } - public IGuiTextField(final int width, final int height) - { - super(width,height,""); + + public IGuiTextField(final int width, final int height) { + super(width, height, ""); this.setVisible(false); } - public void setInfo(InfoWrapper _info){ + + public void setInfo(InfoWrapper _info) { info = _info; } - public InfoWrapper getInfo(){ + + public InfoWrapper getInfo() { return info; } diff --git a/src/main/java/com/projecturanus/betterp2p/client/render/OutlineRenderer.java b/src/main/java/com/projecturanus/betterp2p/client/render/OutlineRenderer.java index 6bc1678..bfabcfd 100644 --- a/src/main/java/com/projecturanus/betterp2p/client/render/OutlineRenderer.java +++ b/src/main/java/com/projecturanus/betterp2p/client/render/OutlineRenderer.java @@ -1,15 +1,18 @@ package com.projecturanus.betterp2p.client.render; -import com.projecturanus.betterp2p.util.GlStateManager; +import java.util.Collection; +import java.util.List; + import kotlin.Pair; + import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; -import java.util.Collection; -import java.util.List; +import com.projecturanus.betterp2p.util.GlStateManager; /** * Everything in this inner class is From a mod that has MIT license owned by romelo333 and maintained by McJty @@ -23,7 +26,8 @@ import java.util.List; */ public class OutlineRenderer { - public static void renderOutlines(RenderWorldLastEvent evt, EntityPlayer p, Collection> coordinates, int r, int g, int b) { + public static void renderOutlines(RenderWorldLastEvent evt, EntityPlayer p, Collection> coordinates, + int r, int g, int b) { double doubleX = p.lastTickPosX + (p.posX - p.lastTickPosX); double doubleY = p.lastTickPosY + (p.posY - p.lastTickPosY); double doubleZ = p.lastTickPosZ + (p.posZ - p.lastTickPosZ); @@ -45,10 +49,10 @@ public class OutlineRenderer { private static void renderOutlines(Collection> coordinates, int r, int g, int b, int thickness) { Tessellator tessellator = Tessellator.instance; - // net.minecraft.client.renderer.VertexBuffer - //BufferBuilder buffer = tessellator.getBuffer(); + // net.minecraft.client.renderer.VertexBuffer + // BufferBuilder buffer = tessellator.getBuffer(); tessellator.startDrawing(GL11.GL_LINES); - // GlStateManager.color(r / 255.0f, g / 255.0f, b / 255.0f); + // GlStateManager.color(r / 255.0f, g / 255.0f, b / 255.0f); GL11.glLineWidth(thickness); for (List coordinate : coordinates) { float x = coordinate.get(0); @@ -59,7 +63,8 @@ public class OutlineRenderer { tessellator.draw(); } - public static void renderHighLightedBlocksOutline(Tessellator tessellator, float mx, float my, float mz, int r, int g, int b, int a) { + public static void renderHighLightedBlocksOutline(Tessellator tessellator, float mx, float my, float mz, int r, + int g, int b, int a) { tessellator.setColorRGBA(r, g, b, a); tessellator.addVertex(mx, my, mz); tessellator.addVertex(mx + 1, my, mz); @@ -87,8 +92,8 @@ public class OutlineRenderer { tessellator.addVertex(mx, my + 1, mz + 1); } - - public static void renderOutlinesWithFacing(RenderWorldLastEvent evt, EntityPlayer p, Collection, ForgeDirection>> coordinates, int r, int g, int b) { + public static void renderOutlinesWithFacing(RenderWorldLastEvent evt, EntityPlayer p, + Collection, ForgeDirection>> coordinates, int r, int g, int b) { double doubleX = p.lastTickPosX + (p.posX - p.lastTickPosX); double doubleY = p.lastTickPosY + (p.posY - p.lastTickPosY); @@ -107,15 +112,15 @@ public class OutlineRenderer { GlStateManager.depthMask(true); } - private static void renderOutlinesWithFacing(Collection, ForgeDirection>> coordinates, double x, double y, double z, int r, int g, int b, int thickness) { + private static void renderOutlinesWithFacing(Collection, ForgeDirection>> coordinates, double x, + double y, double z, int r, int g, int b, int thickness) { Tessellator tessellator = Tessellator.instance; - //BufferBuilder buffer = tessellator.getBuffer(); + // BufferBuilder buffer = tessellator.getBuffer(); for (Pair, ForgeDirection> coordinate : coordinates) { List pos = coordinate.component1(); ForgeDirection facing = coordinate.component2(); - if (pos == null || facing == null || pos.size() != 3) - continue; + if (pos == null || facing == null || pos.size() != 3) continue; GlStateManager.pushMatrix(); GlStateManager.translate(x, y, z); tessellator.startDrawing(GL11.GL_LINES); @@ -148,10 +153,10 @@ public class OutlineRenderer { case WEST: break; } - int[] west_matrix = {1, 0, 0, 0, 1, 0, 0, 0, 1}; - int[] east_matrix = {-1, 0, 0, 0, 1, 0, 0, 0, 1}; - int[] north_matrix = {0, 0, -1, 0, 1, 0, 1, 0, 0}; - int[] south_matrix = {0, 0, 1, 0, 1, 0, -1, 0, 0}; + int[] west_matrix = { 1, 0, 0, 0, 1, 0, 0, 0, 1 }; + int[] east_matrix = { -1, 0, 0, 0, 1, 0, 0, 0, 1 }; + int[] north_matrix = { 0, 0, -1, 0, 1, 0, 1, 0, 0 }; + int[] south_matrix = { 0, 0, 1, 0, 1, 0, -1, 0, 0 }; GlStateManager.translate(-0.5, -0.5, -0.5); GlStateManager.translate(-pos.get(0), -pos.get(1), -pos.get(2)); @@ -161,9 +166,7 @@ public class OutlineRenderer { } - - public static void renderHighLightedBlocksOutlineForFacing(Tessellator tessellator, - int r, int g, int b, int a) { + public static void renderHighLightedBlocksOutlineForFacing(Tessellator tessellator, int r, int g, int b, int a) { double minX = 0; double minY = 0.125; double minZ = 0.125; diff --git a/src/main/java/com/projecturanus/betterp2p/client/render/RenderHandler.java b/src/main/java/com/projecturanus/betterp2p/client/render/RenderHandler.java index 465294c..72b5d35 100644 --- a/src/main/java/com/projecturanus/betterp2p/client/render/RenderHandler.java +++ b/src/main/java/com/projecturanus/betterp2p/client/render/RenderHandler.java @@ -1,19 +1,21 @@ package com.projecturanus.betterp2p.client.render; -import com.projecturanus.betterp2p.client.ClientCache; -import com.projecturanus.betterp2p.item.ItemAdvancedMemoryCard; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import java.util.ArrayList; +import java.util.List; + import kotlin.Pair; + import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.ForgeDirection; -import java.util.ArrayList; -import java.util.List; +import com.projecturanus.betterp2p.client.ClientCache; +import com.projecturanus.betterp2p.item.ItemAdvancedMemoryCard; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class RenderHandler { @@ -24,17 +26,14 @@ public class RenderHandler { if (!ClientCache.INSTANCE.getPositions().isEmpty() || ClientCache.INSTANCE.getSelectedPosition() != null) { if (ClientCache.INSTANCE.getSelectedPosition() != null) { List, ForgeDirection>> tmp = new ArrayList<>(); - tmp.add(new Pair<>(ClientCache.INSTANCE.getSelectedPosition(), ClientCache.INSTANCE.getSelectedFacing())); - OutlineRenderer.renderOutlinesWithFacing( - event, - player, - tmp, - 0x45, - 0xDA, - 0x75 - ); + tmp.add( + new Pair<>( + ClientCache.INSTANCE.getSelectedPosition(), + ClientCache.INSTANCE.getSelectedFacing())); + OutlineRenderer.renderOutlinesWithFacing(event, player, tmp, 0x45, 0xDA, 0x75); } - OutlineRenderer.renderOutlinesWithFacing(event, player, ClientCache.INSTANCE.getPositions(), 0x66, 0xCC, 0xFF); + OutlineRenderer + .renderOutlinesWithFacing(event, player, ClientCache.INSTANCE.getPositions(), 0x66, 0xCC, 0xFF); } } } diff --git a/src/main/java/com/projecturanus/betterp2p/client/render/ShadowRenderer.java b/src/main/java/com/projecturanus/betterp2p/client/render/ShadowRenderer.java index 2a1eee3..4f2e69e 100644 --- a/src/main/java/com/projecturanus/betterp2p/client/render/ShadowRenderer.java +++ b/src/main/java/com/projecturanus/betterp2p/client/render/ShadowRenderer.java @@ -1,16 +1,18 @@ package com.projecturanus.betterp2p.client.render; -import com.projecturanus.betterp2p.util.GlStateManager; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.*; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import org.lwjgl.opengl.GL11; -import java.util.ArrayList; -import java.util.List; +import com.projecturanus.betterp2p.util.GlStateManager; /** * Functions from this inner class are not authored by me (Sam Bassett aka Lothrazar) they are from BuildersGuides by @@ -19,43 +21,48 @@ import java.util.List; * * All credit goes to author for this * - * Source code: https://github.com/Ipsis/BuildersGuides Source License https://github.com/Ipsis/BuildersGuides/blob/master/COPYING.LESSER + * Source code: https://github.com/Ipsis/BuildersGuides Source License + * https://github.com/Ipsis/BuildersGuides/blob/master/COPYING.LESSER * - * I used and modified two functions from this library https://github.com/Ipsis/BuildersGuides/blob/master/src/main/java/ipsis/buildersguides/util/RenderUtils.java + * I used and modified two functions from this library + * https://github.com/Ipsis/BuildersGuides/blob/master/src/main/java/ipsis/buildersguides/util/RenderUtils.java * * */ @SuppressWarnings("serial") public class ShadowRenderer { - public static void renderBlockPos(List p, List center, double relX, double relY, double relZ, float red, float green, float blue) { + public static void renderBlockPos(List p, List center, double relX, double relY, double relZ, + float red, float green, float blue) { if (p == null) { return; } renderBlockList(new ArrayList>() { + { add(p); } }, center, relX, relY, relZ, red, green, blue); } - public static void renderBlockPhantom(World world, final List pos, ItemStack stack, final double relX, final double relY, final double relZ, - List target, boolean isSolid) { + public static void renderBlockPhantom(World world, final List pos, ItemStack stack, final double relX, + final double relY, final double relZ, List target, boolean isSolid) { if (stack.getItem() instanceof ItemBlock) { int stateFromStack = stack.getItemDamage(); renderBlockPhantom(world, pos, stateFromStack, relX, relY, relZ, target, isSolid); } } - public static void renderBlockPhantom(World world, final List pos, int state, final double relX, final double relY, final double relZ, List target, boolean isSolid) { + public static void renderBlockPhantom(World world, final List pos, int state, final double relX, + final double relY, final double relZ, List target, boolean isSolid) { int xOffset = target.get(0) - pos.get(0); int yOffset = target.get(1) - pos.get(1); int zOffset = target.get(2) - pos.get(2); - //final BlockRendererDispatcher blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher(); + // final BlockRendererDispatcher blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher(); Tessellator tessellator = Tessellator.instance; - //BufferBuilder bufferBuilder = tessellator.getBuffer(); + // BufferBuilder bufferBuilder = tessellator.getBuffer(); GlStateManager.pushMatrix(); - //this first translate is to make relative to TE and everything + // this first translate is to make relative to TE and everything GlStateManager.translate(relX + 0.5F, relY + 0.5F, relZ + 0.5F); RenderHelper.disableStandardItemLighting(); if (!isSolid) { @@ -64,18 +71,19 @@ public class ShadowRenderer { GlStateManager.disableCull(); } tessellator.startDrawing(GL11.GL_QUADS); - //move into frame and then back to zero - so world relative + // move into frame and then back to zero - so world relative tessellator.setTranslation(-0.5 - pos.get(0) + xOffset, -.5 - pos.get(1) + yOffset, -.5 - pos.get(2) + zOffset); Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture); - //TODO: pos below is the targetPos, other rel and pos are TE - //blockRenderer.getBlockModelRenderer().renderModel(world, model, state, pos, bufferBuilder, false); + // TODO: pos below is the targetPos, other rel and pos are TE + // blockRenderer.getBlockModelRenderer().renderModel(world, model, state, pos, bufferBuilder, false); tessellator.setTranslation(0.0D, 0.0D, 0.0D); tessellator.draw(); RenderHelper.enableStandardItemLighting(); GlStateManager.popMatrix(); } - public static void renderBlockList(List> blockPosList, List center, double relX, double relY, double relZ, float red, float green, float blue) { + public static void renderBlockList(List> blockPosList, List center, double relX, double relY, + double relZ, float red, float green, float blue) { GlStateManager.pushAttrib(); GlStateManager.pushMatrix(); // translate to center or te @@ -86,16 +94,14 @@ public class ShadowRenderer { GlStateManager.enableBlend(); float alpha = 0.5F; GlStateManager.color(red, green, blue, alpha); - if (Minecraft.isAmbientOcclusionEnabled()) - GlStateManager.shadeModel(GL11.GL_SMOOTH); - else - GlStateManager.shadeModel(GL11.GL_FLAT); + if (Minecraft.isAmbientOcclusionEnabled()) GlStateManager.shadeModel(GL11.GL_SMOOTH); + else GlStateManager.shadeModel(GL11.GL_FLAT); for (List p : blockPosList) { GlStateManager.pushMatrix(); GlStateManager.translate( - (center.get(0) - p.get(0)) * -1.0F, - (center.get(1) - p.get(1)) * -1.0F, - (center.get(2) - p.get(2)) * -1.0F); + (center.get(0) - p.get(0)) * -1.0F, + (center.get(1) - p.get(1)) * -1.0F, + (center.get(2) - p.get(2)) * -1.0F); shadedCube(0.4F); GlStateManager.popMatrix(); } @@ -109,7 +115,7 @@ public class ShadowRenderer { private static void shadedCube(float scale) { float size = 1.0F * scale; Tessellator tessellator = Tessellator.instance; - //BufferBuilder worldRenderer = tessellator.getBuffer(); + // BufferBuilder worldRenderer = tessellator.getBuffer(); // Front - anticlockwise vertices // Back - clockwise vertices tessellator.startDrawing(GL11.GL_QUADS); diff --git a/src/main/java/com/projecturanus/betterp2p/util/GlStateManager.java b/src/main/java/com/projecturanus/betterp2p/util/GlStateManager.java index 09193c1..8912311 100644 --- a/src/main/java/com/projecturanus/betterp2p/util/GlStateManager.java +++ b/src/main/java/com/projecturanus/betterp2p/util/GlStateManager.java @@ -1,22 +1,26 @@ package com.projecturanus.betterp2p.util; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import java.nio.ByteBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; + +import javax.annotation.Nullable; + import net.minecraft.client.renderer.OpenGlHelper; + import org.lwjgl.BufferUtils; import org.lwjgl.opengl.*; import org.lwjgl.util.vector.Quaternion; -import javax.annotation.Nullable; -import java.nio.ByteBuffer; -import java.nio.FloatBuffer; -import java.nio.IntBuffer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** * Copied from forge 1.12.2-14.23.5.2847 net.minecraft.client.renderer.GlStateManager */ @SideOnly(Side.CLIENT) public class GlStateManager { + private static final FloatBuffer BUF_FLOAT_16 = BufferUtils.createFloatBuffer(16); private static final FloatBuffer BUF_FLOAT_4 = BufferUtils.createFloatBuffer(4); private static final GlStateManager.AlphaState alphaState = new GlStateManager.AlphaState(); @@ -43,156 +47,128 @@ public class GlStateManager { /** * Do not use (see MinecraftForge issue #1637) */ - public static void pushAttrib() - { + public static void pushAttrib() { GL11.glPushAttrib(8256); } /** * Do not use (see MinecraftForge issue #1637) */ - public static void popAttrib() - { + public static void popAttrib() { GL11.glPopAttrib(); } - public static void disableAlpha() - { + public static void disableAlpha() { alphaState.alphaTest.setDisabled(); } - public static void enableAlpha() - { + public static void enableAlpha() { alphaState.alphaTest.setEnabled(); } - public static void alphaFunc(int func, float ref) - { - if (func != alphaState.func || ref != alphaState.ref) - { + public static void alphaFunc(int func, float ref) { + if (func != alphaState.func || ref != alphaState.ref) { alphaState.func = func; alphaState.ref = ref; GL11.glAlphaFunc(func, ref); } } - public static void enableLighting() - { + public static void enableLighting() { lightingState.setEnabled(); } - public static void disableLighting() - { + public static void disableLighting() { lightingState.setDisabled(); } - public static void enableLight(int light) - { + public static void enableLight(int light) { lightState[light].setEnabled(); } - public static void disableLight(int light) - { + public static void disableLight(int light) { lightState[light].setDisabled(); } - public static void enableColorMaterial() - { + public static void enableColorMaterial() { colorMaterialState.colorMaterial.setEnabled(); } - public static void disableColorMaterial() - { + public static void disableColorMaterial() { colorMaterialState.colorMaterial.setDisabled(); } - public static void colorMaterial(int face, int mode) - { - if (face != colorMaterialState.face || mode != colorMaterialState.mode) - { + public static void colorMaterial(int face, int mode) { + if (face != colorMaterialState.face || mode != colorMaterialState.mode) { colorMaterialState.face = face; colorMaterialState.mode = mode; GL11.glColorMaterial(face, mode); } } - public static void glLight(int light, int pname, FloatBuffer params) - { + public static void glLight(int light, int pname, FloatBuffer params) { GL11.glLight(light, pname, params); } - public static void glLightModel(int pname, FloatBuffer params) - { + public static void glLightModel(int pname, FloatBuffer params) { GL11.glLightModel(pname, params); } - public static void glNormal3f(float nx, float ny, float nz) - { + public static void glNormal3f(float nx, float ny, float nz) { GL11.glNormal3f(nx, ny, nz); } - public static void disableDepth() - { + public static void disableDepth() { depthState.depthTest.setDisabled(); } - public static void enableDepth() - { + public static void enableDepth() { depthState.depthTest.setEnabled(); } - public static void depthFunc(int depthFunc) - { - if (depthFunc != depthState.depthFunc) - { + public static void depthFunc(int depthFunc) { + if (depthFunc != depthState.depthFunc) { depthState.depthFunc = depthFunc; GL11.glDepthFunc(depthFunc); } } - public static void depthMask(boolean flagIn) - { - if (flagIn != depthState.maskEnabled) - { + public static void depthMask(boolean flagIn) { + if (flagIn != depthState.maskEnabled) { depthState.maskEnabled = flagIn; GL11.glDepthMask(flagIn); } } - public static void disableBlend() - { + public static void disableBlend() { blendState.blend.setDisabled(); } - public static void enableBlend() - { + public static void enableBlend() { blendState.blend.setEnabled(); } - public static void blendFunc(GlStateManager.SourceFactor srcFactor, GlStateManager.DestFactor dstFactor) - { + public static void blendFunc(GlStateManager.SourceFactor srcFactor, GlStateManager.DestFactor dstFactor) { blendFunc(srcFactor.factor, dstFactor.factor); } - public static void blendFunc(int srcFactor, int dstFactor) - { - if (srcFactor != blendState.srcFactor || dstFactor != blendState.dstFactor) - { + public static void blendFunc(int srcFactor, int dstFactor) { + if (srcFactor != blendState.srcFactor || dstFactor != blendState.dstFactor) { blendState.srcFactor = srcFactor; blendState.dstFactor = dstFactor; GL11.glBlendFunc(srcFactor, dstFactor); } } - public static void tryBlendFuncSeparate(GlStateManager.SourceFactor srcFactor, GlStateManager.DestFactor dstFactor, GlStateManager.SourceFactor srcFactorAlpha, GlStateManager.DestFactor dstFactorAlpha) - { + public static void tryBlendFuncSeparate(GlStateManager.SourceFactor srcFactor, GlStateManager.DestFactor dstFactor, + GlStateManager.SourceFactor srcFactorAlpha, GlStateManager.DestFactor dstFactorAlpha) { tryBlendFuncSeparate(srcFactor.factor, dstFactor.factor, srcFactorAlpha.factor, dstFactorAlpha.factor); } - 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) - { + 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; @@ -201,17 +177,15 @@ public class GlStateManager { } } - public static void glBlendEquation(int blendEquation) - { + public static void glBlendEquation(int blendEquation) { GL14.glBlendEquation(blendEquation); } - public static void enableOutlineMode(int color) - { - BUF_FLOAT_4.put(0, (float)(color >> 16 & 255) / 255.0F); - BUF_FLOAT_4.put(1, (float)(color >> 8 & 255) / 255.0F); - BUF_FLOAT_4.put(2, (float)(color >> 0 & 255) / 255.0F); - BUF_FLOAT_4.put(3, (float)(color >> 24 & 255) / 255.0F); + public static void enableOutlineMode(int color) { + BUF_FLOAT_4.put(0, (float) (color >> 16 & 255) / 255.0F); + BUF_FLOAT_4.put(1, (float) (color >> 8 & 255) / 255.0F); + BUF_FLOAT_4.put(2, (float) (color >> 0 & 255) / 255.0F); + BUF_FLOAT_4.put(3, (float) (color >> 24 & 255) / 255.0F); glTexEnv(8960, 8705, BUF_FLOAT_4); glTexEnvi(8960, 8704, 34160); glTexEnvi(8960, 34161, 7681); @@ -222,8 +196,7 @@ public class GlStateManager { glTexEnvi(8960, 34200, 770); } - public static void disableOutlineMode() - { + public static void disableOutlineMode() { glTexEnvi(8960, 8704, 8448); glTexEnvi(8960, 34161, 8448); glTexEnvi(8960, 34162, 8448); @@ -233,170 +206,135 @@ public class GlStateManager { glTexEnvi(8960, 34200, 770); } - public static void enableFog() - { + public static void enableFog() { fogState.fog.setEnabled(); } - public static void disableFog() - { + public static void disableFog() { fogState.fog.setDisabled(); } - public static void setFog(GlStateManager.FogMode fogMode) - { + public static void setFog(GlStateManager.FogMode fogMode) { setFog(fogMode.capabilityId); } - private static void setFog(int param) - { - if (param != fogState.mode) - { + private static void setFog(int param) { + if (param != fogState.mode) { fogState.mode = param; GL11.glFogi(GL11.GL_FOG_MODE, param); } } - public static void setFogDensity(float param) - { - if (param != fogState.density) - { + public static void setFogDensity(float param) { + if (param != fogState.density) { fogState.density = param; GL11.glFogf(GL11.GL_FOG_DENSITY, param); } } - public static void setFogStart(float param) - { - if (param != fogState.start) - { + public static void setFogStart(float param) { + if (param != fogState.start) { fogState.start = param; GL11.glFogf(GL11.GL_FOG_START, param); } } - public static void setFogEnd(float param) - { - if (param != fogState.end) - { + public static void setFogEnd(float param) { + if (param != fogState.end) { fogState.end = param; GL11.glFogf(GL11.GL_FOG_END, param); } } - public static void glFog(int pname, FloatBuffer param) - { + public static void glFog(int pname, FloatBuffer param) { GL11.glFog(pname, param); } - public static void glFogi(int pname, int param) - { + public static void glFogi(int pname, int param) { GL11.glFogi(pname, param); } - public static void enableCull() - { + public static void enableCull() { cullState.cullFace.setEnabled(); } - public static void disableCull() - { + public static void disableCull() { cullState.cullFace.setDisabled(); } - public static void cullFace(GlStateManager.CullFace cullFace) - { + public static void cullFace(GlStateManager.CullFace cullFace) { cullFace(cullFace.mode); } - private static void cullFace(int mode) - { - if (mode != cullState.mode) - { + private static void cullFace(int mode) { + if (mode != cullState.mode) { cullState.mode = mode; GL11.glCullFace(mode); } } - public static void glPolygonMode(int face, int mode) - { + public static void glPolygonMode(int face, int mode) { GL11.glPolygonMode(face, mode); } - public static void enablePolygonOffset() - { + public static void enablePolygonOffset() { polygonOffsetState.polygonOffsetFill.setEnabled(); } - public static void disablePolygonOffset() - { + public static void disablePolygonOffset() { polygonOffsetState.polygonOffsetFill.setDisabled(); } - public static void doPolygonOffset(float factor, float units) - { - if (factor != polygonOffsetState.factor || units != polygonOffsetState.units) - { + public static void doPolygonOffset(float factor, float units) { + if (factor != polygonOffsetState.factor || units != polygonOffsetState.units) { polygonOffsetState.factor = factor; polygonOffsetState.units = units; GL11.glPolygonOffset(factor, units); } } - public static void enableColorLogic() - { + public static void enableColorLogic() { colorLogicState.colorLogicOp.setEnabled(); } - public static void disableColorLogic() - { + public static void disableColorLogic() { colorLogicState.colorLogicOp.setDisabled(); } - public static void colorLogicOp(GlStateManager.LogicOp logicOperation) - { + public static void colorLogicOp(GlStateManager.LogicOp logicOperation) { colorLogicOp(logicOperation.opcode); } - public static void colorLogicOp(int opcode) - { - if (opcode != colorLogicState.opcode) - { + public static void colorLogicOp(int opcode) { + if (opcode != colorLogicState.opcode) { colorLogicState.opcode = opcode; GL11.glLogicOp(opcode); } } - public static void enableTexGenCoord(GlStateManager.TexGen texGen) - { + public static void enableTexGenCoord(GlStateManager.TexGen texGen) { texGenCoord(texGen).textureGen.setEnabled(); } - public static void disableTexGenCoord(GlStateManager.TexGen texGen) - { + public static void disableTexGenCoord(GlStateManager.TexGen texGen) { texGenCoord(texGen).textureGen.setDisabled(); } - public static void texGen(GlStateManager.TexGen texGen, int param) - { + public static void texGen(GlStateManager.TexGen texGen, int param) { GlStateManager.TexGenCoord glstatemanager$texgencoord = texGenCoord(texGen); - if (param != glstatemanager$texgencoord.param) - { + if (param != glstatemanager$texgencoord.param) { glstatemanager$texgencoord.param = param; GL11.glTexGeni(glstatemanager$texgencoord.coord, GL11.GL_TEXTURE_GEN_MODE, param); } } - public static void texGen(GlStateManager.TexGen texGen, int pname, FloatBuffer params) - { + public static void texGen(GlStateManager.TexGen texGen, int pname, FloatBuffer params) { GL11.glTexGen(texGenCoord(texGen).coord, pname, params); } - private static GlStateManager.TexGenCoord texGenCoord(GlStateManager.TexGen texGen) - { - switch (texGen) - { + private static GlStateManager.TexGenCoord texGenCoord(GlStateManager.TexGen texGen) { + switch (texGen) { case S: return texGenState.s; case T: @@ -410,140 +348,116 @@ public class GlStateManager { } } - public static void setActiveTexture(int texture) - { - if (activeTextureUnit != texture - OpenGlHelper.defaultTexUnit) - { + public static void setActiveTexture(int texture) { + if (activeTextureUnit != texture - OpenGlHelper.defaultTexUnit) { activeTextureUnit = texture - OpenGlHelper.defaultTexUnit; OpenGlHelper.setActiveTexture(texture); } } - public static void enableTexture2D() - { + public static void enableTexture2D() { textureState[activeTextureUnit].texture2DState.setEnabled(); } - public static void disableTexture2D() - { + public static void disableTexture2D() { textureState[activeTextureUnit].texture2DState.setDisabled(); } - public static void glTexEnv(int target, int parameterName, FloatBuffer parameters) - { + public static void glTexEnv(int target, int parameterName, FloatBuffer parameters) { GL11.glTexEnv(target, parameterName, parameters); } - public static void glTexEnvi(int target, int parameterName, int parameter) - { + public static void glTexEnvi(int target, int parameterName, int parameter) { GL11.glTexEnvi(target, parameterName, parameter); } - public static void glTexEnvf(int target, int parameterName, float parameter) - { + public static void glTexEnvf(int target, int parameterName, float parameter) { GL11.glTexEnvf(target, parameterName, parameter); } - public static void glTexParameterf(int target, int parameterName, float parameter) - { + public static void glTexParameterf(int target, int parameterName, float parameter) { GL11.glTexParameterf(target, parameterName, parameter); } - public static void glTexParameteri(int target, int parameterName, int parameter) - { + public static void glTexParameteri(int target, int parameterName, int parameter) { GL11.glTexParameteri(target, parameterName, parameter); } - public static int glGetTexLevelParameteri(int target, int level, int parameterName) - { + public static int glGetTexLevelParameteri(int target, int level, int parameterName) { return GL11.glGetTexLevelParameteri(target, level, parameterName); } - public static int generateTexture() - { + public static int generateTexture() { return GL11.glGenTextures(); } - public static void deleteTexture(int texture) - { + public static void deleteTexture(int texture) { GL11.glDeleteTextures(texture); - for (GlStateManager.TextureState glstatemanager$texturestate : textureState) - { - if (glstatemanager$texturestate.textureName == texture) - { + for (GlStateManager.TextureState glstatemanager$texturestate : textureState) { + if (glstatemanager$texturestate.textureName == texture) { glstatemanager$texturestate.textureName = -1; } } } - public static void bindTexture(int texture) - { - if (texture != textureState[activeTextureUnit].textureName) - { + public static void bindTexture(int texture) { + if (texture != textureState[activeTextureUnit].textureName) { textureState[activeTextureUnit].textureName = texture; GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); } } - public static void glTexImage2D(int target, int level, int internalFormat, int width, int height, int border, int format, int type, @Nullable IntBuffer pixels) - { + public static void glTexImage2D(int target, int level, int internalFormat, int width, int height, int border, + int format, int type, @Nullable IntBuffer pixels) { GL11.glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels); } - public static void glTexSubImage2D(int target, int level, int xOffset, int yOffset, int width, int height, int format, int type, IntBuffer pixels) - { + public static void glTexSubImage2D(int target, int level, int xOffset, int yOffset, int width, int height, + int format, int type, IntBuffer pixels) { GL11.glTexSubImage2D(target, level, xOffset, yOffset, width, height, format, type, pixels); } - public static void glCopyTexSubImage2D(int target, int level, int xOffset, int yOffset, int x, int y, int width, int height) - { + public static void glCopyTexSubImage2D(int target, int level, int xOffset, int yOffset, int x, int y, int width, + int height) { GL11.glCopyTexSubImage2D(target, level, xOffset, yOffset, x, y, width, height); } - public static void glGetTexImage(int target, int level, int format, int type, IntBuffer pixels) - { + public static void glGetTexImage(int target, int level, int format, int type, IntBuffer pixels) { GL11.glGetTexImage(target, level, format, type, pixels); } - public static void enableNormalize() - { + public static void enableNormalize() { normalizeState.setEnabled(); } - public static void disableNormalize() - { + public static void disableNormalize() { normalizeState.setDisabled(); } - public static void shadeModel(int mode) - { - if (mode != activeShadeModel) - { + public static void shadeModel(int mode) { + if (mode != activeShadeModel) { activeShadeModel = mode; GL11.glShadeModel(mode); } } - public static void enableRescaleNormal() - { + public static void enableRescaleNormal() { rescaleNormalState.setEnabled(); } - public static void disableRescaleNormal() - { + public static void disableRescaleNormal() { rescaleNormalState.setDisabled(); } - public static void viewport(int x, int y, int width, int height) - { + public static void viewport(int x, int y, int width, int height) { GL11.glViewport(x, y, width, height); } - 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) - { + 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; @@ -552,19 +466,17 @@ public class GlStateManager { } } - public static void clearDepth(double depth) - { - if (depth != clearState.depth) - { + 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) - { + 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; @@ -573,78 +485,63 @@ public class GlStateManager { } } - public static void clear(int mask) - { + public static void clear(int mask) { GL11.glClear(mask); } - public static void matrixMode(int mode) - { + public static void matrixMode(int mode) { GL11.glMatrixMode(mode); } - public static void loadIdentity() - { + public static void loadIdentity() { GL11.glLoadIdentity(); } - public static void pushMatrix() - { + public static void pushMatrix() { GL11.glPushMatrix(); } - public static void popMatrix() - { + public static void popMatrix() { GL11.glPopMatrix(); } - public static void getFloat(int pname, FloatBuffer params) - { + public static void getFloat(int pname, FloatBuffer params) { GL11.glGetFloat(pname, params); } - public static void ortho(double left, double right, double bottom, double top, double zNear, double zFar) - { + public static void ortho(double left, double right, double bottom, double top, double zNear, double zFar) { GL11.glOrtho(left, right, bottom, top, zNear, zFar); } - public static void rotate(float angle, float x, float y, float z) - { + public static void rotate(float angle, float x, float y, float z) { GL11.glRotatef(angle, x, y, z); } - public static void scale(float x, float y, float z) - { + public static void scale(float x, float y, float z) { GL11.glScalef(x, y, z); } - public static void scale(double x, double y, double z) - { + public static void scale(double x, double y, double z) { GL11.glScaled(x, y, z); } - public static void translate(float x, float y, float z) - { + public static void translate(float x, float y, float z) { GL11.glTranslatef(x, y, z); } - public static void translate(double x, double y, double z) - { + public static void translate(double x, double y, double z) { GL11.glTranslated(x, y, z); } - public static void multMatrix(FloatBuffer matrix) - { + public static void multMatrix(FloatBuffer matrix) { GL11.glMultMatrix(matrix); } - public static void rotate(Quaternion quaternionIn) - { + public static void rotate(Quaternion quaternionIn) { multMatrix(quatToGlMatrix(BUF_FLOAT_16, quaternionIn)); } - public static FloatBuffer quatToGlMatrix(FloatBuffer buffer, Quaternion quaternionIn) - { + public static FloatBuffer quatToGlMatrix(FloatBuffer buffer, Quaternion quaternionIn) { buffer.clear(); float f = quaternionIn.x * quaternionIn.x; float f1 = quaternionIn.x * quaternionIn.y; @@ -675,10 +572,10 @@ public class GlStateManager { return buffer; } - 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) - { + 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; @@ -687,153 +584,123 @@ public class GlStateManager { } } - public static void color(float colorRed, float colorGreen, float colorBlue) - { + public static void color(float colorRed, float colorGreen, float colorBlue) { color(colorRed, colorGreen, colorBlue, 1.0F); } - public static void glTexCoord2f(float sCoord, float tCoord) - { + public static void glTexCoord2f(float sCoord, float tCoord) { GL11.glTexCoord2f(sCoord, tCoord); } - public static void glVertex3f(float x, float y, float z) - { + public static void glVertex3f(float x, float y, float z) { GL11.glVertex3f(x, y, z); } - public static void resetColor() - { + public static void resetColor() { colorState.red = -1.0F; colorState.green = -1.0F; colorState.blue = -1.0F; colorState.alpha = -1.0F; } - public static void glNormalPointer(int type, int stride, ByteBuffer buffer) - { + public static void glNormalPointer(int type, int stride, ByteBuffer buffer) { GL11.glNormalPointer(type, stride, buffer); } - public static void glTexCoordPointer(int size, int type, int stride, int buffer_offset) - { - GL11.glTexCoordPointer(size, type, stride, (long)buffer_offset); + public static void glTexCoordPointer(int size, int type, int stride, int buffer_offset) { + GL11.glTexCoordPointer(size, type, stride, (long) buffer_offset); } - public static void glTexCoordPointer(int size, int type, int stride, ByteBuffer buffer) - { + public static void glTexCoordPointer(int size, int type, int stride, ByteBuffer buffer) { GL11.glTexCoordPointer(size, type, stride, buffer); } - public static void glVertexPointer(int size, int type, int stride, int buffer_offset) - { - GL11.glVertexPointer(size, type, stride, (long)buffer_offset); + public static void glVertexPointer(int size, int type, int stride, int buffer_offset) { + GL11.glVertexPointer(size, type, stride, (long) buffer_offset); } - public static void glVertexPointer(int size, int type, int stride, ByteBuffer buffer) - { + public static void glVertexPointer(int size, int type, int stride, ByteBuffer buffer) { GL11.glVertexPointer(size, type, stride, buffer); } - public static void glColorPointer(int size, int type, int stride, int buffer_offset) - { - GL11.glColorPointer(size, type, stride, (long)buffer_offset); + public static void glColorPointer(int size, int type, int stride, int buffer_offset) { + GL11.glColorPointer(size, type, stride, (long) buffer_offset); } - public static void glColorPointer(int size, int type, int stride, ByteBuffer buffer) - { + public static void glColorPointer(int size, int type, int stride, ByteBuffer buffer) { GL11.glColorPointer(size, type, stride, buffer); } - public static void glDisableClientState(int cap) - { + public static void glDisableClientState(int cap) { GL11.glDisableClientState(cap); } - public static void glEnableClientState(int cap) - { + public static void glEnableClientState(int cap) { GL11.glEnableClientState(cap); } - public static void glBegin(int mode) - { + public static void glBegin(int mode) { GL11.glBegin(mode); } - public static void glEnd() - { + public static void glEnd() { GL11.glEnd(); } - public static void glDrawArrays(int mode, int first, int count) - { + public static void glDrawArrays(int mode, int first, int count) { GL11.glDrawArrays(mode, first, count); } - public static void glLineWidth(float width) - { + public static void glLineWidth(float width) { GL11.glLineWidth(width); } - public static void callList(int list) - { + public static void callList(int list) { GL11.glCallList(list); } - public static void glDeleteLists(int list, int range) - { + public static void glDeleteLists(int list, int range) { GL11.glDeleteLists(list, range); } - public static void glNewList(int list, int mode) - { + public static void glNewList(int list, int mode) { GL11.glNewList(list, mode); } - public static void glEndList() - { + public static void glEndList() { GL11.glEndList(); } - public static int glGenLists(int range) - { + public static int glGenLists(int range) { return GL11.glGenLists(range); } - public static void glPixelStorei(int parameterName, int param) - { + public static void glPixelStorei(int parameterName, int param) { GL11.glPixelStorei(parameterName, param); } - public static void glReadPixels(int x, int y, int width, int height, int format, int type, IntBuffer pixels) - { + public static void glReadPixels(int x, int y, int width, int height, int format, int type, IntBuffer pixels) { GL11.glReadPixels(x, y, width, height, format, type, pixels); } - public static int glGetError() - { + public static int glGetError() { return GL11.glGetError(); } - public static String glGetString(int name) - { + public static String glGetString(int name) { return GL11.glGetString(name); } - public static void glGetInteger(int parameterName, IntBuffer parameters) - { + public static void glGetInteger(int parameterName, IntBuffer parameters) { GL11.glGetInteger(parameterName, parameters); } - public static int glGetInteger(int parameterName) - { + public static int glGetInteger(int parameterName) { return GL11.glGetInteger(parameterName); } - static - { - for (int i = 0; i < 8; ++i) - { + static { + for (int i = 0; i < 8; ++i) { lightState[i] = new GlStateManager.BooleanState(16384 + i); } @@ -850,8 +717,7 @@ public class GlStateManager { normalizeState = new GlStateManager.BooleanState(2977); textureState = new GlStateManager.TextureState[8]; - for (int j = 0; j < 8; ++j) - { + for (int j = 0; j < 8; ++j) { textureState[j] = new GlStateManager.TextureState(); } @@ -862,14 +728,13 @@ public class GlStateManager { } @SideOnly(Side.CLIENT) - static class AlphaState - { + static class AlphaState { + public GlStateManager.BooleanState alphaTest; public int func; public float ref; - private AlphaState() - { + private AlphaState() { this.alphaTest = new GlStateManager.BooleanState(3008); this.func = 519; this.ref = -1.0F; @@ -877,16 +742,15 @@ public class GlStateManager { } @SideOnly(Side.CLIENT) - static class BlendState - { + static class BlendState { + public GlStateManager.BooleanState blend; public int srcFactor; public int dstFactor; public int srcFactorAlpha; public int dstFactorAlpha; - private BlendState() - { + private BlendState() { this.blend = new GlStateManager.BooleanState(3042); this.srcFactor = 1; this.dstFactor = 0; @@ -896,38 +760,30 @@ public class GlStateManager { } @SideOnly(Side.CLIENT) - static class BooleanState - { + static class BooleanState { + private final int capability; private boolean currentState; - public BooleanState(int capabilityIn) - { + public BooleanState(int capabilityIn) { this.capability = capabilityIn; } - public void setDisabled() - { + public void setDisabled() { this.setState(false); } - public void setEnabled() - { + public void setEnabled() { this.setState(true); } - public void setState(boolean state) - { - if (state != this.currentState) - { + public void setState(boolean state) { + if (state != this.currentState) { this.currentState = state; - if (state) - { + if (state) { GL11.glEnable(this.capability); - } - else - { + } else { GL11.glDisable(this.capability); } } @@ -935,33 +791,30 @@ public class GlStateManager { } @SideOnly(Side.CLIENT) - static class ClearState - { + static class ClearState { + public double depth; public GlStateManager.Color color; - private ClearState() - { + private ClearState() { this.depth = 1.0D; this.color = new GlStateManager.Color(0.0F, 0.0F, 0.0F, 0.0F); } } @SideOnly(Side.CLIENT) - static class Color - { + static class Color { + public float red; public float green; public float blue; public float alpha; - public Color() - { + public Color() { this(1.0F, 1.0F, 1.0F, 1.0F); } - public Color(float redIn, float greenIn, float blueIn, float alphaIn) - { + public Color(float redIn, float greenIn, float blueIn, float alphaIn) { this.red = 1.0F; this.green = 1.0F; this.blue = 1.0F; @@ -974,28 +827,26 @@ public class GlStateManager { } @SideOnly(Side.CLIENT) - static class ColorLogicState - { + static class ColorLogicState { + public GlStateManager.BooleanState colorLogicOp; public int opcode; - private ColorLogicState() - { + private ColorLogicState() { this.colorLogicOp = new GlStateManager.BooleanState(3058); this.opcode = 5379; } } @SideOnly(Side.CLIENT) - static class ColorMask - { + static class ColorMask { + public boolean red; public boolean green; public boolean blue; public boolean alpha; - private ColorMask() - { + private ColorMask() { this.red = true; this.green = true; this.blue = true; @@ -1004,14 +855,13 @@ public class GlStateManager { } @SideOnly(Side.CLIENT) - static class ColorMaterialState - { + static class ColorMaterialState { + public GlStateManager.BooleanState colorMaterial; public int face; public int mode; - private ColorMaterialState() - { + private ColorMaterialState() { this.colorMaterial = new GlStateManager.BooleanState(2903); this.face = 1032; this.mode = 5634; @@ -1019,42 +869,39 @@ public class GlStateManager { } @SideOnly(Side.CLIENT) - public static enum CullFace - { + public static enum CullFace { + FRONT(1028), BACK(1029), FRONT_AND_BACK(1032); public final int mode; - private CullFace(int modeIn) - { + private CullFace(int modeIn) { this.mode = modeIn; } } @SideOnly(Side.CLIENT) - static class CullState - { + static class CullState { + public GlStateManager.BooleanState cullFace; public int mode; - private CullState() - { + private CullState() { this.cullFace = new GlStateManager.BooleanState(2884); this.mode = 1029; } } @SideOnly(Side.CLIENT) - static class DepthState - { + static class DepthState { + public GlStateManager.BooleanState depthTest; public boolean maskEnabled; public int depthFunc; - private DepthState() - { + private DepthState() { this.depthTest = new GlStateManager.BooleanState(2929); this.maskEnabled = true; this.depthFunc = 513; @@ -1062,8 +909,8 @@ public class GlStateManager { } @SideOnly(Side.CLIENT) - public static enum DestFactor - { + public static enum DestFactor { + CONSTANT_ALPHA(32771), CONSTANT_COLOR(32769), DST_ALPHA(772), @@ -1081,15 +928,14 @@ public class GlStateManager { public final int factor; - private DestFactor(int factorIn) - { + private DestFactor(int factorIn) { this.factor = factorIn; } } @SideOnly(Side.CLIENT) - public static enum FogMode - { + public static enum FogMode { + LINEAR(9729), EXP(2048), EXP2(2049); @@ -1097,23 +943,21 @@ public class GlStateManager { /** The capability ID of this {@link FogMode} */ public final int capabilityId; - private FogMode(int capabilityIn) - { + private FogMode(int capabilityIn) { this.capabilityId = capabilityIn; } } @SideOnly(Side.CLIENT) - static class FogState - { + static class FogState { + public GlStateManager.BooleanState fog; public int mode; public float density; public float start; public float end; - private FogState() - { + private FogState() { this.fog = new GlStateManager.BooleanState(2912); this.mode = 2048; this.density = 1.0F; @@ -1122,8 +966,8 @@ public class GlStateManager { } @SideOnly(Side.CLIENT) - public static enum LogicOp - { + public static enum LogicOp { + AND(5377), AND_INVERTED(5380), AND_REVERSE(5378), @@ -1143,30 +987,28 @@ public class GlStateManager { public final int opcode; - private LogicOp(int opcodeIn) - { + private LogicOp(int opcodeIn) { this.opcode = opcodeIn; } } @SideOnly(Side.CLIENT) - static class PolygonOffsetState - { + static class PolygonOffsetState { + public GlStateManager.BooleanState polygonOffsetFill; public GlStateManager.BooleanState polygonOffsetLine; public float factor; public float units; - private PolygonOffsetState() - { + private PolygonOffsetState() { this.polygonOffsetFill = new GlStateManager.BooleanState(32823); this.polygonOffsetLine = new GlStateManager.BooleanState(10754); } } @SideOnly(Side.CLIENT) - public static enum SourceFactor - { + public static enum SourceFactor { + CONSTANT_ALPHA(32771), CONSTANT_COLOR(32769), DST_ALPHA(772), @@ -1185,36 +1027,33 @@ public class GlStateManager { public final int factor; - private SourceFactor(int factorIn) - { + private SourceFactor(int factorIn) { this.factor = factorIn; } } @SideOnly(Side.CLIENT) - static class StencilFunc - { + static class StencilFunc { + public int func; public int mask; - private StencilFunc() - { + private StencilFunc() { this.func = 519; this.mask = -1; } } @SideOnly(Side.CLIENT) - static class StencilState - { + static class StencilState { + public GlStateManager.StencilFunc func; public int mask; public int fail; public int zfail; public int zpass; - private StencilState() - { + private StencilState() { this.func = new GlStateManager.StencilFunc(); this.mask = -1; this.fail = 7680; @@ -1224,8 +1063,7 @@ public class GlStateManager { } @SideOnly(Side.CLIENT) - public static enum TexGen - { + public static enum TexGen { S, T, R, @@ -1233,29 +1071,27 @@ public class GlStateManager { } @SideOnly(Side.CLIENT) - static class TexGenCoord - { + static class TexGenCoord { + public GlStateManager.BooleanState textureGen; public int coord; public int param = -1; - public TexGenCoord(int coordIn, int capabilityIn) - { + public TexGenCoord(int coordIn, int capabilityIn) { this.coord = coordIn; this.textureGen = new GlStateManager.BooleanState(capabilityIn); } } @SideOnly(Side.CLIENT) - static class TexGenState - { + static class TexGenState { + public GlStateManager.TexGenCoord s; public GlStateManager.TexGenCoord t; public GlStateManager.TexGenCoord r; public GlStateManager.TexGenCoord q; - private TexGenState() - { + private TexGenState() { this.s = new GlStateManager.TexGenCoord(8192, 3168); this.t = new GlStateManager.TexGenCoord(8193, 3169); this.r = new GlStateManager.TexGenCoord(8194, 3170); @@ -1264,13 +1100,12 @@ public class GlStateManager { } @SideOnly(Side.CLIENT) - static class TextureState - { + static class TextureState { + public GlStateManager.BooleanState texture2DState; public int textureName; - private TextureState() - { + private TextureState() { this.texture2DState = new GlStateManager.BooleanState(3553); } }