Fixes #2405: Apparently push attrib causes issues (somewhere it messes with the GL state and the internal GL state keeping by MC somewhere).

Fixes #2404: Most state flags are now automatically taken care of by RenderItem.
Fixes #2409: Fixes text being slightly offset to the top.
This commit is contained in:
Sebastian Hartte 2016-10-02 22:54:28 +02:00
parent f316c93e38
commit a59cef87de
2 changed files with 5 additions and 13 deletions

View File

@ -38,7 +38,6 @@ import com.google.common.collect.Lists;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
@ -670,13 +669,8 @@ public abstract class AEBaseGui extends GuiContainer
this.zLevel = 100.0F;
this.itemRender.zLevel = 100.0F;
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
GL11.glEnable( GL11.GL_LIGHTING );
GL11.glEnable( GL12.GL_RESCALE_NORMAL );
GL11.glEnable( GL11.GL_DEPTH_TEST );
RenderHelper.enableGUIStandardItemLighting();
this.itemRender.renderItemAndEffectIntoGUI( is, x, y );
GL11.glPopAttrib();
this.itemRender.zLevel = 0.0F;
this.zLevel = 0.0F;

View File

@ -29,9 +29,9 @@ import java.util.List;
import com.google.common.base.Joiner;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@ -246,8 +246,8 @@ public class GuiCraftConfirm extends AEBaseGui
final IAEItemStack refStack = this.visual.get( z );// repo.getReferenceItem( z );
if( refStack != null )
{
GL11.glPushMatrix();
GL11.glScaled( 0.5, 0.5, 0.5 );
GlStateManager.pushMatrix();
GlStateManager.scale( 0.5, 0.5, 0.5 );
final IAEItemStack stored = this.storage.findPrecise( refStack );
final IAEItemStack pendingStack = this.pending.findPrecise( refStack );
@ -259,7 +259,7 @@ public class GuiCraftConfirm extends AEBaseGui
{
lines++;
}
if( pendingStack != null && pendingStack.getStackSize() > 0 )
if( missingStack != null && missingStack.getStackSize() > 0 )
{
lines++;
}
@ -343,7 +343,7 @@ public class GuiCraftConfirm extends AEBaseGui
}
}
GL11.glPopMatrix();
GlStateManager.popMatrix();
final int posX = x * ( 1 + sectionLength ) + xo + sectionLength - 19;
final int posY = y * offY + yo;
@ -383,9 +383,7 @@ public class GuiCraftConfirm extends AEBaseGui
if( this.tooltip >= 0 && !dspToolTip.isEmpty() )
{
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
this.drawTooltip( toolPosX, toolPosY + 10, dspToolTip );
GL11.glPopAttrib();
}
}