mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-27 15:33:08 +00:00
Full GLStatemanager substitution
This commit is contained in:
1 parent
9cd7a4a0d5
commit
2dae52a9ff
135 files changed
+1629
-1596
No files matched your search
@@ -59,31 +59,31 @@ public class PageMultiblock extends LexiconPage {
|
||||
TextureManager render = Minecraft.getMinecraft().renderEngine;
|
||||
render.bindTexture(multiblockOverlay);
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GlStateManager.disableAlpha();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight());
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.enableAlpha();
|
||||
|
||||
final float maxX = 90, maxY = 60;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(gui.getLeft() + gui.getWidth() / 2, gui.getTop() + 90, gui.getZLevel() + 100F);
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(gui.getLeft() + gui.getWidth() / 2, gui.getTop() + 90, gui.getZLevel() + 100F);
|
||||
|
||||
float diag = (float) Math.sqrt(mb.getXSize() * mb.getXSize() + mb.getZSize() * mb.getZSize());
|
||||
float height = mb.getYSize();
|
||||
float scaleX = maxX / diag;
|
||||
float scaleY = maxY / height;
|
||||
float scale = -Math.min(scaleY, scaleX);
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
GlStateManager.scale(scale, scale, scale);
|
||||
|
||||
GL11.glRotatef(-20F, 1, 0, 0);
|
||||
GL11.glRotatef(gui.getElapsedTicks(), 0, 1, 0);
|
||||
GlStateManager.rotate(-20F, 1, 0, 0);
|
||||
GlStateManager.rotate(gui.getElapsedTicks(), 0, 1, 0);
|
||||
|
||||
MultiblockRenderHandler.renderMultiblockOnPage(mb);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
FontRenderer font = Minecraft.getMinecraft().fontRendererObj;
|
||||
boolean unicode = font.getUnicodeFlag();
|
||||
@@ -92,16 +92,16 @@ public class PageMultiblock extends LexiconPage {
|
||||
font.drawString(s, gui.getLeft() + gui.getWidth() / 2 - font.getStringWidth(s) / 2, gui.getTop() + 16, 0x000000);
|
||||
font.setUnicodeFlag(unicode);
|
||||
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
int x = gui.getLeft() + 15;
|
||||
int y = gui.getTop() + 25;
|
||||
Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.stonebrick), x, y);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GlStateManager.disableRescaleNormal();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0F, 0F, 200F);
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(0F, 0F, 200F);
|
||||
if(mx >= x && mx < x + 16 && my >= y && my < y + 16) {
|
||||
List<String> mats = new ArrayList();
|
||||
mats.add(StatCollector.translateToLocal("botaniamisc.materialsRequired"));
|
||||
@@ -114,7 +114,7 @@ public class PageMultiblock extends LexiconPage {
|
||||
|
||||
vazkii.botania.client.core.helper.RenderHelper.renderTooltip(mx, my, mats);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user