Removed usage of GL11 in favor of using GlStateManager.

This commit is contained in:
Sebastian Hartte
2016-10-03 00:23:45 +02:00
parent 62f224d77b
commit 2ab1fc0adf
16 changed files with 93 additions and 113 deletions
+14 -13
View File
@@ -233,7 +233,7 @@ public abstract class AEBaseGui extends GuiContainer
{
final int ox = this.guiLeft; // (width - xSize) / 2;
final int oy = this.guiTop; // (height - ySize) / 2;
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
GlStateManager.color( 1.0F, 1.0F, 1.0F, 1.0F );
if( this.getScrollBar() != null )
{
@@ -250,7 +250,7 @@ public abstract class AEBaseGui extends GuiContainer
{
final int ox = this.guiLeft; // (width - xSize) / 2;
final int oy = this.guiTop; // (height - ySize) / 2;
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
GlStateManager.color( 1.0F, 1.0F, 1.0F, 1.0F );
this.drawBG( ox, oy, x, y );
final List<Slot> slots = this.getInventorySlots();
@@ -267,10 +267,10 @@ public abstract class AEBaseGui extends GuiContainer
}
else
{
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 0.4F );
GlStateManager.color( 1.0F, 1.0F, 1.0F, 0.4F );
GlStateManager.enableBlend();
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.getSourceX() - 1, fs.getSourceY() - 1, 18, 18 );
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
GlStateManager.color( 1.0F, 1.0F, 1.0F, 1.0F );
}
}
}
@@ -669,7 +669,9 @@ public abstract class AEBaseGui extends GuiContainer
this.itemRender.zLevel = 100.0F;
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.enableDepth();
this.itemRender.renderItemAndEffectIntoGUI( is, x, y );
GlStateManager.disableDepth();
this.itemRender.zLevel = 0.0F;
this.zLevel = 0.0F;
@@ -740,17 +742,16 @@ public abstract class AEBaseGui extends GuiContainer
{
this.bindTexture( "guis/states.png" );
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
try
{
final int uv_y = (int) Math.floor( aes.getIcon() / 16 );
final int uv_x = aes.getIcon() - uv_y * 16;
GL11.glEnable( GL11.GL_BLEND );
GL11.glDisable( GL11.GL_LIGHTING );
GL11.glEnable( GL11.GL_TEXTURE_2D );
GL11.glBlendFunc( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA );
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
GlStateManager.enableBlend();
GlStateManager.disableLighting();
GlStateManager.enableTexture2D();
GlStateManager.blendFunc( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA );
GlStateManager.color( 1.0f, 1.0f, 1.0f, 1.0f );
final float par1 = aes.xDisplayPosition;
final float par2 = aes.yDisplayPosition;
final float par3 = uv_x * 16;
@@ -770,11 +771,11 @@ public abstract class AEBaseGui extends GuiContainer
vb.pos( par1 + par5, par2 + 0, this.zLevel ).tex( ( par3 + par5 ) * f, ( par4 + 0 ) * f1 ).color( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() ).endVertex();
vb.pos( par1 + 0, par2 + 0, this.zLevel ).tex( ( par3 + 0 ) * f, ( par4 + 0 ) * f1 ).color( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() ).endVertex();
tessellator.draw();
}
catch( final Exception err )
{
}
GL11.glPopAttrib();
}
}
@@ -802,9 +803,9 @@ public abstract class AEBaseGui extends GuiContainer
this.zLevel = 100.0F;
this.itemRender.zLevel = 100.0F;
GL11.glDisable( GL11.GL_LIGHTING );
GlStateManager.disableLighting();
drawRect( s.xDisplayPosition, s.yDisplayPosition, 16 + s.xDisplayPosition, 16 + s.yDisplayPosition, 0x66ff6666 );
GL11.glEnable( GL11.GL_LIGHTING );
GlStateManager.enableLighting();
this.zLevel = 0.0F;
this.itemRender.zLevel = 0.0F;
@@ -29,7 +29,6 @@ import java.util.concurrent.TimeUnit;
import com.google.common.base.Joiner;
import org.apache.commons.lang3.time.DurationFormatUtils;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
@@ -31,8 +31,7 @@ import java.util.WeakHashMap;
import com.google.common.collect.HashMultimap;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
@@ -175,7 +174,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
{
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
GL11.glColor4f( 1, 1, 1, 1 );
GlStateManager.color( 1, 1, 1, 1 );
final int width = inv.getInventory().getSizeInventory() * 18;
this.drawTexturedModalRect( offsetX + 7, offsetY + offset, 7, 139, width, 18 );
}
@@ -19,8 +19,7 @@
package appeng.client.gui.implementations;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import appeng.client.gui.AEBaseGui;
@@ -65,7 +64,7 @@ public class GuiVibrationChamber extends AEBaseGui
{
final int i1 = this.cvc.getCurrentProgress();
this.bindTexture( "guis/vibchamber.png" );
GL11.glColor3f( 1, 1, 1 );
GlStateManager.color( 1, 1, 1 );
final int l = -15;
final int k = 25;
this.drawTexturedModalRect( k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2 );
@@ -23,10 +23,9 @@ import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
@@ -195,17 +194,17 @@ public class GuiImgButton extends GuiButton implements ITooltip
this.width = 8;
this.height = 8;
GL11.glPushMatrix();
GL11.glTranslatef( this.xPosition, this.yPosition, 0.0F );
GL11.glScalef( 0.5f, 0.5f, 0.5f );
GlStateManager.pushMatrix();
GlStateManager.translate( this.xPosition, this.yPosition, 0.0F );
GlStateManager.scale( 0.5f, 0.5f, 0.5f );
if( this.enabled )
{
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
GlStateManager.color( 1.0f, 1.0f, 1.0f, 1.0f );
}
else
{
GL11.glColor4f( 0.5f, 0.5f, 0.5f, 1.0f );
GlStateManager.color( 0.5f, 0.5f, 0.5f, 1.0f );
}
par1Minecraft.renderEngine.bindTexture( new ResourceLocation( "appliedenergistics2", "textures/guis/states.png" ) );
@@ -218,17 +217,17 @@ public class GuiImgButton extends GuiButton implements ITooltip
this.drawTexturedModalRect( 0, 0, uv_x * 16, uv_y * 16, 16, 16 );
this.mouseDragged( par1Minecraft, par2, par3 );
GL11.glPopMatrix();
GlStateManager.popMatrix();
}
else
{
if( this.enabled )
{
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
GlStateManager.color( 1.0f, 1.0f, 1.0f, 1.0f );
}
else
{
GL11.glColor4f( 0.5f, 0.5f, 0.5f, 1.0f );
GlStateManager.color( 0.5f, 0.5f, 0.5f, 1.0f );
}
par1Minecraft.renderEngine.bindTexture( new ResourceLocation( "appliedenergistics2", "textures/guis/states.png" ) );
@@ -242,7 +241,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
this.mouseDragged( par1Minecraft, par2, par3 );
}
}
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
GlStateManager.color( 1.0f, 1.0f, 1.0f, 1.0f );
}
private int getIconIndex()
@@ -19,7 +19,7 @@
package appeng.client.gui.widgets;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.GlStateManager;
import appeng.client.gui.AEBaseGui;
@@ -40,7 +40,7 @@ public class GuiScrollbar implements IScrollSource
public void draw( final AEBaseGui g )
{
g.bindTexture( "minecraft", "gui/container/creative_inventory/tabs.png" );
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
GlStateManager.color( 1.0f, 1.0f, 1.0f, 1.0f );
if( this.getRange() == 0 )
{
@@ -19,8 +19,6 @@
package appeng.client.gui.widgets;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
@@ -77,7 +75,7 @@ public class GuiTabButton extends GuiButton implements ITooltip
{
if( this.visible )
{
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
GlStateManager.color( 1.0f, 1.0f, 1.0f, 1.0f );
minecraft.renderEngine.bindTexture( new ResourceLocation( "appliedenergistics2", "textures/guis/states.png" ) );
this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition + this.width && y < this.yPosition + this.height;
@@ -21,10 +21,9 @@ package appeng.client.gui.widgets;
import java.util.regex.Pattern;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
@@ -65,7 +64,7 @@ public class GuiToggleButton extends GuiButton implements ITooltip
{
final int iconIndex = this.getIconIndex();
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
GlStateManager.color( 1.0f, 1.0f, 1.0f, 1.0f );
par1Minecraft.renderEngine.bindTexture( new ResourceLocation( "appliedenergistics2", "textures/guis/states.png" ) );
this.hovered = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;