/** Draws a sprite from /gui/slot.png. */ private void drawSprite(int par1, int par2, int par3, int par4) { int i = mc.renderEngine.getTexture("/gui/slot.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(i); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV( par1 + 0, par2 + 18, zLevel, (float) (par3 + 0) * 0.0078125F, (float) (par4 + 18) * 0.0078125F); tessellator.addVertexWithUV( par1 + 18, par2 + 18, zLevel, (float) (par3 + 18) * 0.0078125F, (float) (par4 + 18) * 0.0078125F); tessellator.addVertexWithUV( par1 + 18, par2 + 0, zLevel, (float) (par3 + 18) * 0.0078125F, (float) (par4 + 0) * 0.0078125F); tessellator.addVertexWithUV( par1 + 0, par2 + 0, zLevel, (float) (par3 + 0) * 0.0078125F, (float) (par4 + 0) * 0.0078125F); tessellator.draw(); }
/** Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height */ public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { float var7 = 0.00390625F; float var8 = 0.00390625F; Tessellator var9 = Tessellator.instance; var9.startDrawingQuads(); var9.addVertexWithUV( (double) (par1 + 0), (double) (par2 + par6), (double) this.zLevel, (double) ((float) (par3 + 0) * var7), (double) ((float) (par4 + par6) * var8)); var9.addVertexWithUV( (double) (par1 + par5), (double) (par2 + par6), (double) this.zLevel, (double) ((float) (par3 + par5) * var7), (double) ((float) (par4 + par6) * var8)); var9.addVertexWithUV( (double) (par1 + par5), (double) (par2 + 0), (double) this.zLevel, (double) ((float) (par3 + par5) * var7), (double) ((float) (par4 + 0) * var8)); var9.addVertexWithUV( (double) (par1 + 0), (double) (par2 + 0), (double) this.zLevel, (double) ((float) (par3 + 0) * var7), (double) ((float) (par4 + 0) * var8)); var9.draw(); }
private void renderPortalOverlay(float f, int i, int j) { if (f < 1.0F) { f *= f; f *= f; f = f * 0.8F + 0.2F; } GL11.glDisable(3008 /*GL_ALPHA_TEST*/); GL11.glDisable(2929 /*GL_DEPTH_TEST*/); GL11.glDepthMask(false); GL11.glBlendFunc(770, 771); GL11.glColor4f(1.0F, 1.0F, 1.0F, f); GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/terrain.png")); float f1 = (float) (Block.portal.blockIndexInTexture % 16) / 16F; float f2 = (float) (Block.portal.blockIndexInTexture / 16) / 16F; float f3 = (float) (Block.portal.blockIndexInTexture % 16 + 1) / 16F; float f4 = (float) (Block.portal.blockIndexInTexture / 16 + 1) / 16F; Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(0.0D, j, -90D, f1, f4); tessellator.addVertexWithUV(i, j, -90D, f3, f4); tessellator.addVertexWithUV(i, 0.0D, -90D, f3, f2); tessellator.addVertexWithUV(0.0D, 0.0D, -90D, f1, f2); tessellator.draw(); GL11.glDepthMask(true); GL11.glEnable(2929 /*GL_DEPTH_TEST*/); GL11.glEnable(3008 /*GL_ALPHA_TEST*/); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); }
protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { TexturePackBase var6 = (TexturePackBase) GuiTexturePacks.func_73953_j(this.parentTexturePackGui) .texturePackList .availableTexturePacks() .get(par1); var6.bindThumbnailTexture(GuiTexturePacks.func_73961_k(this.parentTexturePackGui).renderEngine); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); par5Tessellator.startDrawingQuads(); par5Tessellator.setColorOpaque_I(16777215); par5Tessellator.addVertexWithUV((double) par2, (double) (par3 + par4), 0.0D, 0.0D, 1.0D); par5Tessellator.addVertexWithUV((double) (par2 + 32), (double) (par3 + par4), 0.0D, 1.0D, 1.0D); par5Tessellator.addVertexWithUV((double) (par2 + 32), (double) par3, 0.0D, 1.0D, 0.0D); par5Tessellator.addVertexWithUV((double) par2, (double) par3, 0.0D, 0.0D, 0.0D); par5Tessellator.draw(); this.parentTexturePackGui.drawString( GuiTexturePacks.func_73960_l(this.parentTexturePackGui), var6.getTexturePackFileName(), par2 + 32 + 2, par3 + 1, 16777215); this.parentTexturePackGui.drawString( GuiTexturePacks.func_73963_m(this.parentTexturePackGui), var6.getFirstDescriptionLine(), par2 + 32 + 2, par3 + 12, 8421504); this.parentTexturePackGui.drawString( GuiTexturePacks.func_73954_n(this.parentTexturePackGui), var6.getSecondDescriptionLine(), par2 + 32 + 2, par3 + 12 + 10, 8421504); }
private void func_82455_b(int par1, int par2, int par3, int par4) { int var5 = this.flatPresetsGui.mc.renderEngine.getTexture("/gui/slot.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.flatPresetsGui.mc.renderEngine.bindTexture(var5); Tessellator var10 = Tessellator.instance; var10.startDrawingQuads(); var10.addVertexWithUV( (double) (par1 + 0), (double) (par2 + 18), (double) this.flatPresetsGui.zLevel, (double) ((float) (par3 + 0) * 0.0078125F), (double) ((float) (par4 + 18) * 0.0078125F)); var10.addVertexWithUV( (double) (par1 + 18), (double) (par2 + 18), (double) this.flatPresetsGui.zLevel, (double) ((float) (par3 + 18) * 0.0078125F), (double) ((float) (par4 + 18) * 0.0078125F)); var10.addVertexWithUV( (double) (par1 + 18), (double) (par2 + 0), (double) this.flatPresetsGui.zLevel, (double) ((float) (par3 + 18) * 0.0078125F), (double) ((float) (par4 + 0) * 0.0078125F)); var10.addVertexWithUV( (double) (par1 + 0), (double) (par2 + 0), (double) this.flatPresetsGui.zLevel, (double) ((float) (par3 + 0) * 0.0078125F), (double) ((float) (par4 + 0) * 0.0078125F)); var10.draw(); }
private void renderVignette(float f, int i, int j) { f = 1.0F - f; if (f < 0.0F) { f = 0.0F; } if (f > 1.0F) { f = 1.0F; } prevVignetteBrightness += (double) (f - prevVignetteBrightness) * 0.01D; GL11.glDisable(2929 /*GL_DEPTH_TEST*/); GL11.glDepthMask(false); GL11.glBlendFunc(0, 769); GL11.glColor4f(prevVignetteBrightness, prevVignetteBrightness, prevVignetteBrightness, 1.0F); GL11.glBindTexture( 3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("%blur%/misc/vignette.png")); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(0.0D, j, -90D, 0.0D, 1.0D); tessellator.addVertexWithUV(i, j, -90D, 1.0D, 1.0D); tessellator.addVertexWithUV(i, 0.0D, -90D, 1.0D, 0.0D); tessellator.addVertexWithUV(0.0D, 0.0D, -90D, 0.0D, 0.0D); tessellator.draw(); GL11.glDepthMask(true); GL11.glEnable(2929 /*GL_DEPTH_TEST*/); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glBlendFunc(770, 771); }
/** Renders the fire on the screen for first person mode. Arg: partialTickTime */ private void renderFireInFirstPerson(float par1) { Tessellator tessellator = Tessellator.instance; GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.9F); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); float f = 1.0F; for (int i = 0; i < 2; i++) { GL11.glPushMatrix(); int j = Block.fire.blockIndexInTexture + i * 16; int k = (j & 0xf) << 4; int l = j & 0xf0; float f1 = (float) k / 256F; float f2 = ((float) k + 15.99F) / 256F; float f3 = (float) l / 256F; float f4 = ((float) l + 15.99F) / 256F; float f5 = (0.0F - f) / 2.0F; float f6 = f5 + f; float f7 = 0.0F - f / 2.0F; float f8 = f7 + f; float f9 = -0.5F; GL11.glTranslatef((float) (-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F); GL11.glRotatef((float) (i * 2 - 1) * 10F, 0.0F, 1.0F, 0.0F); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(f5, f7, f9, f2, f4); tessellator.addVertexWithUV(f6, f7, f9, f1, f4); tessellator.addVertexWithUV(f6, f8, f9, f1, f3); tessellator.addVertexWithUV(f5, f8, f9, f2, f3); tessellator.draw(); GL11.glPopMatrix(); } GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_BLEND); }
/** Rotate and blurs the skybox view in the main menu */ private void rotateAndBlurSkybox(float par1) { GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.viewportTexture); this.mc.renderEngine.func_98185_a(); GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColorMask(true, true, true, false); Tessellator var2 = Tessellator.instance; var2.startDrawingQuads(); byte var3 = 3; for (int var4 = 0; var4 < var3; ++var4) { var2.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F / (float) (var4 + 1)); int var5 = this.width; int var6 = this.height; float var7 = (float) (var4 - var3 / 2) / 256.0F; var2.addVertexWithUV( (double) var5, (double) var6, (double) this.zLevel, (double) (0.0F + var7), 0.0D); var2.addVertexWithUV((double) var5, 0.0D, (double) this.zLevel, (double) (1.0F + var7), 0.0D); var2.addVertexWithUV(0.0D, 0.0D, (double) this.zLevel, (double) (1.0F + var7), 1.0D); var2.addVertexWithUV(0.0D, (double) var6, (double) this.zLevel, (double) (0.0F + var7), 1.0D); } var2.draw(); GL11.glColorMask(true, true, true, true); this.mc.renderEngine.func_98185_a(); }
/** * Renders a texture that warps around based on the direction the player is looking. Texture needs * to be bound before being called. Used for the water overlay. Args: parialTickTime */ private void renderWarpedTextureOverlay(float par1) { Tessellator tessellator = Tessellator.instance; float f = mc.thePlayer.getBrightness(par1); GL11.glColor4f(f, f, f, 0.5F); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glPushMatrix(); float f1 = 4F; float f2 = -1F; float f3 = 1.0F; float f4 = -1F; float f5 = 1.0F; float f6 = -0.5F; float f7 = -mc.thePlayer.rotationYaw / 64F; float f8 = mc.thePlayer.rotationPitch / 64F; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(f2, f4, f6, f1 + f7, f1 + f8); tessellator.addVertexWithUV(f3, f4, f6, 0.0F + f7, f1 + f8); tessellator.addVertexWithUV(f3, f5, f6, 0.0F + f7, 0.0F + f8); tessellator.addVertexWithUV(f2, f5, f6, f1 + f7, 0.0F + f8); tessellator.draw(); GL11.glPopMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_BLEND); }
/** * Renders the texture of the block the player is inside as an overlay. Args: partialTickTime, * blockTextureIndex */ private void renderInsideOfBlock(float par1, int par2) { Tessellator tessellator = Tessellator.instance; float f = mc.thePlayer.getBrightness(par1); f = 0.1F; GL11.glColor4f(f, f, f, 0.5F); GL11.glPushMatrix(); float f1 = -1F; float f2 = 1.0F; float f3 = -1F; float f4 = 1.0F; float f5 = -0.5F; float f6 = 0.0078125F; float f7 = (float) (par2 % 16) / 256F - f6; float f8 = ((float) (par2 % 16) + 15.99F) / 256F + f6; float f9 = (float) (par2 / 16) / 256F - f6; float f10 = ((float) (par2 / 16) + 15.99F) / 256F + f6; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(f1, f3, f5, f8, f10); tessellator.addVertexWithUV(f2, f3, f5, f7, f10); tessellator.addVertexWithUV(f2, f4, f5, f7, f9); tessellator.addVertexWithUV(f1, f4, f5, f8, f9); tessellator.draw(); GL11.glPopMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); }
private void renderPortalOverlay(float var1, int var2, int var3) { if (var1 < 1.0F) { var1 *= var1; var1 *= var1; var1 = var1 * 0.8F + 0.2F; } GL11.glDisable(3008 /*GL_ALPHA_TEST*/); GL11.glDisable(2929 /*GL_DEPTH_TEST*/); GL11.glDepthMask(false); GL11.glBlendFunc(770, 771); GL11.glColor4f(1.0F, 1.0F, 1.0F, var1); GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, this.mc.renderEngine.getTexture("/terrain.png")); float var4 = (float) (Block.portal.blockIndexInTexture % 16) / 16.0F; float var5 = (float) (Block.portal.blockIndexInTexture / 16) / 16.0F; float var6 = (float) (Block.portal.blockIndexInTexture % 16 + 1) / 16.0F; float var7 = (float) (Block.portal.blockIndexInTexture / 16 + 1) / 16.0F; Tessellator var8 = Tessellator.instance; var8.startDrawingQuads(); var8.addVertexWithUV(0.0D, (double) var3, -90.0D, (double) var4, (double) var7); var8.addVertexWithUV((double) var2, (double) var3, -90.0D, (double) var6, (double) var7); var8.addVertexWithUV((double) var2, 0.0D, -90.0D, (double) var6, (double) var5); var8.addVertexWithUV(0.0D, 0.0D, -90.0D, (double) var4, (double) var5); var8.draw(); GL11.glDepthMask(true); GL11.glEnable(2929 /*GL_DEPTH_TEST*/); GL11.glEnable(3008 /*GL_ALPHA_TEST*/); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); }
/** draws the vertical line cursor in the textbox */ private void drawCursorVertical(int par1, int par2, int par3, int par4) { int var5; if (par1 < par3) { var5 = par1; par1 = par3; par3 = var5; } if (par2 < par4) { var5 = par2; par2 = par4; par4 = var5; } Tessellator var6 = Tessellator.instance; GL11.glColor4f(0.0F, 0.0F, 255.0F, 255.0F); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_COLOR_LOGIC_OP); GL11.glLogicOp(GL11.GL_OR_REVERSE); var6.startDrawingQuads(); var6.addVertex((double) par1, (double) par4, 0.0D); var6.addVertex((double) par3, (double) par4, 0.0D); var6.addVertex((double) par3, (double) par2, 0.0D); var6.addVertex((double) par1, (double) par2, 0.0D); var6.draw(); GL11.glDisable(GL11.GL_COLOR_LOGIC_OP); GL11.glEnable(GL11.GL_TEXTURE_2D); }
/** Overlays the background to hide scrolled items */ private void overlayBackground(int par1, int par2, int par3, int par4) { // Spout Start GL11.glPushMatrix(); // Spout End Tessellator var5 = Tessellator.instance; GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/background.png")); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); // Spout Start GL11.glTranslatef(0, 0, -0.1f); // Spout End float var6 = 32.0F; var5.startDrawingQuads(); var5.setColorRGBA_I(4210752, par4); var5.addVertexWithUV(0.0D, (double) par2, 0.0D, 0.0D, (double) ((float) par2 / var6)); var5.addVertexWithUV( (double) this.width, (double) par2, 0.0D, (double) ((float) this.width / var6), (double) ((float) par2 / var6)); var5.setColorRGBA_I(4210752, par3); var5.addVertexWithUV( (double) this.width, (double) par1, 0.0D, (double) ((float) this.width / var6), (double) ((float) par1 / var6)); var5.addVertexWithUV(0.0D, (double) par1, 0.0D, 0.0D, (double) ((float) par1 / var6)); var5.draw(); // Spout Start GL11.glPopMatrix(); // Spout End }
private void renderInsideOfBlock(float par1, int par2) { Tessellator var3 = Tessellator.instance; this.mc.thePlayer.getBrightness(par1); float var4 = 0.1F; GL11.glColor4f(var4, var4, var4, 0.5F); GL11.glPushMatrix(); float var5 = -1.0F; float var6 = 1.0F; float var7 = -1.0F; float var8 = 1.0F; float var9 = -0.5F; float var10 = 0.0078125F; float var11 = (float) (par2 % 16) / 256.0F - var10; float var12 = ((float) (par2 % 16) + 15.99F) / 256.0F + var10; float var13 = (float) (par2 / 16) / 256.0F - var10; float var14 = ((float) (par2 / 16) + 15.99F) / 256.0F + var10; var3.startDrawingQuads(); var3.addVertexWithUV( (double) var5, (double) var7, (double) var9, (double) var12, (double) var14); var3.addVertexWithUV( (double) var6, (double) var7, (double) var9, (double) var11, (double) var14); var3.addVertexWithUV( (double) var6, (double) var8, (double) var9, (double) var11, (double) var13); var3.addVertexWithUV( (double) var5, (double) var8, (double) var9, (double) var12, (double) var13); var3.draw(); GL11.glPopMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); }
private void renderMenuBlock(Block block, float f, RenderBlocks renderblocks) { int i = block.getRenderType(); renderblocks.setRenderBoundsFromBlock(block); Tessellator tessellator = Tessellator.instance; if (i == 0) { block.setBlockBoundsForItemRender(); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); float f1 = 0.5F; float f2 = 1.0F; float f3 = 0.8F; float f4 = 0.6F; tessellator.startDrawingQuads(); tessellator.setColorRGBA_F(f2, f2, f2, f); renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(0)); tessellator.setColorRGBA_F(f1, f1, f1, f); renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(1)); tessellator.setColorRGBA_F(f3, f3, f3, f); renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(2)); renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(3)); tessellator.setColorRGBA_F(f4, f4, f4, f); renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(4)); renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(5)); tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); } }
/** Draws a solid color rectangle with the specified coordinates and color. */ public static void drawRect(int par0, int par1, int par2, int par3, int par4) { int var5; if (par0 < par2) { var5 = par0; par0 = par2; par2 = var5; } if (par1 < par3) { var5 = par1; par1 = par3; par3 = var5; } float var10 = (float) (par4 >> 24 & 255) / 255.0F; float var6 = (float) (par4 >> 16 & 255) / 255.0F; float var7 = (float) (par4 >> 8 & 255) / 255.0F; float var8 = (float) (par4 & 255) / 255.0F; Tessellator var9 = Tessellator.instance; GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(var6, var7, var8, var10); var9.startDrawingQuads(); var9.addVertex((double) par0, (double) par3, 0.0D); var9.addVertex((double) par2, (double) par3, 0.0D); var9.addVertex((double) par2, (double) par1, 0.0D); var9.addVertex((double) par0, (double) par1, 0.0D); var9.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); }
/** Renders the skybox in the main menu */ private void renderSkybox(int par1, int par2, float par3) { GL11.glViewport(0, 0, 256, 256); drawPanorama(par1, par2, par3); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_TEXTURE_2D); rotateAndBlurSkybox(par3); rotateAndBlurSkybox(par3); rotateAndBlurSkybox(par3); rotateAndBlurSkybox(par3); rotateAndBlurSkybox(par3); rotateAndBlurSkybox(par3); rotateAndBlurSkybox(par3); rotateAndBlurSkybox(par3); GL11.glViewport(0, 0, mc.displayWidth, mc.displayHeight); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); float f = width <= height ? 120F / (float) height : 120F / (float) width; float f1 = ((float) height * f) / 256F; float f2 = ((float) width * f) / 256F; GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); int i = width; int j = height; tessellator.addVertexWithUV(0.0D, j, zLevel, 0.5F - f1, 0.5F + f2); tessellator.addVertexWithUV(i, j, zLevel, 0.5F - f1, 0.5F - f2); tessellator.addVertexWithUV(i, 0.0D, zLevel, 0.5F + f1, 0.5F - f2); tessellator.addVertexWithUV(0.0D, 0.0D, zLevel, 0.5F + f1, 0.5F + f2); tessellator.draw(); }
/** Draws a rectangle with a vertical gradient between the specified colors. */ protected void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6) { float var7 = (float) (par5 >> 24 & 255) / 255.0F; float var8 = (float) (par5 >> 16 & 255) / 255.0F; float var9 = (float) (par5 >> 8 & 255) / 255.0F; float var10 = (float) (par5 & 255) / 255.0F; float var11 = (float) (par6 >> 24 & 255) / 255.0F; float var12 = (float) (par6 >> 16 & 255) / 255.0F; float var13 = (float) (par6 >> 8 & 255) / 255.0F; float var14 = (float) (par6 & 255) / 255.0F; GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glShadeModel(GL11.GL_SMOOTH); Tessellator var15 = Tessellator.instance; var15.startDrawingQuads(); var15.setColorRGBA_F(var8, var9, var10, var7); var15.addVertex((double) par3, (double) par2, (double) this.zLevel); var15.addVertex((double) par1, (double) par2, (double) this.zLevel); var15.setColorRGBA_F(var12, var13, var14, var11); var15.addVertex((double) par1, (double) par4, (double) this.zLevel); var15.addVertex((double) par3, (double) par4, (double) this.zLevel); var15.draw(); GL11.glShadeModel(GL11.GL_FLAT); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_TEXTURE_2D); }
/** * Adds a vertex with the specified x,y,z to the current draw call. It will trigger a draw() if * the buffer gets full. */ public void addVertex(double par1, double par3, double par5) { addedVertices++; if (drawMode == 7 && convertQuadsToTriangles && addedVertices % 4 == 0) { for (int i = 0; i < 2; i++) { int j = 8 * (3 - i); if (hasTexture) { rawBuffer[rawBufferIndex + 3] = rawBuffer[(rawBufferIndex - j) + 3]; rawBuffer[rawBufferIndex + 4] = rawBuffer[(rawBufferIndex - j) + 4]; } if (hasBrightness) { rawBuffer[rawBufferIndex + 7] = rawBuffer[(rawBufferIndex - j) + 7]; } if (hasColor) { rawBuffer[rawBufferIndex + 5] = rawBuffer[(rawBufferIndex - j) + 5]; } rawBuffer[rawBufferIndex + 0] = rawBuffer[(rawBufferIndex - j) + 0]; rawBuffer[rawBufferIndex + 1] = rawBuffer[(rawBufferIndex - j) + 1]; rawBuffer[rawBufferIndex + 2] = rawBuffer[(rawBufferIndex - j) + 2]; vertexCount++; rawBufferIndex += 8; } } if (hasTexture) { rawBuffer[rawBufferIndex + 3] = Float.floatToRawIntBits((float) textureU); rawBuffer[rawBufferIndex + 4] = Float.floatToRawIntBits((float) textureV); } if (hasBrightness) { rawBuffer[rawBufferIndex + 7] = brightness; } if (hasColor) { rawBuffer[rawBufferIndex + 5] = color; } if (hasNormals) { rawBuffer[rawBufferIndex + 6] = normal; } rawBuffer[rawBufferIndex + 0] = Float.floatToRawIntBits((float) (par1 + xOffset)); rawBuffer[rawBufferIndex + 1] = Float.floatToRawIntBits((float) (par3 + yOffset)); rawBuffer[rawBufferIndex + 2] = Float.floatToRawIntBits((float) (par5 + zOffset)); rawBufferIndex += 8; vertexCount++; if (vertexCount % 4 == 0 && rawBufferIndex >= bufferSize - 32) { draw(); isDrawing = true; } }
/** Renders the animation for when an enderdragon dies */ protected void renderDragonDying(EntityDragon par1EntityDragon, float par2) { super.renderEquippedItems(par1EntityDragon, par2); Tessellator tessellator = Tessellator.instance; if (par1EntityDragon.deathTicks > 0) { RenderHelper.disableStandardItemLighting(); float f = ((float) par1EntityDragon.deathTicks + par2) / 200F; float f1 = 0.0F; if (f > 0.8F) { f1 = (f - 0.8F) / 0.2F; } Random random = new Random(432L); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDepthMask(false); GL11.glPushMatrix(); GL11.glTranslatef(0.0F, -1F, -2F); for (int i = 0; (float) i < ((f + f * f) / 2.0F) * 60F; i++) { GL11.glRotatef(random.nextFloat() * 360F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(random.nextFloat() * 360F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(random.nextFloat() * 360F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(random.nextFloat() * 360F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(random.nextFloat() * 360F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(random.nextFloat() * 360F + f * 90F, 0.0F, 0.0F, 1.0F); tessellator.startDrawing(6); float f2 = random.nextFloat() * 20F + 5F + f1 * 10F; float f3 = random.nextFloat() * 2.0F + 1.0F + f1 * 2.0F; tessellator.setColorRGBA_I(0xffffff, (int) (255F * (1.0F - f1))); tessellator.addVertex(0.0D, 0.0D, 0.0D); tessellator.setColorRGBA_I(0xff00ff, 0); tessellator.addVertex(-0.86599999999999999D * (double) f3, f2, -0.5F * f3); tessellator.addVertex(0.86599999999999999D * (double) f3, f2, -0.5F * f3); tessellator.addVertex(0.0D, f2, 1.0F * f3); tessellator.addVertex(-0.86599999999999999D * (double) f3, f2, -0.5F * f3); tessellator.draw(); } GL11.glPopMatrix(); GL11.glDepthMask(true); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); GL11.glShadeModel(GL11.GL_FLAT); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_ALPHA_TEST); RenderHelper.enableStandardItemLighting(); } }
public void func_6274_a(int i, int j, int k, int l, int i1, int j1) { float f = 0.00390625F; float f1 = 0.00390625F; Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(i + 0, j + j1, 0.0D, (float) (k + 0) * f, (float) (l + j1) * f1); tessellator.addVertexWithUV(i + i1, j + j1, 0.0D, (float) (k + i1) * f, (float) (l + j1) * f1); tessellator.addVertexWithUV(i + i1, j + 0, 0.0D, (float) (k + i1) * f, (float) (l + 0) * f1); tessellator.addVertexWithUV(i + 0, j + 0, 0.0D, (float) (k + 0) * f, (float) (l + 0) * f1); tessellator.draw(); }
protected void renderLivingLabel( EntityLiving var1, String var2, double var3, double var5, double var7, int var9, int color, int color2) { // Spout end float var10 = var1.getDistanceToEntity(this.renderManager.livingPlayer); if (var10 <= (float) var9) { FontRenderer var11 = this.getFontRendererFromRenderManager(); float var12 = 1.6F; float var13 = 0.016666668F * var12; GL11.glPushMatrix(); GL11.glTranslatef((float) var3 + 0.0F, (float) var5 + 2.3F, (float) var7); GL11.glNormal3f(0.0F, 1.0F, 0.0F); GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); GL11.glScalef(-var13, -var13, var13); GL11.glDisable(2896 /*GL_LIGHTING*/); GL11.glDepthMask(false); GL11.glDisable(2929 /*GL_DEPTH_TEST*/); GL11.glEnable(3042 /*GL_BLEND*/); GL11.glBlendFunc(770, 771); Tessellator var14 = Tessellator.instance; byte var15 = 0; if (var2.equals("deadmau5")) { var15 = -10; } GL11.glDisable(3553 /*GL_TEXTURE_2D*/); var14.startDrawingQuads(); int var16 = var11.getStringWidth(var2) / 2; var14.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); var14.addVertex((double) (-var16 - 1), (double) (-1 + var15), 0.0D); var14.addVertex((double) (-var16 - 1), (double) (8 + var15), 0.0D); var14.addVertex((double) (var16 + 1), (double) (8 + var15), 0.0D); var14.addVertex((double) (var16 + 1), (double) (-1 + var15), 0.0D); var14.draw(); GL11.glEnable(3553 /*GL_TEXTURE_2D*/); var11.drawString( var2, -var11.getStringWidth(var2) / 2, var15, color); // Spout (changed to color var) GL11.glEnable(2929 /*GL_DEPTH_TEST*/); GL11.glDepthMask(true); var11.drawString( var2, -var11.getStringWidth(var2) / 2, var15, color2); // Spout (changed to color2 var) GL11.glEnable(2896 /*GL_LIGHTING*/); GL11.glDisable(3042 /*GL_BLEND*/); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glPopMatrix(); } }
/** Draws the debug or playername text above a living */ protected void renderLivingLabel( EntityLiving par1EntityLiving, String par2Str, double par3, double par5, double par7, int par9) { float f = par1EntityLiving.getDistanceToEntity(renderManager.livingPlayer); if (f > (float) par9) { return; } FontRenderer fontrenderer = getFontRendererFromRenderManager(); float f1 = 1.6F; float f2 = 0.01666667F * f1; GL11.glPushMatrix(); GL11.glTranslatef((float) par3 + 0.0F, (float) par5 + 2.3F, (float) par7); GL11.glNormal3f(0.0F, 1.0F, 0.0F); GL11.glRotatef(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(renderManager.playerViewX, 1.0F, 0.0F, 0.0F); GL11.glScalef(-f2, -f2, f2); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthMask(false); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); Tessellator tessellator = Tessellator.instance; byte byte0 = 0; if (par2Str.equals("deadmau5")) { byte0 = -10; } GL11.glDisable(GL11.GL_TEXTURE_2D); tessellator.startDrawingQuads(); int i = fontrenderer.getStringWidth(par2Str) / 2; tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); tessellator.addVertex(-i - 1, -1 + byte0, 0.0D); tessellator.addVertex(-i - 1, 8 + byte0, 0.0D); tessellator.addVertex(i + 1, 8 + byte0, 0.0D); tessellator.addVertex(i + 1, -1 + byte0, 0.0D); tessellator.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); fontrenderer.drawString(par2Str, -fontrenderer.getStringWidth(par2Str) / 2, byte0, 0x20ffffff); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDepthMask(true); fontrenderer.drawString(par2Str, -fontrenderer.getStringWidth(par2Str) / 2, byte0, -1); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_BLEND); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glPopMatrix(); }
/** Used to render a player's name above their head */ protected void renderName(EntityPlayer par1EntityPlayer, double par2, double par4, double par6) { if (Minecraft.isGuiEnabled() && par1EntityPlayer != renderManager.livingPlayer) { float f = 1.6F; float f1 = 0.01666667F * f; float f2 = par1EntityPlayer.getDistanceToEntity(renderManager.livingPlayer); float f3 = par1EntityPlayer.isSneaking() ? 32F : 64F; if (f2 < f3) { String s = par1EntityPlayer.username; if (!par1EntityPlayer.isSneaking()) { if (par1EntityPlayer.isPlayerSleeping()) { renderLivingLabel(par1EntityPlayer, s, par2, par4 - 1.5D, par6, 64); } else { renderLivingLabel(par1EntityPlayer, s, par2, par4, par6, 64); } } else { FontRenderer fontrenderer = getFontRendererFromRenderManager(); GL11.glPushMatrix(); GL11.glTranslatef((float) par2 + 0.0F, (float) par4 + 2.3F, (float) par6); GL11.glNormal3f(0.0F, 1.0F, 0.0F); GL11.glRotatef(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(renderManager.playerViewX, 1.0F, 0.0F, 0.0F); GL11.glScalef(-f1, -f1, f1); GL11.glDisable(GL11.GL_LIGHTING); GL11.glTranslatef(0.0F, 0.25F / f1, 0.0F); GL11.glDepthMask(false); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); Tessellator tessellator = Tessellator.instance; GL11.glDisable(GL11.GL_TEXTURE_2D); tessellator.startDrawingQuads(); int i = fontrenderer.getStringWidth(s) / 2; tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); tessellator.addVertex(-i - 1, -1D, 0.0D); tessellator.addVertex(-i - 1, 8D, 0.0D); tessellator.addVertex(i + 1, 8D, 0.0D); tessellator.addVertex(i + 1, -1D, 0.0D); tessellator.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDepthMask(true); fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 0x20ffffff); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_BLEND); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glPopMatrix(); } } } }
// Renders the look of the fence in Inventory public void RenderInvBlock(RenderBlocks renderblocks, Block block, int i, int j) { Tessellator tessellator = Tessellator.instance; // (0.0F, wallBottom, wallOffset, 1.0F, wallHeight, wallWidth); block.setBlockBounds(0.0F, 0.0F, 0.3F, 1.0F, 0.8F, 0.7F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1F, 0.0F); renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(0)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(1)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1F); renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(2)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(3)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1F, 0.0F, 0.0F); renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(4)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(5)); tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); }
private void RenderMissileInInv(RenderBlocks renderer, Block block, int metadata) { Tessellator tesselator = Tessellator.instance; int sideTex = 0; int topTex = 0; for (int i = 0; i < 6; i++) { // Get bounds for each rectangle if (i == 0) block.setBlockBounds(0.4F, 0.95F, 0.4F, 0.6F, 1.0F, 0.6F); else if (i == 1) block.setBlockBounds(0.3F, 0.0F, 0.3F, 0.7F, 0.95F, 0.7F); else if (i == 2) block.setBlockBounds(0.4F, 0F, 0.1F, 0.6F, 0.4F, 0.3F); else if (i == 3) block.setBlockBounds(0.4F, 0F, 0.7F, 0.6F, 0.4F, 0.9F); else if (i == 4) block.setBlockBounds(0.1F, 0F, 0.4F, 0.3F, 0.4F, 0.6F); else if (i == 5) block.setBlockBounds(0.7F, 0F, 0.4F, 0.9F, 0.4F, 0.6F); // Get textures if (i == 0 && metadata != 0 && metadata != 15) { topTex = 15; sideTex = block.getBlockTextureFromSideAndMetadata(1, metadata); } else if (i == 0) { topTex = 18; sideTex = block.getBlockTextureFromSideAndMetadata(1, metadata); } else if (i == 1 && metadata != 0 && metadata != 15) { sideTex = block.getBlockTextureFromSideAndMetadata(1, 1); topTex = block.getBlockTextureFromSideAndMetadata(1, 1); } else if (i == 1) { sideTex = block.getBlockTextureFromSideAndMetadata(1, metadata); topTex = block.getBlockTextureFromSideAndMetadata(1, metadata); } else if (metadata != 0 && metadata != 15) { sideTex = topTex = 15; } else { sideTex = topTex = 18; } GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tesselator.startDrawingQuads(); tesselator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderBottomFace(block, 0.0D, 0.0D, 0.0D, sideTex); tesselator.draw(); tesselator.startDrawingQuads(); tesselator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderTopFace(block, 0.0D, 0.0D, 0.0D, topTex); tesselator.draw(); tesselator.startDrawingQuads(); tesselator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderEastFace(block, 0.0D, 0.0D, 0.0D, sideTex); tesselator.draw(); tesselator.startDrawingQuads(); tesselator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderWestFace(block, 0.0D, 0.0D, 0.0D, sideTex); tesselator.draw(); tesselator.startDrawingQuads(); tesselator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderNorthFace(block, 0.0D, 0.0D, 0.0D, sideTex); tesselator.draw(); tesselator.startDrawingQuads(); tesselator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderSouthFace(block, 0.0D, 0.0D, 0.0D, sideTex); tesselator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); } block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); }
private void overlayBackground(int i, int j, int k, int l) { Tessellator tessellator = Tessellator.instance; GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/gui/background.png")); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); float f = 32F; tessellator.startDrawingQuads(); tessellator.setColorRGBA_I(0x404040, l); tessellator.addVertexWithUV(0.0D, j, 0.0D, 0.0D, (float) j / f); tessellator.addVertexWithUV(width, j, 0.0D, (float) width / f, (float) j / f); tessellator.setColorRGBA_I(0x404040, k); tessellator.addVertexWithUV(width, i, 0.0D, (float) width / f, (float) i / f); tessellator.addVertexWithUV(0.0D, i, 0.0D, 0.0D, (float) i / f); tessellator.draw(); }
/** Kronos: Fonction pour dessiner des models au ratio 1:1 */ public void drawRealTexturedModalRect( int par1, int par2, int par3, int par4, int par5, int par6) { float f = 0.00390625F * 2; float f1 = 0.00390625F * 2; Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV( par1 + 0, par2 + par6, zLevel, (float) (par3 + 0) * f, (float) (par4 + par6) * f1); tessellator.addVertexWithUV( par1 + par5, par2 + par6, zLevel, (float) (par3 + par5) * f, (float) (par4 + par6) * f1); tessellator.addVertexWithUV( par1 + par5, par2 + 0, zLevel, (float) (par3 + par5) * f, (float) (par4 + 0) * f1); tessellator.addVertexWithUV( par1 + 0, par2 + 0, zLevel, (float) (par3 + 0) * f, (float) (par4 + 0) * f1); tessellator.draw(); }
/** Kronos: Fonction pour dessiner des images de plus de 256x256 */ public void drawOverTexturedModalRect( int par1, int par2, int par3, int par4, int par5, int par6) { float fx = (float) 1 / (par5 / 2); float fy = (float) 1 / (par6 / 2); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV( par1 + 0, par2 + par6, zLevel, (float) (par3 + 0) * fx, (float) (par4 + par6) * fy); tessellator.addVertexWithUV( par1 + par5, par2 + par6, zLevel, (float) (par3 + par5) * fx, (float) (par4 + par6) * fy); tessellator.addVertexWithUV( par1 + par5, par2 + 0, zLevel, (float) (par3 + par5) * fx, (float) (par4 + 0) * fy); tessellator.addVertexWithUV( par1 + 0, par2 + 0, zLevel, (float) (par3 + 0) * fx, (float) (par4 + 0) * fy); tessellator.draw(); }
private void renderWarpedTextureOverlay(float par1) { Tessellator var2 = Tessellator.instance; float var3 = this.mc.thePlayer.getBrightness(par1); GL11.glColor4f(var3, var3, var3, 0.5F); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glPushMatrix(); float var4 = 4.0F; float var5 = -1.0F; float var6 = 1.0F; float var7 = -1.0F; float var8 = 1.0F; float var9 = -0.5F; float var10 = -this.mc.thePlayer.rotationYaw / 64.0F; float var11 = this.mc.thePlayer.rotationPitch / 64.0F; var2.startDrawingQuads(); var2.addVertexWithUV( (double) var5, (double) var7, (double) var9, (double) (var4 + var10), (double) (var4 + var11)); var2.addVertexWithUV( (double) var6, (double) var7, (double) var9, (double) (0.0F + var10), (double) (var4 + var11)); var2.addVertexWithUV( (double) var6, (double) var8, (double) var9, (double) (0.0F + var10), (double) (0.0F + var11)); var2.addVertexWithUV( (double) var5, (double) var8, (double) var9, (double) (var4 + var10), (double) (0.0F + var11)); var2.draw(); GL11.glPopMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_BLEND); }