mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-21 04:32:23 +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
@@ -36,55 +36,55 @@ public class RenderBabylonWeapon extends Render {
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
EntityBabylonWeapon weapon = (EntityBabylonWeapon) par1Entity;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
|
||||
GL11.glRotatef(weapon.getRotation(), 0F, 1F, 0F);
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate((float)par2, (float)par4, (float)par6);
|
||||
GlStateManager.rotate(weapon.getRotation(), 0F, 1F, 0F);
|
||||
|
||||
int live = weapon.getLiveTicks();
|
||||
int delay = weapon.getDelay();
|
||||
float charge = Math.min(10F, Math.max(live, weapon.getChargeTicks()) + par9);
|
||||
float chargeMul = charge / 10F;
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);
|
||||
GL11.glPushMatrix();
|
||||
GlStateManager.pushMatrix();
|
||||
float s = 1.5F;
|
||||
GL11.glScalef(s, s, s);
|
||||
GL11.glRotatef(-90F, 0F, 1F, 0F);
|
||||
GL11.glRotatef(45F, 0F, 0F, 1F);
|
||||
GlStateManager.scale(s, s, s);
|
||||
GlStateManager.rotate(-90F, 0F, 1F, 0F);
|
||||
GlStateManager.rotate(45F, 0F, 0F, 1F);
|
||||
IIcon icon = ItemKingKey.weaponIcons[weapon.getVariety()];
|
||||
GL11.glColor4f(1F, 1F, 1F, chargeMul);
|
||||
GlStateManager.color(1F, 1F, 1F, chargeMul);
|
||||
float f = icon.getMinU();
|
||||
float f1 = icon.getMaxU();
|
||||
float f2 = icon.getMinV();
|
||||
float f3 = icon.getMaxV();
|
||||
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GlStateManager.disableLighting();
|
||||
ItemRenderer.renderItemIn2D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
|
||||
GL11.glPopMatrix();
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glColor4f(1F, 1F, 1F, chargeMul);
|
||||
GlStateManager.disableCull();
|
||||
GlStateManager.shadeModel(GL11.GL_SMOOTH);
|
||||
GlStateManager.color(1F, 1F, 1F, chargeMul);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(babylon);
|
||||
|
||||
Tessellator tes = Tessellator.getInstance();
|
||||
ShaderHelper.useShader(ShaderHelper.halo);
|
||||
Random rand = new Random(weapon.getUniqueID().getMostSignificantBits());
|
||||
GL11.glRotatef(-90F, 1F, 0F, 0F);
|
||||
GL11.glTranslatef(0F, -0.3F + rand.nextFloat() * 0.1F, 1F);
|
||||
GlStateManager.rotate(-90F, 1F, 0F, 0F);
|
||||
GlStateManager.translate(0F, -0.3F + rand.nextFloat() * 0.1F, 1F);
|
||||
|
||||
s = chargeMul;
|
||||
if(live > delay)
|
||||
s -= Math.min(1F, (live - delay + par9) * 0.2F);
|
||||
s *= 2F;
|
||||
GL11.glScalef(s, s, s);
|
||||
GlStateManager.scale(s, s, s);
|
||||
|
||||
GL11.glRotatef(charge * 9F + (weapon.ticksExisted + par9) * 0.5F + rand.nextFloat() * 360F, 0F, 1F, 0F);
|
||||
GlStateManager.rotate(charge * 9F + (weapon.ticksExisted + par9) * 0.5F + rand.nextFloat() * 360F, 0F, 1F, 0F);
|
||||
|
||||
tes.startDrawingQuads();
|
||||
tes.addVertexWithUV(-1, 0, -1, 0, 0);
|
||||
@@ -95,10 +95,10 @@ public class RenderBabylonWeapon extends Render {
|
||||
|
||||
ShaderHelper.releaseShader();
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glPopMatrix();
|
||||
GlStateManager.enableLighting();
|
||||
GlStateManager.shadeModel(GL11.GL_FLAT);
|
||||
GlStateManager.enableCull();
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user