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); }
/** Draws the screen and all the components in it. */ public void drawScreen(int par1, int par2, float par3) { this.renderSkybox(par1, par2, par3); Tessellator var4 = Tessellator.instance; short var5 = 274; int var6 = this.width / 2 - var5 / 2; byte var7 = 30; this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215); this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE); GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/title/mclogo.png")); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); if ((double) this.updateCounter < 1.0E-4D) { this.drawTexturedModalRect(var6 + 0, var7 + 0, 0, 0, 99, 44); this.drawTexturedModalRect(var6 + 99, var7 + 0, 129, 0, 27, 44); this.drawTexturedModalRect(var6 + 99 + 26, var7 + 0, 126, 0, 3, 44); this.drawTexturedModalRect(var6 + 99 + 26 + 3, var7 + 0, 99, 0, 26, 44); this.drawTexturedModalRect(var6 + 155, var7 + 0, 0, 45, 155, 44); } else { this.drawTexturedModalRect(var6 + 0, var7 + 0, 0, 0, 155, 44); this.drawTexturedModalRect(var6 + 155, var7 + 0, 0, 45, 155, 44); } var4.setColorOpaque_I(16777215); GL11.glPushMatrix(); GL11.glTranslatef((float) (this.width / 2 + 90), 70.0F, 0.0F); GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F); float var8 = 1.8F - MathHelper.abs( MathHelper.sin( (float) (Minecraft.getSystemTime() % 1000L) / 1000.0F * (float) Math.PI * 2.0F) * 0.1F); var8 = var8 * 100.0F / (float) (this.fontRenderer.getStringWidth(this.splashText) + 32); GL11.glScalef(var8, var8, var8); this.drawCenteredString(this.fontRenderer, this.splashText, 0, -8, 16776960); GL11.glPopMatrix(); String var9 = "Minecraft 1.3.2"; if (this.mc.isDemo()) { var9 = var9 + " Demo"; } this.drawString(this.fontRenderer, var9, 2, this.height - 10, 16777215); String var10 = "Copyright Mojang AB. Ported by Nick Parker"; this.drawString( this.fontRenderer, var10, this.width - this.fontRenderer.getStringWidth(var10) - 2, this.height - 10, 16777215); super.drawScreen(par1, par2, par3); }
private void loadScreen() throws LWJGLException { ScaledResolution scaledresolution = new ScaledResolution(gameSettings, displayWidth, displayHeight); GL11.glClear(16640); GL11.glMatrixMode(5889 /*GL_PROJECTION*/); GL11.glLoadIdentity(); GL11.glOrtho( 0.0D, scaledresolution.field_25121_a, scaledresolution.field_25120_b, 0.0D, 1000D, 3000D); GL11.glMatrixMode(5888 /*GL_MODELVIEW0_ARB*/); GL11.glLoadIdentity(); GL11.glTranslatef(0.0F, 0.0F, -2000F); GL11.glViewport(0, 0, displayWidth, displayHeight); GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F); Tessellator tessellator = Tessellator.instance; GL11.glDisable(2896 /*GL_LIGHTING*/); GL11.glEnable(3553 /*GL_TEXTURE_2D*/); GL11.glDisable(2912 /*GL_FOG*/); GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, renderEngine.getTexture("/title/mojang.png")); tessellator.startDrawingQuads(); tessellator.setColorOpaque_I(0xffffff); tessellator.addVertexWithUV(0.0D, displayHeight, 0.0D, 0.0D, 0.0D); tessellator.addVertexWithUV(displayWidth, displayHeight, 0.0D, 0.0D, 0.0D); tessellator.addVertexWithUV(displayWidth, 0.0D, 0.0D, 0.0D, 0.0D); tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D); tessellator.draw(); char c = '\u0100'; char c1 = '\u0100'; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); tessellator.setColorOpaque_I(0xffffff); func_6274_a( (scaledresolution.getScaledWidth() - c) / 2, (scaledresolution.getScaledHeight() - c1) / 2, 0, 0, c, c1); GL11.glDisable(2896 /*GL_LIGHTING*/); GL11.glDisable(2912 /*GL_FOG*/); GL11.glEnable(3008 /*GL_ALPHA_TEST*/); GL11.glAlphaFunc(516, 0.1F); Display.swapBuffers(); }
public void doRenderFishHook( EntityFishHook entityfishhook, double d, double d1, double d2, float f, float f1) { GL11.glPushMatrix(); GL11.glTranslatef((float) d, (float) d1, (float) d2); GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/); GL11.glScalef(0.5F, 0.5F, 0.5F); int i = 1; byte byte0 = 2; loadTexture("/particles.png"); Tessellator tessellator = Tessellator.instance; float f2 = (float) (i * 8 + 0) / 128F; float f3 = (float) (i * 8 + 8) / 128F; float f4 = (float) (byte0 * 8 + 0) / 128F; float f5 = (float) (byte0 * 8 + 8) / 128F; float f6 = 1.0F; float f7 = 0.5F; float f8 = 0.5F; GL11.glRotatef(180F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); tessellator.addVertexWithUV(0.0F - f7, 0.0F - f8, 0.0D, f2, f5); tessellator.addVertexWithUV(f6 - f7, 0.0F - f8, 0.0D, f3, f5); tessellator.addVertexWithUV(f6 - f7, 1.0F - f8, 0.0D, f3, f4); tessellator.addVertexWithUV(0.0F - f7, 1.0F - f8, 0.0D, f2, f4); tessellator.draw(); GL11.glDisable(32826 /*GL_RESCALE_NORMAL_EXT*/); GL11.glPopMatrix(); if (entityfishhook.angler != null) { float f9 = ((entityfishhook.angler.prevRotationYaw + (entityfishhook.angler.rotationYaw - entityfishhook.angler.prevRotationYaw) * f1) * 3.141593F) / 180F; double d3 = MathHelper.sin(f9); double d5 = MathHelper.cos(f9); float f11 = entityfishhook.angler.getSwingProgress(f1); float f12 = MathHelper.sin(MathHelper.sqrt_float(f11) * 3.141593F); Vec3D vec3d = Vec3D.createVector(-0.5D, 0.029999999999999999D, 0.80000000000000004D); vec3d.rotateAroundX( (-(entityfishhook.angler.prevRotationPitch + (entityfishhook.angler.rotationPitch - entityfishhook.angler.prevRotationPitch) * f1) * 3.141593F) / 180F); vec3d.rotateAroundY( (-(entityfishhook.angler.prevRotationYaw + (entityfishhook.angler.rotationYaw - entityfishhook.angler.prevRotationYaw) * f1) * 3.141593F) / 180F); vec3d.rotateAroundY(f12 * 0.5F); vec3d.rotateAroundX(-f12 * 0.7F); double d7 = entityfishhook.angler.prevPosX + (entityfishhook.angler.posX - entityfishhook.angler.prevPosX) * (double) f1 + vec3d.xCoord; double d8 = entityfishhook.angler.prevPosY + (entityfishhook.angler.posY - entityfishhook.angler.prevPosY) * (double) f1 + vec3d.yCoord; double d9 = entityfishhook.angler.prevPosZ + (entityfishhook.angler.posZ - entityfishhook.angler.prevPosZ) * (double) f1 + vec3d.zCoord; if (renderManager.options.thirdPersonView > 0) { float f10 = ((entityfishhook.angler.prevRenderYawOffset + (entityfishhook.angler.renderYawOffset - entityfishhook.angler.prevRenderYawOffset) * f1) * 3.141593F) / 180F; double d4 = MathHelper.sin(f10); double d6 = MathHelper.cos(f10); d7 = (entityfishhook.angler.prevPosX + (entityfishhook.angler.posX - entityfishhook.angler.prevPosX) * (double) f1) - d6 * 0.34999999999999998D - d4 * 0.84999999999999998D; d8 = (entityfishhook.angler.prevPosY + (entityfishhook.angler.posY - entityfishhook.angler.prevPosY) * (double) f1) - 0.45000000000000001D; d9 = ((entityfishhook.angler.prevPosZ + (entityfishhook.angler.posZ - entityfishhook.angler.prevPosZ) * (double) f1) - d4 * 0.34999999999999998D) + d6 * 0.84999999999999998D; } double d10 = entityfishhook.prevPosX + (entityfishhook.posX - entityfishhook.prevPosX) * (double) f1; double d11 = entityfishhook.prevPosY + (entityfishhook.posY - entityfishhook.prevPosY) * (double) f1 + 0.25D; double d12 = entityfishhook.prevPosZ + (entityfishhook.posZ - entityfishhook.prevPosZ) * (double) f1; double d13 = (float) (d7 - d10); double d14 = (float) (d8 - d11); double d15 = (float) (d9 - d12); GL11.glDisable(3553 /*GL_TEXTURE_2D*/); GL11.glDisable(2896 /*GL_LIGHTING*/); tessellator.startDrawing(3); tessellator.setColorOpaque_I(0); int j = 16; for (int k = 0; k <= j; k++) { float f13 = (float) k / (float) j; tessellator.addVertex( d + d13 * (double) f13, d1 + d14 * (double) (f13 * f13 + f13) * 0.5D + 0.25D, d2 + d15 * (double) f13); } tessellator.draw(); GL11.glEnable(2896 /*GL_LIGHTING*/); GL11.glEnable(3553 /*GL_TEXTURE_2D*/); } }
/** Draws the screen and all the components in it. */ public void drawScreen(int par1, int par2, float par3) { this.renderSkybox(par1, par2, par3); Tessellator var4 = Tessellator.instance; short var5 = 274; int var6 = this.width / 2 - var5 / 2; byte var7 = 30; this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215); this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE); this.mc.renderEngine.func_98187_b("/title/mclogo.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); if ((double) this.updateCounter < 1.0E-4D) { this.drawTexturedModalRect(var6 + 0, var7 + 0, 0, 0, 99, 44); this.drawTexturedModalRect(var6 + 99, var7 + 0, 129, 0, 27, 44); this.drawTexturedModalRect(var6 + 99 + 26, var7 + 0, 126, 0, 3, 44); this.drawTexturedModalRect(var6 + 99 + 26 + 3, var7 + 0, 99, 0, 26, 44); this.drawTexturedModalRect(var6 + 155, var7 + 0, 0, 45, 155, 44); } else { this.drawTexturedModalRect(var6 + 0, var7 + 0, 0, 0, 155, 44); this.drawTexturedModalRect(var6 + 155, var7 + 0, 0, 45, 155, 44); } var4.setColorOpaque_I(16777215); GL11.glPushMatrix(); GL11.glTranslatef((float) (this.width / 2 + 90), 70.0F, 0.0F); GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F); float var8 = 1.8F - MathHelper.abs( MathHelper.sin( (float) (Minecraft.getSystemTime() % 1000L) / 1000.0F * (float) Math.PI * 2.0F) * 0.1F); var8 = var8 * 100.0F / (float) (this.fontRenderer.getStringWidth(this.splashText) + 32); GL11.glScalef(var8, var8, var8); this.drawCenteredString(this.fontRenderer, this.splashText, 0, -8, 16776960); GL11.glPopMatrix(); String var9 = "Minecraft 1.5"; if (this.mc.isDemo()) { var9 = var9 + " Demo"; } this.drawString(this.fontRenderer, var9, 2, this.height - 10, 16777215); String var10 = "Copyright Mojang AB. Do not distribute!"; this.drawString( this.fontRenderer, var10, this.width - this.fontRenderer.getStringWidth(var10) - 2, this.height - 10, 16777215); if (this.field_92025_p != null && this.field_92025_p.length() > 0) { drawRect( this.field_92022_t - 2, this.field_92021_u - 2, this.field_92020_v + 2, this.field_92019_w - 1, 1428160512); this.drawString( this.fontRenderer, this.field_92025_p, this.field_92022_t, this.field_92021_u, 16777215); this.drawString( this.fontRenderer, field_96138_a, (this.width - this.field_92024_r) / 2, ((GuiButton) this.buttonList.get(0)).yPosition - 12, 16777215); } super.drawScreen(par1, par2, par3); }
/** Renders the dragon, along with its dying animation */ public void renderDragon( EntityDragon par1EntityDragon, double par2, double par4, double par6, float par8, float par9) { entityDragon = par1EntityDragon; if (updateModelState != 4) { mainModel = new ModelDragon(0.0F); updateModelState = 4; } super.doRenderLiving(par1EntityDragon, par2, par4, par6, par8, par9); if (par1EntityDragon.healingEnderCrystal != null) { float f = (float) par1EntityDragon.healingEnderCrystal.innerRotation + par9; float f1 = MathHelper.sin(f * 0.2F) / 2.0F + 0.5F; f1 = (f1 * f1 + f1) * 0.2F; float f2 = (float) (par1EntityDragon.healingEnderCrystal.posX - par1EntityDragon.posX - (par1EntityDragon.prevPosX - par1EntityDragon.posX) * (double) (1.0F - par9)); float f3 = (float) (((double) f1 + par1EntityDragon.healingEnderCrystal.posY) - 1.0D - par1EntityDragon.posY - (par1EntityDragon.prevPosY - par1EntityDragon.posY) * (double) (1.0F - par9)); float f4 = (float) (par1EntityDragon.healingEnderCrystal.posZ - par1EntityDragon.posZ - (par1EntityDragon.prevPosZ - par1EntityDragon.posZ) * (double) (1.0F - par9)); float f5 = MathHelper.sqrt_float(f2 * f2 + f4 * f4); float f6 = MathHelper.sqrt_float(f2 * f2 + f3 * f3 + f4 * f4); GL11.glPushMatrix(); GL11.glTranslatef((float) par2, (float) par4 + 2.0F, (float) par6); GL11.glRotatef( ((float) (-Math.atan2(f4, f2)) * 180F) / (float) Math.PI - 90F, 0.0F, 1.0F, 0.0F); GL11.glRotatef( ((float) (-Math.atan2(f5, f3)) * 180F) / (float) Math.PI - 90F, 1.0F, 0.0F, 0.0F); Tessellator tessellator = Tessellator.instance; RenderHelper.disableStandardItemLighting(); GL11.glDisable(GL11.GL_CULL_FACE); loadTexture("/mob/enderdragon/beam.png"); GL11.glShadeModel(GL11.GL_SMOOTH); float f7 = 0.0F - ((float) par1EntityDragon.ticksExisted + par9) * 0.01F; float f8 = MathHelper.sqrt_float(f2 * f2 + f3 * f3 + f4 * f4) / 32F - ((float) par1EntityDragon.ticksExisted + par9) * 0.01F; tessellator.startDrawing(5); int i = 8; for (int j = 0; j <= i; j++) { float f9 = MathHelper.sin(((float) (j % i) * (float) Math.PI * 2.0F) / (float) i) * 0.75F; float f10 = MathHelper.cos(((float) (j % i) * (float) Math.PI * 2.0F) / (float) i) * 0.75F; float f11 = ((float) (j % i) * 1.0F) / (float) i; tessellator.setColorOpaque_I(0); tessellator.addVertexWithUV(f9 * 0.2F, f10 * 0.2F, 0.0D, f11, f8); tessellator.setColorOpaque_I(0xffffff); tessellator.addVertexWithUV(f9, f10, f6, f11, f7); } tessellator.draw(); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glShadeModel(GL11.GL_FLAT); RenderHelper.enableStandardItemLighting(); GL11.glPopMatrix(); } }
/** Draws the screen and all the components in it. */ public void drawScreen(int par1, int par2, float par3) { if (panorama) { renderSkybox(par1, par2, par3); } else { drawDefaultBackground(); } Tessellator tessellator = Tessellator.instance; if (oldlogo) { drawLogo(par3); } char c = 274; int i = width / 2 - c / 2; byte byte0 = 30; if (panorama) { drawGradientRect(0, 0, width, height, 0x80ffffff, 0xffffff); drawGradientRect(0, 0, width, height, 0, 0x80000000); } if (!oldlogo) { mc.func_110434_K().func_110577_a(field_110352_y); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); if ((double) updateCounter < 0.0001D) { drawTexturedModalRect(i + 0, byte0 + 0, 0, 0, 99, 44); drawTexturedModalRect(i + 99, byte0 + 0, 129, 0, 27, 44); drawTexturedModalRect(i + 99 + 26, byte0 + 0, 126, 0, 3, 44); drawTexturedModalRect(i + 99 + 26 + 3, byte0 + 0, 99, 0, 26, 44); drawTexturedModalRect(i + 155, byte0 + 0, 0, 45, 155, 44); } else { drawTexturedModalRect(i + 0, byte0 + 0, 0, 0, 155, 44); drawTexturedModalRect(i + 155, byte0 + 0, 0, 45, 155, 44); } } tessellator.setColorOpaque_I(0xffffff); GL11.glPushMatrix(); GL11.glTranslatef(width / 2 + 90, 70F, 0.0F); GL11.glRotatef(-20F, 0.0F, 0.0F, 1.0F); float f = 1.8F - MathHelper.abs( MathHelper.sin( ((float) (Minecraft.getSystemTime() % 1000L) / 1000F) * (float) Math.PI * 2.0F) * 0.1F); f = (f * 100F) / (float) (fontRenderer.getStringWidth(splashText) + 32); GL11.glScalef(f, f, f); drawCenteredString(fontRenderer, splashText, 0, -8, 0xffff00); GL11.glPopMatrix(); String s = version.contains(":") ? version.split(":", 2)[1] : version; if (s.equals("OFF")) { s = "Minecraft " + (new CallableMinecraftVersion(null)).minecraftVersion(); } if (mc.isDemo()) { s = (new StringBuilder()).append(s).append(" Demo").toString(); } if (panorama) { drawString(fontRenderer, s, 2, height - 10, 0xffffff); } else { drawString(fontRenderer, s, 2, 2, 0x505050); } String s1 = "Copyright Mojang AB. Do not distribute!"; drawString( fontRenderer, s1, width - fontRenderer.getStringWidth(s1) - 2, height - 10, 0xffffff); if (field_92025_p != null && field_92025_p.length() > 0) { drawRect( field_92022_t - 2, field_92021_u - 2, field_92020_v + 2, field_92019_w - 1, 0x55200000); drawString(fontRenderer, field_92025_p, field_92022_t, field_92021_u, 0xffffff); drawString( fontRenderer, field_96138_a, (width - field_92024_r) / 2, ((GuiButton) buttonList.get(0)).yPosition - 12, 0xffffff); } super.drawScreen(par1, par2, par3); }
/** draws the slot to the screen, pass in mouse's current x and y and partial ticks */ public void drawScreen(int par1, int par2, float par3) { this.mouseX = par1; this.mouseY = par2; this.drawBackground(); int var4 = this.getSize(); int var5 = this.getScrollBarX(); int var6 = var5 + 6; int var9; int var10; int var11; int var13; int var19; if (Mouse.isButtonDown(0)) { if (this.initialClickY == -1.0F) { boolean var7 = true; if (par2 >= this.top && par2 <= this.bottom) { int var8 = this.width / 2 - 110; var9 = this.width / 2 + 110; var10 = par2 - this.top - this.field_77242_t + (int) this.amountScrolled - 4; var11 = var10 / this.slotHeight; if (par1 >= var8 && par1 <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) { boolean var12 = var11 == this.selectedElement && Minecraft.getSystemTime() - this.lastClicked < 250L; this.elementClicked(var11, var12); this.selectedElement = var11; this.lastClicked = Minecraft.getSystemTime(); } else if (par1 >= var8 && par1 <= var9 && var10 < 0) { this.func_77224_a(par1 - var8, par2 - this.top + (int) this.amountScrolled - 4); var7 = false; } if (par1 >= var5 && par1 <= var6) { this.scrollMultiplier = -1.0F; var19 = this.func_77209_d(); if (var19 < 1) { var19 = 1; } var13 = (int) ((float) ((this.bottom - this.top) * (this.bottom - this.top)) / (float) this.getContentHeight()); if (var13 < 32) { var13 = 32; } if (var13 > this.bottom - this.top - 8) { var13 = this.bottom - this.top - 8; } this.scrollMultiplier /= (float) (this.bottom - this.top - var13) / (float) var19; } else { this.scrollMultiplier = 1.0F; } if (var7) { this.initialClickY = (float) par2; } else { this.initialClickY = -2.0F; } } else { this.initialClickY = -2.0F; } } else if (this.initialClickY >= 0.0F) { this.amountScrolled -= ((float) par2 - this.initialClickY) * this.scrollMultiplier; this.initialClickY = (float) par2; } } else { while (!this.mc.gameSettings.touchscreen && Mouse.next()) { int var16 = Mouse.getEventDWheel(); if (var16 != 0) { if (var16 > 0) { var16 = -1; } else if (var16 < 0) { var16 = 1; } this.amountScrolled += (float) (var16 * this.slotHeight / 2); } } this.initialClickY = -1.0F; } this.bindAmountScrolled(); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_FOG); Tessellator var18 = 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); float var17 = 32.0F; var18.startDrawingQuads(); var18.setColorOpaque_I(2105376); var18.addVertexWithUV( (double) this.left, (double) this.bottom, 0.0D, (double) ((float) this.left / var17), (double) ((float) (this.bottom + (int) this.amountScrolled) / var17)); var18.addVertexWithUV( (double) this.right, (double) this.bottom, 0.0D, (double) ((float) this.right / var17), (double) ((float) (this.bottom + (int) this.amountScrolled) / var17)); var18.addVertexWithUV( (double) this.right, (double) this.top, 0.0D, (double) ((float) this.right / var17), (double) ((float) (this.top + (int) this.amountScrolled) / var17)); var18.addVertexWithUV( (double) this.left, (double) this.top, 0.0D, (double) ((float) this.left / var17), (double) ((float) (this.top + (int) this.amountScrolled) / var17)); var18.draw(); var9 = this.width / 2 - 92 - 16; var10 = this.top + 4 - (int) this.amountScrolled; if (this.field_77243_s) { this.func_77222_a(var9, var10, var18); } int var14; for (var11 = 0; var11 < var4; ++var11) { var19 = var10 + var11 * this.slotHeight + this.field_77242_t; var13 = this.slotHeight - 4; if (var19 <= this.bottom && var19 + var13 >= this.top) { if (this.showSelectionBox && this.isSelected(var11)) { var14 = this.width / 2 - 110; int var15 = this.width / 2 + 110; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_TEXTURE_2D); var18.startDrawingQuads(); var18.setColorOpaque_I(8421504); var18.addVertexWithUV((double) var14, (double) (var19 + var13 + 2), 0.0D, 0.0D, 1.0D); var18.addVertexWithUV((double) var15, (double) (var19 + var13 + 2), 0.0D, 1.0D, 1.0D); var18.addVertexWithUV((double) var15, (double) (var19 - 2), 0.0D, 1.0D, 0.0D); var18.addVertexWithUV((double) var14, (double) (var19 - 2), 0.0D, 0.0D, 0.0D); var18.setColorOpaque_I(0); var18.addVertexWithUV( (double) (var14 + 1), (double) (var19 + var13 + 1), 0.0D, 0.0D, 1.0D); var18.addVertexWithUV( (double) (var15 - 1), (double) (var19 + var13 + 1), 0.0D, 1.0D, 1.0D); var18.addVertexWithUV((double) (var15 - 1), (double) (var19 - 1), 0.0D, 1.0D, 0.0D); var18.addVertexWithUV((double) (var14 + 1), (double) (var19 - 1), 0.0D, 0.0D, 0.0D); var18.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); } this.drawSlot(var11, var9, var19, var13, var18); } } GL11.glDisable(GL11.GL_DEPTH_TEST); byte var20 = 4; this.overlayBackground(0, this.top, 255, 255); this.overlayBackground(this.bottom, this.height, 255, 255); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glDisable(GL11.GL_TEXTURE_2D); var18.startDrawingQuads(); var18.setColorRGBA_I(0, 0); var18.addVertexWithUV((double) this.left, (double) (this.top + var20), 0.0D, 0.0D, 1.0D); var18.addVertexWithUV((double) this.right, (double) (this.top + var20), 0.0D, 1.0D, 1.0D); var18.setColorRGBA_I(0, 255); var18.addVertexWithUV((double) this.right, (double) this.top, 0.0D, 1.0D, 0.0D); var18.addVertexWithUV((double) this.left, (double) this.top, 0.0D, 0.0D, 0.0D); var18.draw(); var18.startDrawingQuads(); var18.setColorRGBA_I(0, 255); var18.addVertexWithUV((double) this.left, (double) this.bottom, 0.0D, 0.0D, 1.0D); var18.addVertexWithUV((double) this.right, (double) this.bottom, 0.0D, 1.0D, 1.0D); var18.setColorRGBA_I(0, 0); var18.addVertexWithUV((double) this.right, (double) (this.bottom - var20), 0.0D, 1.0D, 0.0D); var18.addVertexWithUV((double) this.left, (double) (this.bottom - var20), 0.0D, 0.0D, 0.0D); var18.draw(); var19 = this.func_77209_d(); if (var19 > 0) { var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); if (var13 < 32) { var13 = 32; } if (var13 > this.bottom - this.top - 8) { var13 = this.bottom - this.top - 8; } var14 = (int) this.amountScrolled * (this.bottom - this.top - var13) / var19 + this.top; if (var14 < this.top) { var14 = this.top; } var18.startDrawingQuads(); var18.setColorRGBA_I(0, 255); var18.addVertexWithUV((double) var5, (double) this.bottom, 0.0D, 0.0D, 1.0D); var18.addVertexWithUV((double) var6, (double) this.bottom, 0.0D, 1.0D, 1.0D); var18.addVertexWithUV((double) var6, (double) this.top, 0.0D, 1.0D, 0.0D); var18.addVertexWithUV((double) var5, (double) this.top, 0.0D, 0.0D, 0.0D); var18.draw(); var18.startDrawingQuads(); var18.setColorRGBA_I(8421504, 255); var18.addVertexWithUV((double) var5, (double) (var14 + var13), 0.0D, 0.0D, 1.0D); var18.addVertexWithUV((double) var6, (double) (var14 + var13), 0.0D, 1.0D, 1.0D); var18.addVertexWithUV((double) var6, (double) var14, 0.0D, 1.0D, 0.0D); var18.addVertexWithUV((double) var5, (double) var14, 0.0D, 0.0D, 0.0D); var18.draw(); var18.startDrawingQuads(); var18.setColorRGBA_I(12632256, 255); var18.addVertexWithUV((double) var5, (double) (var14 + var13 - 1), 0.0D, 0.0D, 1.0D); var18.addVertexWithUV((double) (var6 - 1), (double) (var14 + var13 - 1), 0.0D, 1.0D, 1.0D); var18.addVertexWithUV((double) (var6 - 1), (double) var14, 0.0D, 1.0D, 0.0D); var18.addVertexWithUV((double) var5, (double) var14, 0.0D, 0.0D, 0.0D); var18.draw(); } this.func_77215_b(par1, par2); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glShadeModel(GL11.GL_FLAT); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glDisable(GL11.GL_BLEND); }
public void drawScreen(int i, int j, float f) { drawBackground(); int k = getSize(); int l = width / 2 + 124; int i1 = l + 6; if (Mouse.isButtonDown(0)) { if (initialClickY == -1F) { boolean flag = true; if (j >= top && j <= bottom) { int j1 = width / 2 - 110; int k1 = width / 2 + 110; int i2 = ((j - top - field_27261_r) + (int) amountScrolled) - 4; int k2 = i2 / posZ; if (i >= j1 && i <= k1 && k2 >= 0 && i2 >= 0 && k2 < k) { boolean flag1 = k2 == selectedElement && System.currentTimeMillis() - lastClicked < 250L; elementClicked(k2, flag1); selectedElement = k2; lastClicked = System.currentTimeMillis(); } else if (i >= j1 && i <= k1 && i2 < 0) { func_27255_a(i - j1, ((j - top) + (int) amountScrolled) - 4); flag = false; } if (i >= l && i <= i1) { scrollMultiplier = -1F; int i3 = getContentHeight() - (bottom - top - 4); if (i3 < 1) { i3 = 1; } int l3 = (int) ((float) ((bottom - top) * (bottom - top)) / (float) getContentHeight()); if (l3 < 32) { l3 = 32; } if (l3 > bottom - top - 8) { l3 = bottom - top - 8; } scrollMultiplier /= (float) (bottom - top - l3) / (float) i3; } else { scrollMultiplier = 1.0F; } if (flag) { initialClickY = j; } else { initialClickY = -2F; } } else { initialClickY = -2F; } } else if (initialClickY >= 0.0F) { amountScrolled -= ((float) j - initialClickY) * scrollMultiplier; initialClickY = j; } } else { initialClickY = -1F; } bindAmountScrolled(); GL11.glDisable(2896 /*GL_LIGHTING*/); GL11.glDisable(2912 /*GL_FOG*/); 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 f1 = 32F; tessellator.startDrawingQuads(); tessellator.setColorOpaque_I(0x202020); tessellator.addVertexWithUV( left, bottom, 0.0D, (float) left / f1, (float) (bottom + (int) amountScrolled) / f1); tessellator.addVertexWithUV( right, bottom, 0.0D, (float) right / f1, (float) (bottom + (int) amountScrolled) / f1); tessellator.addVertexWithUV( right, top, 0.0D, (float) right / f1, (float) (top + (int) amountScrolled) / f1); tessellator.addVertexWithUV( left, top, 0.0D, (float) left / f1, (float) (top + (int) amountScrolled) / f1); tessellator.draw(); int l1 = width / 2 - 92 - 16; int j2 = (top + 4) - (int) amountScrolled; if (field_27262_q) { func_27260_a(l1, j2, tessellator); } for (int l2 = 0; l2 < k; l2++) { int j3 = j2 + l2 * posZ + field_27261_r; int i4 = posZ - 4; if (j3 > bottom || j3 + i4 < top) { continue; } if (field_25123_p && isSelected(l2)) { int k4 = width / 2 - 110; int i5 = width / 2 + 110; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(3553 /*GL_TEXTURE_2D*/); tessellator.startDrawingQuads(); tessellator.setColorOpaque_I(0x808080); tessellator.addVertexWithUV(k4, j3 + i4 + 2, 0.0D, 0.0D, 1.0D); tessellator.addVertexWithUV(i5, j3 + i4 + 2, 0.0D, 1.0D, 1.0D); tessellator.addVertexWithUV(i5, j3 - 2, 0.0D, 1.0D, 0.0D); tessellator.addVertexWithUV(k4, j3 - 2, 0.0D, 0.0D, 0.0D); tessellator.setColorOpaque_I(0); tessellator.addVertexWithUV(k4 + 1, j3 + i4 + 1, 0.0D, 0.0D, 1.0D); tessellator.addVertexWithUV(i5 - 1, j3 + i4 + 1, 0.0D, 1.0D, 1.0D); tessellator.addVertexWithUV(i5 - 1, j3 - 1, 0.0D, 1.0D, 0.0D); tessellator.addVertexWithUV(k4 + 1, j3 - 1, 0.0D, 0.0D, 0.0D); tessellator.draw(); GL11.glEnable(3553 /*GL_TEXTURE_2D*/); } drawSlot(l2, l1, j3, i4, tessellator); } GL11.glDisable(2929 /*GL_DEPTH_TEST*/); byte byte0 = 4; overlayBackground(0, top, 255, 255); overlayBackground(bottom, height, 255, 255); GL11.glEnable(3042 /*GL_BLEND*/); GL11.glBlendFunc(770, 771); GL11.glDisable(3008 /*GL_ALPHA_TEST*/); GL11.glShadeModel(7425 /*GL_SMOOTH*/); GL11.glDisable(3553 /*GL_TEXTURE_2D*/); tessellator.startDrawingQuads(); tessellator.setColorRGBA_I(0, 0); tessellator.addVertexWithUV(left, top + byte0, 0.0D, 0.0D, 1.0D); tessellator.addVertexWithUV(right, top + byte0, 0.0D, 1.0D, 1.0D); tessellator.setColorRGBA_I(0, 255); tessellator.addVertexWithUV(right, top, 0.0D, 1.0D, 0.0D); tessellator.addVertexWithUV(left, top, 0.0D, 0.0D, 0.0D); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setColorRGBA_I(0, 255); tessellator.addVertexWithUV(left, bottom, 0.0D, 0.0D, 1.0D); tessellator.addVertexWithUV(right, bottom, 0.0D, 1.0D, 1.0D); tessellator.setColorRGBA_I(0, 0); tessellator.addVertexWithUV(right, bottom - byte0, 0.0D, 1.0D, 0.0D); tessellator.addVertexWithUV(left, bottom - byte0, 0.0D, 0.0D, 0.0D); tessellator.draw(); int k3 = getContentHeight() - (bottom - top - 4); if (k3 > 0) { int j4 = ((bottom - top) * (bottom - top)) / getContentHeight(); if (j4 < 32) { j4 = 32; } if (j4 > bottom - top - 8) { j4 = bottom - top - 8; } int l4 = ((int) amountScrolled * (bottom - top - j4)) / k3 + top; if (l4 < top) { l4 = top; } tessellator.startDrawingQuads(); tessellator.setColorRGBA_I(0, 255); tessellator.addVertexWithUV(l, bottom, 0.0D, 0.0D, 1.0D); tessellator.addVertexWithUV(i1, bottom, 0.0D, 1.0D, 1.0D); tessellator.addVertexWithUV(i1, top, 0.0D, 1.0D, 0.0D); tessellator.addVertexWithUV(l, top, 0.0D, 0.0D, 0.0D); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setColorRGBA_I(0x808080, 255); tessellator.addVertexWithUV(l, l4 + j4, 0.0D, 0.0D, 1.0D); tessellator.addVertexWithUV(i1, l4 + j4, 0.0D, 1.0D, 1.0D); tessellator.addVertexWithUV(i1, l4, 0.0D, 1.0D, 0.0D); tessellator.addVertexWithUV(l, l4, 0.0D, 0.0D, 0.0D); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setColorRGBA_I(0xc0c0c0, 255); tessellator.addVertexWithUV(l, (l4 + j4) - 1, 0.0D, 0.0D, 1.0D); tessellator.addVertexWithUV(i1 - 1, (l4 + j4) - 1, 0.0D, 1.0D, 1.0D); tessellator.addVertexWithUV(i1 - 1, l4, 0.0D, 1.0D, 0.0D); tessellator.addVertexWithUV(l, l4, 0.0D, 0.0D, 0.0D); tessellator.draw(); } func_27257_b(i, j); GL11.glEnable(3553 /*GL_TEXTURE_2D*/); GL11.glShadeModel(7424 /*GL_FLAT*/); GL11.glEnable(3008 /*GL_ALPHA_TEST*/); GL11.glDisable(3042 /*GL_BLEND*/); }
private void displayDebugInfo(long l) { long l1 = 0xfe502aL; if (prevFrameTime == -1L) { prevFrameTime = System.nanoTime(); } long l2 = System.nanoTime(); tickTimes[numRecordedFrameTimes & frameTimes.length - 1] = l; frameTimes[numRecordedFrameTimes++ & frameTimes.length - 1] = l2 - prevFrameTime; prevFrameTime = l2; GL11.glClear(256); GL11.glMatrixMode(5889 /*GL_PROJECTION*/); GL11.glLoadIdentity(); GL11.glOrtho(0.0D, displayWidth, displayHeight, 0.0D, 1000D, 3000D); GL11.glMatrixMode(5888 /*GL_MODELVIEW0_ARB*/); GL11.glLoadIdentity(); GL11.glTranslatef(0.0F, 0.0F, -2000F); GL11.glLineWidth(1.0F); GL11.glDisable(3553 /*GL_TEXTURE_2D*/); Tessellator tessellator = Tessellator.instance; tessellator.startDrawing(7); int i = (int) (l1 / 0x30d40L); tessellator.setColorOpaque_I(0x20000000); tessellator.addVertex(0.0D, displayHeight - i, 0.0D); tessellator.addVertex(0.0D, displayHeight, 0.0D); tessellator.addVertex(frameTimes.length, displayHeight, 0.0D); tessellator.addVertex(frameTimes.length, displayHeight - i, 0.0D); tessellator.setColorOpaque_I(0x20200000); tessellator.addVertex(0.0D, displayHeight - i * 2, 0.0D); tessellator.addVertex(0.0D, displayHeight - i, 0.0D); tessellator.addVertex(frameTimes.length, displayHeight - i, 0.0D); tessellator.addVertex(frameTimes.length, displayHeight - i * 2, 0.0D); tessellator.draw(); long l3 = 0L; for (int j = 0; j < frameTimes.length; j++) { l3 += frameTimes[j]; } int k = (int) (l3 / 0x30d40L / (long) frameTimes.length); tessellator.startDrawing(7); tessellator.setColorOpaque_I(0x20400000); tessellator.addVertex(0.0D, displayHeight - k, 0.0D); tessellator.addVertex(0.0D, displayHeight, 0.0D); tessellator.addVertex(frameTimes.length, displayHeight, 0.0D); tessellator.addVertex(frameTimes.length, displayHeight - k, 0.0D); tessellator.draw(); tessellator.startDrawing(1); for (int i1 = 0; i1 < frameTimes.length; i1++) { int j1 = ((i1 - numRecordedFrameTimes & frameTimes.length - 1) * 255) / frameTimes.length; int k1 = (j1 * j1) / 255; k1 = (k1 * k1) / 255; int i2 = (k1 * k1) / 255; i2 = (i2 * i2) / 255; if (frameTimes[i1] > l1) { tessellator.setColorOpaque_I(0xff000000 + k1 * 0x10000); } else { tessellator.setColorOpaque_I(0xff000000 + k1 * 256); } long l4 = frameTimes[i1] / 0x30d40L; long l5 = tickTimes[i1] / 0x30d40L; tessellator.addVertex((float) i1 + 0.5F, (float) ((long) displayHeight - l4) + 0.5F, 0.0D); tessellator.addVertex((float) i1 + 0.5F, (float) displayHeight + 0.5F, 0.0D); tessellator.setColorOpaque_I(0xff000000 + k1 * 0x10000 + k1 * 256 + k1 * 1); tessellator.addVertex((float) i1 + 0.5F, (float) ((long) displayHeight - l4) + 0.5F, 0.0D); tessellator.addVertex( (float) i1 + 0.5F, (float) ((long) displayHeight - (l4 - l5)) + 0.5F, 0.0D); } tessellator.draw(); GL11.glEnable(3553 /*GL_TEXTURE_2D*/); }