/// <summary> /// Draws a solid color rectangle with the specified coordinates and color. /// </summary> public static void DrawRect(int par1, int par2, int par3, int par4, int par5) { if (par1 < par3) { int i = par1; par1 = par3; par3 = i; } if (par2 < par4) { int j = par2; par2 = par4; par4 = j; } float f = (float)(par5 >> 24 & 0xff) / 255F; float f1 = (float)(par5 >> 16 & 0xff) / 255F; float f2 = (float)(par5 >> 8 & 0xff) / 255F; float f3 = (float)(par5 & 0xff) / 255F; Tessellator tessellator = Tessellator.Instance; //GL.Enable(EnableCap.Blend); //GL.Disable(EnableCap.Texture2D); //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); //GL.Color4(f1, f2, f3, f); tessellator.StartDrawingQuads(); tessellator.AddVertex(par1, par4, 0.0F); tessellator.AddVertex(par3, par4, 0.0F); tessellator.AddVertex(par3, par2, 0.0F); tessellator.AddVertex(par1, par2, 0.0F); tessellator.Draw(); //GL.Enable(EnableCap.Texture2D); //GL.Disable(EnableCap.Blend); }
private void Func_41040_b(int par1, int par2, float par3) { Tessellator tessellator = Tessellator.Instance; //GL.BindTexture(TextureTarget.Texture2D, Mc.RenderEngineOld.GetTexture("%blur%/gui/background.png")); tessellator.StartDrawingQuads(); tessellator.SetColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); int i = Width; float f = 0.0F - ((float)UpdateCounter + par3) * 0.5F * Field_41043_e; float f1 = (float)Height - ((float)UpdateCounter + par3) * 0.5F * Field_41043_e; float f2 = 0.015625F; float f3 = (((float)UpdateCounter + par3) - 0.0F) * 0.02F; float f4 = (float)(Field_41042_d + Height + Height + 24) / Field_41043_e; float f5 = (f4 - 20F - ((float)UpdateCounter + par3)) * 0.005F; if (f5 < f3) { f3 = f5; } if (f3 > 1.0F) { f3 = 1.0F; } f3 *= f3; f3 = (f3 * 96F) / 255F; tessellator.SetColorOpaque_F(f3, f3, f3); tessellator.AddVertexWithUV(0.0F, Height, ZLevel, 0.0F, f * f2); tessellator.AddVertexWithUV(i, Height, ZLevel, (float)i * f2, f * f2); tessellator.AddVertexWithUV(i, 0.0F, ZLevel, (float)i * f2, f1 * f2); tessellator.AddVertexWithUV(0.0F, 0.0F, ZLevel, 0.0F, f1 * f2); tessellator.Draw(); }
/// <summary> /// Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then /// handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic /// (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1, /// double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. /// </summary> public override void DoRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { //GL.PushMatrix(); //GL.Translate((float)par2, (float)par4, (float)par6); //GL.Enable(EnableCap.RescaleNormal); //GL.Scale(0.5F, 0.5F, 0.5F); LoadTexture("/gui/items.png"); Tessellator tessellator = Tessellator.Instance; if (ItemIconIndex == 154) { int i = PotionHelper.Func_40358_a(((EntityPotion)par1Entity).GetPotionDamage(), false); float f = (float)(i >> 16 & 0xff) / 255F; float f1 = (float)(i >> 8 & 0xff) / 255F; float f2 = (float)(i & 0xff) / 255F; //GL.Color3(f, f1, f2); //GL.PushMatrix(); Func_40265_a(tessellator, 141); //GL.PopMatrix(); //GL.Color3(1.0F, 1.0F, 1.0F); } Func_40265_a(tessellator, ItemIconIndex); //GL.Disable(EnableCap.RescaleNormal); //GL.PopMatrix(); }
protected override void DrawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { SaveFormatComparator saveformatcomparator = (SaveFormatComparator)GuiSelectWorld.GetSize(ParentWorldGui)[par1]; string s = saveformatcomparator.GetDisplayName(); if (s == null || MathHelper2.StringNullOrLengthZero(s)) { s = (new StringBuilder()).Append(GuiSelectWorld.GetLocalizedWorldName(ParentWorldGui)).Append(" ").Append(par1 + 1).ToString(); } string s1 = saveformatcomparator.GetFileName(); s1 = (new StringBuilder()).Append(s1).Append(" (").Append(new DateTime(saveformatcomparator.GetLastTimePlayed())).ToString(); s1 = (new StringBuilder()).Append(s1).Append(")").ToString(); string s2 = ""; if (saveformatcomparator.RequiresConversion()) { s2 = (new StringBuilder()).Append(GuiSelectWorld.GetLocalizedMustConvert(ParentWorldGui)).Append(" ").Append(s2).ToString(); } else { s2 = GuiSelectWorld.GetLocalizedGameMode(ParentWorldGui)[saveformatcomparator.GetGameType()]; if (saveformatcomparator.IsHardcoreModeEnabled()) { s2 = (new StringBuilder()).Append(FontRenderer.SpecialChar).Append("4").Append(StatCollector.TranslateToLocal("gameMode.hardcore")).Append(FontRenderer.SpecialChar).Append("8").ToString(); } } ParentWorldGui.DrawString(ParentWorldGui.FontRenderer, s, par2 + 2, par3 + 1, 0xffffff); ParentWorldGui.DrawString(ParentWorldGui.FontRenderer, s1, par2 + 2, par3 + 12, 0x808080); ParentWorldGui.DrawString(ParentWorldGui.FontRenderer, s2, par2 + 2, par3 + 12 + 10, 0x808080); }
/// <summary> /// Draws a rectangle with a vertical gradient between the specified colors. /// </summary> protected virtual void DrawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6) { float f = (float)(par5 >> 24 & 0xff) / 255F; float f1 = (float)(par5 >> 16 & 0xff) / 255F; float f2 = (float)(par5 >> 8 & 0xff) / 255F; float f3 = (float)(par5 & 0xff) / 255F; float f4 = (float)(par6 >> 24 & 0xff) / 255F; float f5 = (float)(par6 >> 16 & 0xff) / 255F; float f6 = (float)(par6 >> 8 & 0xff) / 255F; float f7 = (float)(par6 & 0xff) / 255F; //GL.Disable(EnableCap.Texture2D); //GL.Enable(EnableCap.Blend); //GL.Disable(EnableCap.AlphaTest); //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); //GL.ShadeModel(ShadingModel.Smooth); Tessellator tessellator = Tessellator.Instance; tessellator.StartDrawingQuads(); tessellator.SetColorRGBA_F(f1, f2, f3, f); tessellator.AddVertex(par3, par2, ZLevel); tessellator.AddVertex(par1, par2, ZLevel); tessellator.SetColorRGBA_F(f5, f6, f7, f4); tessellator.AddVertex(par1, par4, ZLevel); tessellator.AddVertex(par3, par4, ZLevel); tessellator.Draw(); //GL.ShadeModel(ShadingModel.Flat); //GL.Disable(EnableCap.Blend); //GL.Enable(EnableCap.AlphaTest); //GL.Enable(EnableCap.Texture2D); }
public new void RenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { float f = ((float)ParticleAge + par2) / (float)ParticleMaxAge; ParticleScale = lavaParticleScale * (1.0F - f * f); base.RenderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); }
///<summary> /// Renders the vignette. Args: vignetteBrightness, width, height ///</summary> private void RenderVignette(float par1, int par2, int par3) { par1 = 1.0F - par1; if (par1 < 0.0F) { par1 = 0.0F; } if (par1 > 1.0F) { par1 = 1.0F; } PrevVignetteBrightness += par1 - PrevVignetteBrightness * 0.01F; //GL.Disable(EnableCap.DepthTest); //GL.DepthMask(false); //GL.BlendFunc(BlendingFactorSrc.Zero, BlendingFactorDest.OneMinusSrcColor); //GL.Color4(PrevVignetteBrightness, PrevVignetteBrightness, PrevVignetteBrightness, 1.0F); //GL.BindTexture(TextureTarget.Texture2D, mc.RenderEngineOld.GetTexture("%blur%/misc/vignette.png")); RenderEngine.Instance.BindTexture("misc.vignette.png", TextureMode.Blur); Tessellator tessellator = Tessellator.Instance; tessellator.StartDrawingQuads(); tessellator.AddVertexWithUV(0.0F, par3, -90D, 0.0F, 1.0D); tessellator.AddVertexWithUV(par2, par3, -90D, 1.0D, 1.0D); tessellator.AddVertexWithUV(par2, 0.0F, -90D, 1.0D, 0.0F); tessellator.AddVertexWithUV(0.0F, 0.0F, -90D, 0.0F, 0.0F); tessellator.Draw(); //GL.DepthMask(true); //GL.Enable(EnableCap.DepthTest); //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F); //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); }
public override void RenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { float f = ((float)ParticleAge + par2) / (float)ParticleMaxAge; ParticleScale = FlameScale * (1.0F - f * f * 0.5F); base.RenderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); }
/// <summary> /// The actual render method that is used in doRender /// </summary> public virtual void DoRenderFallingSand(EntityFallingSand par1EntityFallingSand, double par2, double par4, double par6, float par8, float par9) { //GL.PushMatrix(); //GL.Translate((float)par2, (float)par4, (float)par6); LoadTexture("/terrain.png"); Block block = Block.BlocksList[par1EntityFallingSand.BlockID]; World world = par1EntityFallingSand.GetWorld(); //GL.Disable(EnableCap.Lighting); if (block == Block.DragonEgg) { RenderBlocks.BlockAccess = world; Tessellator tessellator = Tessellator.Instance; tessellator.StartDrawingQuads(); tessellator.SetTranslation((float)(-MathHelper2.Floor_double(par1EntityFallingSand.PosX)) - 0.5F, (float)(-MathHelper2.Floor_double(par1EntityFallingSand.PosY)) - 0.5F, (float)(-MathHelper2.Floor_double(par1EntityFallingSand.PosZ)) - 0.5F); RenderBlocks.RenderBlockByRenderType(block, MathHelper2.Floor_double(par1EntityFallingSand.PosX), MathHelper2.Floor_double(par1EntityFallingSand.PosY), MathHelper2.Floor_double(par1EntityFallingSand.PosZ)); tessellator.SetTranslation(0.0F, 0.0F, 0.0F); tessellator.Draw(); } else { RenderBlocks.RenderBlockFallingSand(block, world, MathHelper2.Floor_double(par1EntityFallingSand.PosX), MathHelper2.Floor_double(par1EntityFallingSand.PosY), MathHelper2.Floor_double(par1EntityFallingSand.PosZ)); } //GL.Enable(EnableCap.Lighting); //GL.PopMatrix(); }
/// <summary> /// 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 /// </summary> private void RenderWarpedTextureOverlay(float par1) { Tessellator tessellator = Tessellator.Instance; float f = Mc.ThePlayer.GetBrightness(par1); //GL.Color4(f, f, f, 0.5F); //GL.Enable(EnableCap.Blend); //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); //GL.PushMatrix(); 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(); //GL.PopMatrix(); //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F); //GL.Disable(EnableCap.Blend); }
private void Func_40267_a(int par1, int par2) { Tessellator tessellator = Tessellator.Instance; float f = (float)((par1 % 16) * 16 + 0) / 256F; float f1 = (float)((par1 % 16) * 16 + 16) / 256F; float f2 = (float)((par1 / 16) * 16 + 0) / 256F; float f3 = (float)((par1 / 16) * 16 + 16) / 256F; float f4 = 1.0F; float f5 = 0.5F; float f6 = 0.25F; for (int i = 0; i < par2; i++) { //GL.PushMatrix(); if (i > 0) { float f7 = (Random.NextFloat() * 2.0F - 1.0F) * 0.3F; float f8 = (Random.NextFloat() * 2.0F - 1.0F) * 0.3F; float f9 = (Random.NextFloat() * 2.0F - 1.0F) * 0.3F; //GL.Translate(f7, f8, f9); } //GL.Rotate(180F - RenderManager.PlayerViewY, 0.0F, 1.0F, 0.0F); tessellator.StartDrawingQuads(); tessellator.SetNormal(0.0F, 1.0F, 0.0F); tessellator.AddVertexWithUV(0.0F - f5, 0.0F - f6, 0.0F, f, f3); tessellator.AddVertexWithUV(f4 - f5, 0.0F - f6, 0.0F, f1, f3); tessellator.AddVertexWithUV(f4 - f5, 1.0F - f6, 0.0F, f1, f2); tessellator.AddVertexWithUV(0.0F - f5, 1.0F - f6, 0.0F, f, f2); tessellator.Draw(); //GL.PopMatrix(); } }
/// <summary> /// Renders the texture of the block the player is inside as an overlay. Args: partialTickTime, blockTextureIndex /// </summary> private void RenderInsideOfBlock(float par1, int par2) { Tessellator tessellator = Tessellator.Instance; float f = Mc.ThePlayer.GetBrightness(par1); f = 0.1F; //GL.Color4(f, f, f, 0.5F); //GL.PushMatrix(); 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(); //GL.PopMatrix(); //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F); }
/// <summary> /// Adds to the tesselator a box using the aabb for the bounds. Args: aabb /// </summary> public static void RenderAABB(AxisAlignedBB par0AxisAlignedBB) { Tessellator tessellator = Tessellator.Instance; tessellator.StartDrawingQuads(); tessellator.AddVertex(par0AxisAlignedBB.MinX, par0AxisAlignedBB.MaxY, par0AxisAlignedBB.MinZ); tessellator.AddVertex(par0AxisAlignedBB.MaxX, par0AxisAlignedBB.MaxY, par0AxisAlignedBB.MinZ); tessellator.AddVertex(par0AxisAlignedBB.MaxX, par0AxisAlignedBB.MinY, par0AxisAlignedBB.MinZ); tessellator.AddVertex(par0AxisAlignedBB.MinX, par0AxisAlignedBB.MinY, par0AxisAlignedBB.MinZ); tessellator.AddVertex(par0AxisAlignedBB.MinX, par0AxisAlignedBB.MinY, par0AxisAlignedBB.MaxZ); tessellator.AddVertex(par0AxisAlignedBB.MaxX, par0AxisAlignedBB.MinY, par0AxisAlignedBB.MaxZ); tessellator.AddVertex(par0AxisAlignedBB.MaxX, par0AxisAlignedBB.MaxY, par0AxisAlignedBB.MaxZ); tessellator.AddVertex(par0AxisAlignedBB.MinX, par0AxisAlignedBB.MaxY, par0AxisAlignedBB.MaxZ); tessellator.AddVertex(par0AxisAlignedBB.MinX, par0AxisAlignedBB.MinY, par0AxisAlignedBB.MinZ); tessellator.AddVertex(par0AxisAlignedBB.MaxX, par0AxisAlignedBB.MinY, par0AxisAlignedBB.MinZ); tessellator.AddVertex(par0AxisAlignedBB.MaxX, par0AxisAlignedBB.MinY, par0AxisAlignedBB.MaxZ); tessellator.AddVertex(par0AxisAlignedBB.MinX, par0AxisAlignedBB.MinY, par0AxisAlignedBB.MaxZ); tessellator.AddVertex(par0AxisAlignedBB.MinX, par0AxisAlignedBB.MaxY, par0AxisAlignedBB.MaxZ); tessellator.AddVertex(par0AxisAlignedBB.MaxX, par0AxisAlignedBB.MaxY, par0AxisAlignedBB.MaxZ); tessellator.AddVertex(par0AxisAlignedBB.MaxX, par0AxisAlignedBB.MaxY, par0AxisAlignedBB.MinZ); tessellator.AddVertex(par0AxisAlignedBB.MinX, par0AxisAlignedBB.MaxY, par0AxisAlignedBB.MinZ); tessellator.AddVertex(par0AxisAlignedBB.MinX, par0AxisAlignedBB.MinY, par0AxisAlignedBB.MaxZ); tessellator.AddVertex(par0AxisAlignedBB.MinX, par0AxisAlignedBB.MaxY, par0AxisAlignedBB.MaxZ); tessellator.AddVertex(par0AxisAlignedBB.MinX, par0AxisAlignedBB.MaxY, par0AxisAlignedBB.MinZ); tessellator.AddVertex(par0AxisAlignedBB.MinX, par0AxisAlignedBB.MinY, par0AxisAlignedBB.MinZ); tessellator.AddVertex(par0AxisAlignedBB.MaxX, par0AxisAlignedBB.MinY, par0AxisAlignedBB.MinZ); tessellator.AddVertex(par0AxisAlignedBB.MaxX, par0AxisAlignedBB.MaxY, par0AxisAlignedBB.MinZ); tessellator.AddVertex(par0AxisAlignedBB.MaxX, par0AxisAlignedBB.MaxY, par0AxisAlignedBB.MaxZ); tessellator.AddVertex(par0AxisAlignedBB.MaxX, par0AxisAlignedBB.MinY, par0AxisAlignedBB.MaxZ); tessellator.Draw(); }
public virtual void DoRenderFireball(EntityFireball par1EntityFireball, double par2, double par4, double par6, float par8, float par9) { //GL.PushMatrix(); //GL.Translate((float)par2, (float)par4, (float)par6); //GL.Enable(EnableCap.RescaleNormal); float f = Field_40269_a; //GL.Scale(f / 1.0F, f / 1.0F, f / 1.0F); sbyte byte0 = 46; LoadTexture("/gui/items.png"); Tessellator tessellator = Tessellator.Instance; float f1 = (float)((byte0 % 16) * 16 + 0) / 256F; float f2 = (float)((byte0 % 16) * 16 + 16) / 256F; float f3 = (float)((byte0 / 16) * 16 + 0) / 256F; float f4 = (float)((byte0 / 16) * 16 + 16) / 256F; float f5 = 1.0F; float f6 = 0.5F; float f7 = 0.25F; //GL.Rotate(180F - RenderManager.PlayerViewY, 0.0F, 1.0F, 0.0F); //GL.Rotate(-RenderManager.PlayerViewX, 1.0F, 0.0F, 0.0F); tessellator.StartDrawingQuads(); tessellator.SetNormal(0.0F, 1.0F, 0.0F); tessellator.AddVertexWithUV(0.0F - f6, 0.0F - f7, 0.0F, f1, f4); tessellator.AddVertexWithUV(f5 - f6, 0.0F - f7, 0.0F, f2, f4); tessellator.AddVertexWithUV(f5 - f6, 1.0F - f7, 0.0F, f2, f3); tessellator.AddVertexWithUV(0.0F - f6, 1.0F - f7, 0.0F, f1, f3); tessellator.Draw(); //GL.Disable(EnableCap.RescaleNormal); //GL.PopMatrix(); }
public override void RenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { float f = ((float)Age + par2) / (float)MaxAge; f *= f; double d = EntityToPickUp.PosX; double d1 = EntityToPickUp.PosY; double d2 = EntityToPickUp.PosZ; double d3 = EntityPickingUp.LastTickPosX + (EntityPickingUp.PosX - EntityPickingUp.LastTickPosX) * (double)par2; double d4 = EntityPickingUp.LastTickPosY + (EntityPickingUp.PosY - EntityPickingUp.LastTickPosY) * (double)par2 + (double)YOffs; double d5 = EntityPickingUp.LastTickPosZ + (EntityPickingUp.PosZ - EntityPickingUp.LastTickPosZ) * (double)par2; double d6 = d + (d3 - d) * (double)f; double d7 = d1 + (d4 - d1) * (double)f; double d8 = d2 + (d5 - d2) * (double)f; int i = MathHelper2.Floor_double(d6); int j = MathHelper2.Floor_double(d7 + (double)(YOffset / 2.0F)); int k = MathHelper2.Floor_double(d8); int l = GetBrightnessForRender(par2); int i1 = l % 0x10000; int j1 = l / 0x10000; OpenGlHelper.SetLightmapTextureCoords(OpenGlHelper.LightmapTexUnit, (float)i1 / 1.0F, (float)j1 / 1.0F); //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F); d6 -= InterpPosX; d7 -= InterpPosY; d8 -= InterpPosZ; RenderManager.Instance.RenderEntityWithPosYaw(EntityToPickUp, (float)d6, (float)d7, (float)d8, EntityToPickUp.RotationYaw, par2); }
///<summary> /// Renders the portal overlay. Args: portalStrength, width, height ///</summary> private void RenderPortalOverlay(float par1, int par2, int par3) { if (par1 < 1.0F) { par1 *= par1; par1 *= par1; par1 = par1 * 0.8F + 0.2F; } //GL.Disable(EnableCap.AlphaTest); //GL.Disable(EnableCap.DepthTest); //GL.DepthMask(false); //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); //GL.Color4(1.0F, 1.0F, 1.0F, par1); //GL.BindTexture(TextureTarget.Texture2D, mc.RenderEngineOld.GetTexture("/terrain.png")); RenderEngine.Instance.BindTexture("terrain.png"); float f = (float)(Block.Portal.BlockIndexInTexture % 16) / 16F; float f1 = (float)(Block.Portal.BlockIndexInTexture / 16) / 16F; float f2 = (float)(Block.Portal.BlockIndexInTexture % 16 + 1) / 16F; float f3 = (float)(Block.Portal.BlockIndexInTexture / 16 + 1) / 16F; Tessellator tessellator = Tessellator.Instance; tessellator.StartDrawingQuads(); tessellator.AddVertexWithUV(0.0F, par3, -90D, f, f3); tessellator.AddVertexWithUV(par2, par3, -90D, f2, f3); tessellator.AddVertexWithUV(par2, 0.0F, -90D, f2, f1); tessellator.AddVertexWithUV(0.0F, 0.0F, -90D, f, f1); tessellator.Draw(); //GL.DepthMask(true); //GL.Enable(EnableCap.DepthTest); //GL.Enable(EnableCap.AlphaTest); //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F); }
protected override void Func_27260_a(int par1, int par2, Tessellator par3Tessellator) { base.Func_27260_a(par1, par2, par3Tessellator); if (Field_27268_b == 0) { GuiStats.DrawSprite(Field_27275_a, ((par1 + 115) - 18) + 1, par2 + 1 + 1, 72, 18); } else { GuiStats.DrawSprite(Field_27275_a, (par1 + 115) - 18, par2 + 1, 72, 18); } if (Field_27268_b == 1) { GuiStats.DrawSprite(Field_27275_a, ((par1 + 165) - 18) + 1, par2 + 1 + 1, 18, 18); } else { GuiStats.DrawSprite(Field_27275_a, (par1 + 165) - 18, par2 + 1, 18, 18); } if (Field_27268_b == 2) { GuiStats.DrawSprite(Field_27275_a, ((par1 + 215) - 18) + 1, par2 + 1 + 1, 36, 18); } else { GuiStats.DrawSprite(Field_27275_a, (par1 + 215) - 18, par2 + 1, 36, 18); } }
/// <summary> /// Rotate and blurs the skybox view in the main menu /// </summary> private void RotateAndBlurSkybox(float par1) { //GL.BindTexture(TextureTarget.Texture2D, ViewportTexture); RenderEngine.Instance.BindTexture(ViewportTexture); //GL.CopyTexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, 0, 0, 256, 256); //GL.Enable(EnableCap.Blend); //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); //GL.ColorMask(true, true, true, false); Tessellator tessellator = Tessellator.Instance; tessellator.StartDrawingQuads(); byte byte0 = 3; for (int i = 0; i < byte0; i++) { tessellator.SetColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F / (float)(i + 1)); int j = Width; int k = Height; float f = (float)(i - byte0 / 2) / 256F; tessellator.AddVertexWithUV(j, k, ZLevel, 0.0F + f, 0.0F); tessellator.AddVertexWithUV(j, 0.0F, ZLevel, 1.0F + f, 0.0F); tessellator.AddVertexWithUV(0.0F, 0.0F, ZLevel, 1.0F + f, 1.0D); tessellator.AddVertexWithUV(0.0F, k, ZLevel, 0.0F + f, 1.0D); } tessellator.Draw(); //GL.ColorMask(true, true, true, true); }
private void Func_40266_a(int par1, int par2, int par3, int par4, int par5) { for (int i = 0; i < 2; i++) { if (i == 0) { //GL.BlendFunc(BlendingFactorSrc.One, BlendingFactorDest.One); } if (i == 1) { //GL.BlendFunc(BlendingFactorSrc.One, BlendingFactorDest.One); } float f = 0.00390625F; float f1 = 0.00390625F; float f2 = ((float)(JavaHelper.CurrentTimeMillis() % (long)(3000 + i * 1873)) / (3000F + (float)(i * 1873))) * 256F; float f3 = 0.0F; Tessellator tessellator = Tessellator.Instance; float f4 = 4F; if (i == 1) { f4 = -1F; } tessellator.StartDrawingQuads(); tessellator.AddVertexWithUV(par2 + 0, par3 + par5, ZLevel, (f2 + (float)par5 * f4) * f, (f3 + (float)par5) * f1); tessellator.AddVertexWithUV(par2 + par4, par3 + par5, ZLevel, (f2 + (float)par4 + (float)par5 * f4) * f, (f3 + (float)par5) * f1); tessellator.AddVertexWithUV(par2 + par4, par3 + 0, ZLevel, (f2 + (float)par4) * f, (f3 + 0.0F) * f1); tessellator.AddVertexWithUV(par2 + 0, par3 + 0, ZLevel, (f2 + 0.0F) * f, (f3 + 0.0F) * f1); tessellator.Draw(); } }
public virtual void DoRenderArrow(EntityArrow par1EntityArrow, double par2, double par4, double par6, float par8, float par9) { LoadTexture("/item/arrows.png"); //GL.PushMatrix(); //GL.Translate((float)par2, (float)par4, (float)par6); //GL.Rotate((par1EntityArrow.PrevRotationYaw + (par1EntityArrow.RotationYaw - par1EntityArrow.PrevRotationYaw) * par9) - 90F, 0.0F, 1.0F, 0.0F); //GL.Rotate(par1EntityArrow.PrevRotationPitch + (par1EntityArrow.RotationPitch - par1EntityArrow.PrevRotationPitch) * par9, 0.0F, 0.0F, 1.0F); Tessellator tessellator = Tessellator.Instance; int i = 0; float f = 0.0F; float f1 = 0.5F; float f2 = (float)(0 + i * 10) / 32F; float f3 = (float)(5 + i * 10) / 32F; float f4 = 0.0F; float f5 = 0.15625F; float f6 = (float)(5 + i * 10) / 32F; float f7 = (float)(10 + i * 10) / 32F; float f8 = 0.05625F; //GL.Enable(EnableCap.RescaleNormal); float f9 = (float)par1EntityArrow.ArrowShake - par9; if (f9 > 0.0F) { float f10 = -MathHelper2.Sin(f9 * 3F) * f9; //GL.Rotate(f10, 0.0F, 0.0F, 1.0F); } //GL.Rotate(45F, 1.0F, 0.0F, 0.0F); //GL.Scale(f8, f8, f8); //GL.Translate(-4F, 0.0F, 0.0F); //GL.Normal3(f8, 0.0F, 0.0F); tessellator.StartDrawingQuads(); tessellator.AddVertexWithUV(-7D, -2D, -2D, f4, f6); tessellator.AddVertexWithUV(-7D, -2D, 2D, f5, f6); tessellator.AddVertexWithUV(-7D, 2D, 2D, f5, f7); tessellator.AddVertexWithUV(-7D, 2D, -2D, f4, f7); tessellator.Draw(); //GL.Normal3(-f8, 0.0F, 0.0F); tessellator.StartDrawingQuads(); tessellator.AddVertexWithUV(-7D, 2D, -2D, f4, f6); tessellator.AddVertexWithUV(-7D, 2D, 2D, f5, f6); tessellator.AddVertexWithUV(-7D, -2D, 2D, f5, f7); tessellator.AddVertexWithUV(-7D, -2D, -2D, f4, f7); tessellator.Draw(); for (int j = 0; j < 4; j++) { //GL.Rotate(90F, 1.0F, 0.0F, 0.0F); //GL.Normal3(0.0F, 0.0F, f8); tessellator.StartDrawingQuads(); tessellator.AddVertexWithUV(-8D, -2D, 0.0F, f, f2); tessellator.AddVertexWithUV(8D, -2D, 0.0F, f1, f2); tessellator.AddVertexWithUV(8D, 2D, 0.0F, f1, f3); tessellator.AddVertexWithUV(-8D, 2D, 0.0F, f, f3); tessellator.Draw(); } //GL.Disable(EnableCap.RescaleNormal); //GL.PopMatrix(); }
public override void RenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { float f = ((float)Field_27018_a + par2) / (float)Field_27020_o; f *= f; float f1 = 2.0F - f * 2.0F; if (f1 > 1.0F) { f1 = 1.0F; } f1 *= 0.2F; //GL.Disable(EnableCap.Lighting); float f2 = 0.125F; float f3 = (float)(PosX - InterpPosX); float f4 = (float)(PosY - InterpPosY); float f5 = (float)(PosZ - InterpPosZ); float f6 = WorldObj.GetLightBrightness(MathHelper2.Floor_double(PosX), MathHelper2.Floor_double(PosY), MathHelper2.Floor_double(PosZ)); //CurrentFootSteps.BindTexture(CurrentFootSteps.GetTexture("/misc/footprint.png")); CurrentFootSteps.BindTexture("misc.footprint.png"); //GL.Enable(EnableCap.Blend); //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); par1Tessellator.StartDrawingQuads(); par1Tessellator.SetColorRGBA_F(f6, f6, f6, f1); par1Tessellator.AddVertexWithUV(f3 - f2, f4, f5 + f2, 0.0F, 1.0D); par1Tessellator.AddVertexWithUV(f3 + f2, f4, f5 + f2, 1.0D, 1.0D); par1Tessellator.AddVertexWithUV(f3 + f2, f4, f5 - f2, 1.0D, 0.0F); par1Tessellator.AddVertexWithUV(f3 - f2, f4, f5 - f2, 0.0F, 0.0F); par1Tessellator.Draw(); //GL.Disable(EnableCap.Blend); //GL.Enable(EnableCap.Lighting); }
/// <summary> /// Renders the animation for when an enderdragon dies /// </summary> protected virtual void RenderDragonDying(EntityDragon par1EntityDragon, float par2) { base.RenderEquippedItems(par1EntityDragon, par2); Tessellator tessellator = Tessellator.Instance; if (par1EntityDragon.Field_40178_aA > 0) { RenderHelper.DisableStandardItemLighting(); float f = ((float)par1EntityDragon.Field_40178_aA + par2) / 200F; float f1 = 0.0F; if (f > 0.8F) { f1 = (f - 0.8F) / 0.2F; } Random random = new Random(432); //GL.Disable(EnableCap.Texture2D); //GL.ShadeModel(ShadingModel.Smooth); //GL.Enable(EnableCap.Blend); //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.One); //GL.Disable(EnableCap.AlphaTest); //GL.Enable(EnableCap.CullFace); //GL.DepthMask(false); //GL.PushMatrix(); //GL.Translate(0.0F, -1F, -2F); for (int i = 0; (float)i < ((f + f * f) / 2.0F) * 60F; i++) { //GL.Rotate(random.NextDouble() * 360F, 1.0F, 0.0F, 0.0F); //GL.Rotate(random.NextDouble() * 360F, 0.0F, 1.0F, 0.0F); //GL.Rotate(random.NextDouble() * 360F, 0.0F, 0.0F, 1.0F); //GL.Rotate(random.NextDouble() * 360F, 1.0F, 0.0F, 0.0F); //GL.Rotate(random.NextDouble() * 360F, 0.0F, 1.0F, 0.0F); //GL.Rotate(random.NextDouble() * 360F + f * 90F, 0.0F, 0.0F, 1.0F); tessellator.StartDrawing(6); float f2 = (float)random.NextDouble() * 20F + 5F + f1 * 10F; float f3 = (float)random.NextDouble() * 2.0F + 1.0F + f1 * 2.0F; tessellator.SetColorRGBA_I(0xffffff, (int)(255F * (1.0F - f1))); tessellator.AddVertex(0.0F, 0.0F, 0.0F); 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.0F, f2, 1.0F * f3); tessellator.AddVertex(-0.86599999999999999D * (double)f3, f2, -0.5F * f3); tessellator.Draw(); } //GL.PopMatrix(); //GL.DepthMask(true); //GL.Disable(EnableCap.CullFace); //GL.Disable(EnableCap.Blend); //GL.ShadeModel(ShadingModel.Flat); //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F); //GL.Enable(EnableCap.Texture2D); //GL.Enable(EnableCap.AlphaTest); RenderHelper.EnableStandardItemLighting(); } }
/// <summary> /// Used to render a player's name above their head /// </summary> protected virtual 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(); //GL.PushMatrix(); //GL.Translate((float)par2 + 0.0F, (float)par4 + 2.3F, (float)par6); //GL.Normal3(0.0F, 1.0F, 0.0F); //GL.Rotate(-RenderManager.PlayerViewY, 0.0F, 1.0F, 0.0F); //GL.Rotate(RenderManager.PlayerViewX, 1.0F, 0.0F, 0.0F); //GL.Scale(-f1, -f1, f1); //GL.Disable(EnableCap.Lighting); //GL.Translate(0.0F, 0.25F / f1, 0.0F); //GL.DepthMask(false); //GL.Enable(EnableCap.Blend); //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); Tessellator tessellator = Tessellator.Instance; //GL.Disable(EnableCap.Texture2D); 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.0F); tessellator.AddVertex(-i - 1, 8D, 0.0F); tessellator.AddVertex(i + 1, 8D, 0.0F); tessellator.AddVertex(i + 1, -1D, 0.0F); tessellator.Draw(); //GL.Enable(EnableCap.Texture2D); //GL.DepthMask(true); fontrenderer.DrawString(s, -fontrenderer.GetStringWidth(s) / 2, 0, 0x20ffffff); //GL.Enable(EnableCap.Lighting); //GL.Disable(EnableCap.Blend); //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F); //GL.PopMatrix(); } } } }
protected override void DrawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { StatCrafting statcrafting = Func_27264_b(par1); int i = statcrafting.GetItemID(); GuiStats.DrawItemSprite(Field_27275_a, par2 + 40, par3, i); Func_27265_a((StatCrafting)StatList.ObjectBreakStats[i], par2 + 115, par3, par1 % 2 == 0); Func_27265_a((StatCrafting)StatList.ObjectCraftStats[i], par2 + 165, par3, par1 % 2 == 0); Func_27265_a(statcrafting, par2 + 215, par3, par1 % 2 == 0); }
public override void RenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { float f = ((float)ParticleAge + par2) / (float)ParticleMaxAge; f = 1.0F - f; f *= f; f = 1.0F - f; ParticleScale = PortalParticleScale * f; base.RenderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); }
/// <summary> /// Adds a quad to the tesselator at the specified position with the set width and height and color. Args: /// tessellator, x, y, width, height, color /// </summary> private void RenderQuad(Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6) { par1Tessellator.StartDrawingQuads(); par1Tessellator.SetColorOpaque_I(par6); par1Tessellator.AddVertex(par2 + 0, par3 + 0, 0.0F); par1Tessellator.AddVertex(par2 + 0, par3 + par5, 0.0F); par1Tessellator.AddVertex(par2 + par4, par3 + par5, 0.0F); par1Tessellator.AddVertex(par2 + par4, par3 + 0, 0.0F); par1Tessellator.Draw(); }
/// <summary> /// Renders the dragon, along with its dying animation /// </summary> public virtual void DoRenderDragon(EntityDragon par1EntityDragon, double par2, double par4, double par6, float par8, float par9) { EntityDragon = par1EntityDragon; if (Field_40284_d != 4) { MainModel = new ModelDragon(0.0F); Field_40284_d = 4; } base.DoRenderLiving(par1EntityDragon, par2, par4, par6, par8, par9); if (par1EntityDragon.HealingEnderCrystal != null) { float f = (float)par1EntityDragon.HealingEnderCrystal.InnerRotation + par9; float f1 = MathHelper2.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 = MathHelper2.Sqrt_float(f2 * f2 + f4 * f4); float f6 = MathHelper2.Sqrt_float(f2 * f2 + f3 * f3 + f4 * f4); //GL.PushMatrix(); //GL.Translate((float)par2, (float)par4 + 2.0F, (float)par6); //GL.Rotate(((float)(-Math.Atan2(f4, f2)) * 180F) / (float)Math.PI - 90F, 0.0F, 1.0F, 0.0F); //GL.Rotate(((float)(-Math.Atan2(f5, f3)) * 180F) / (float)Math.PI - 90F, 1.0F, 0.0F, 0.0F); Tessellator tessellator = Tessellator.Instance; RenderHelper.DisableStandardItemLighting(); //GL.Disable(EnableCap.CullFace); LoadTexture("/mob/enderdragon/beam.png"); //GL.ShadeModel(ShadingModel.Smooth); float f7 = 0.0F - ((float)par1EntityDragon.TicksExisted + par9) * 0.01F; float f8 = MathHelper2.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 = MathHelper2.Sin(((float)(j % i) * (float)Math.PI * 2.0F) / (float)i) * 0.75F; float f10 = MathHelper2.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.0F, f11, f8); tessellator.SetColorOpaque_I(0xffffff); tessellator.AddVertexWithUV(f9, f10, f6, f11, f7); } tessellator.Draw(); //GL.Enable(EnableCap.CullFace); //GL.ShadeModel(ShadingModel.Flat); RenderHelper.EnableStandardItemLighting(); //GL.PopMatrix(); } }
protected override void Func_27260_a(int par1, int par2, Tessellator par3Tessellator) {/* * if (Mouse.GetState().LeftButton != ButtonState.Pressed) * { * Field_27268_b = -1; * } */ if (Field_27268_b == 0) { GuiStats.DrawSprite(Field_27269_g, (par1 + 115) - 18, par2 + 1, 0, 0); } else { GuiStats.DrawSprite(Field_27269_g, (par1 + 115) - 18, par2 + 1, 0, 18); } if (Field_27268_b == 1) { GuiStats.DrawSprite(Field_27269_g, (par1 + 165) - 18, par2 + 1, 0, 0); } else { GuiStats.DrawSprite(Field_27269_g, (par1 + 165) - 18, par2 + 1, 0, 18); } if (Field_27268_b == 2) { GuiStats.DrawSprite(Field_27269_g, (par1 + 215) - 18, par2 + 1, 0, 0); } else { GuiStats.DrawSprite(Field_27269_g, (par1 + 215) - 18, par2 + 1, 0, 18); } if (Field_27271_e != -1) { char c = 'O'; sbyte byte0 = 18; if (Field_27271_e == 1) { c = '\u0201'; } else if (Field_27271_e == 2) { c = '\u0263'; } if (Field_27270_f == 1) { byte0 = 36; } GuiStats.DrawSprite(Field_27269_g, par1 + c, par2 + 1, byte0, 0); } }
/// <summary> /// Adds a textured quad to the tesselator at the specified position with the specified texture coords, width and /// height. Args: x, y, u, v, width, height /// </summary> public virtual void RenderTexturedQuad(int par1, int par2, int par3, int par4, int par5, int par6) { float f = 0.00390625F; float f1 = 0.00390625F; 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(); }
/// <summary> /// Draws the debug or playername text above a living /// </summary> protected virtual 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; //GL.PushMatrix(); //GL.Translate((float)par3 + 0.0F, (float)par5 + 2.3F, (float)par7); //GL.Normal3(0.0F, 1.0F, 0.0F); //GL.Rotate(-RenderManager.PlayerViewY, 0.0F, 1.0F, 0.0F); //GL.Rotate(RenderManager.PlayerViewX, 1.0F, 0.0F, 0.0F); //GL.Scale(-f2, -f2, f2); //GL.Disable(EnableCap.Lighting); //GL.DepthMask(false); //GL.Disable(EnableCap.DepthTest); //GL.Enable(EnableCap.Blend); //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); Tessellator tessellator = Tessellator.Instance; sbyte byte0 = 0; if (par2Str.Equals("deadmau5")) { byte0 = -10; } //GL.Disable(EnableCap.Texture2D); 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.0F); tessellator.AddVertex(-i - 1, 8 + byte0, 0.0F); tessellator.AddVertex(i + 1, 8 + byte0, 0.0F); tessellator.AddVertex(i + 1, -1 + byte0, 0.0F); tessellator.Draw(); //GL.Enable(EnableCap.Texture2D); fontrenderer.DrawString(par2Str, -fontrenderer.GetStringWidth(par2Str) / 2, byte0, 0x20ffffff); //GL.Enable(EnableCap.DepthTest); //GL.DepthMask(true); fontrenderer.DrawString(par2Str, -fontrenderer.GetStringWidth(par2Str) / 2, byte0, -1); //GL.Enable(EnableCap.Lighting); //GL.Disable(EnableCap.Blend); //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F); //GL.PopMatrix(); }