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();
        }
Ejemplo n.º 2
0
        /// <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();
        }
        /// <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);
        }
Ejemplo n.º 4
0
        /// <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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        /// <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);
        }
Ejemplo n.º 7
0
        /// <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);
        }
Ejemplo n.º 8
0
        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();
        }
Ejemplo n.º 9
0
        /// <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();
        }
Ejemplo n.º 10
0
        ///<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);
        }
Ejemplo n.º 11
0
        /// <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);
        }
        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();
        }
Ejemplo n.º 13
0
        ///<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);
        }
Ejemplo n.º 14
0
        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();
            }
        }
Ejemplo n.º 15
0
        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();
            }
        }
        /// <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();
                    }
                }
            }
        }
        /// <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();
            }
        }
Ejemplo n.º 18
0
 /// <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();
            }
        }
Ejemplo n.º 20
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>
        /// Renders all current particles. Args player, partialTickTime
        /// </summary>
        public virtual void RenderParticles(Entity par1Entity, float par2)
        {
            float f  = ActiveRenderInfo.RotationX;
            float f1 = ActiveRenderInfo.RotationZ;
            float f2 = ActiveRenderInfo.RotationYZ;
            float f3 = ActiveRenderInfo.RotationXY;
            float f4 = ActiveRenderInfo.RotationXZ;

            EntityFX.InterpPosX = par1Entity.LastTickPosX + (par1Entity.PosX - par1Entity.LastTickPosX) * (double)par2;
            EntityFX.InterpPosY = par1Entity.LastTickPosY + (par1Entity.PosY - par1Entity.LastTickPosY) * (double)par2;
            EntityFX.InterpPosZ = par1Entity.LastTickPosZ + (par1Entity.PosZ - par1Entity.LastTickPosZ) * (double)par2;

            for (int i = 0; i < 3; i++)
            {
                if (FxLayers[i].Count == 0)
                {
                    continue;
                }

                int j = 0;

                if (i == 0)
                {
                    j = Renderer.GetTexture("/particles.png");
                }

                if (i == 1)
                {
                    j = Renderer.GetTexture("/terrain.png");
                }

                if (i == 2)
                {
                    j = Renderer.GetTexture("/gui/items.png");
                }

                //GL.BindTexture(TextureTarget.Texture2D, j);
                Tessellator tessellator = Tessellator.Instance;
                //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F);
                tessellator.StartDrawingQuads();

                for (int k = 0; k < FxLayers[i].Count; k++)
                {
                    EntityFX entityfx = FxLayers[i][k];
                    tessellator.SetBrightness(entityfx.GetBrightnessForRender(par2));
                    entityfx.RenderParticle(tessellator, par2, f, f4, f1, f2, f3);
                }

                tessellator.Draw();
            }
        }
Ejemplo n.º 22
0
        /// <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();
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Draws a sprite from /gui/slot.png.
        /// </summary>
        private void DrawSprite(int par1, int par2, int par3, int par4)
        {
            int i = Mc.RenderEngineOld.GetTexture("/gui/slot.png");

            //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F);
            Mc.RenderEngineOld.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();
        }
Ejemplo n.º 24
0
        public virtual void RenderPiston(TileEntityPiston par1TileEntityPiston, double par2, double par4, double par6, float par8)
        {
            Block block = Block.BlocksList[par1TileEntityPiston.GetStoredBlockID()];

            if (block != null && par1TileEntityPiston.GetProgress(par8) < 1.0F)
            {
                Tessellator tessellator = Tessellator.Instance;
                BindTextureByName("/terrain.png");
                RenderHelper.DisableStandardItemLighting();
                //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
                //GL.Enable(EnableCap.Blend);
                //GL.Disable(EnableCap.CullFace);

                if (Minecraft.IsAmbientOcclusionEnabled())
                {
                    //GL.ShadeModel(ShadingModel.Smooth);
                }
                else
                {
                    //GL.ShadeModel(ShadingModel.Flat);
                }

                tessellator.StartDrawingQuads();
                tessellator.SetTranslation(((float)par2 - (float)par1TileEntityPiston.XCoord) + par1TileEntityPiston.GetOffsetX(par8), ((float)par4 - (float)par1TileEntityPiston.YCoord) + par1TileEntityPiston.GetOffsetY(par8), ((float)par6 - (float)par1TileEntityPiston.ZCoord) + par1TileEntityPiston.GetOffsetZ(par8));
                tessellator.SetColorOpaque(1, 1, 1);

                if (block == Block.PistonExtension && par1TileEntityPiston.GetProgress(par8) < 0.5F)
                {
                    BlockRenderer.RenderPistonExtensionAllFaces(block, par1TileEntityPiston.XCoord, par1TileEntityPiston.YCoord, par1TileEntityPiston.ZCoord, false);
                }
                else if (par1TileEntityPiston.ShouldRenderHead() && !par1TileEntityPiston.IsExtending())
                {
                    Block.PistonExtension.SetHeadTexture(((BlockPistonBase)block).GetPistonExtensionTexture());
                    BlockRenderer.RenderPistonExtensionAllFaces(Block.PistonExtension, par1TileEntityPiston.XCoord, par1TileEntityPiston.YCoord, par1TileEntityPiston.ZCoord, par1TileEntityPiston.GetProgress(par8) < 0.5F);
                    Block.PistonExtension.ClearHeadTexture();
                    tessellator.SetTranslation((float)par2 - (float)par1TileEntityPiston.XCoord, (float)par4 - (float)par1TileEntityPiston.YCoord, (float)par6 - (float)par1TileEntityPiston.ZCoord);
                    BlockRenderer.RenderPistonBaseAllFaces(block, par1TileEntityPiston.XCoord, par1TileEntityPiston.YCoord, par1TileEntityPiston.ZCoord);
                }
                else
                {
                    BlockRenderer.RenderBlockAllFaces(block, par1TileEntityPiston.XCoord, par1TileEntityPiston.YCoord, par1TileEntityPiston.ZCoord);
                }

                tessellator.SetTranslation(0.0F, 0.0F, 0.0F);
                tessellator.Draw();
                RenderHelper.EnableStandardItemLighting();
            }
        }
Ejemplo n.º 25
0
        public virtual void Func_35438_a(EntityXPOrb par1EntityXPOrb, double par2, double par4, double par6, float par8, float par9)
        {
            //GL.PushMatrix();
            //GL.Translate((float)par2, (float)par4, (float)par6);
            int i = par1EntityXPOrb.GetTextureByXP();

            LoadTexture("/item/xporb.png");
            Tessellator tessellator = Tessellator.Instance;
            float       f           = (float)((i % 4) * 16 + 0) / 64F;
            float       f1          = (float)((i % 4) * 16 + 16) / 64F;
            float       f2          = (float)((i / 4) * 16 + 0) / 64F;
            float       f3          = (float)((i / 4) * 16 + 16) / 64F;
            float       f4          = 1.0F;
            float       f5          = 0.5F;
            float       f6          = 0.25F;
            int         i7          = par1EntityXPOrb.GetBrightnessForRender(par9);
            float       f8          = i7 % 0x10000;
            int         j           = i7 / 0x10000;

            OpenGlHelper.SetLightmapTextureCoords(OpenGlHelper.LightmapTexUnit, (float)f8 / 1.0F, (float)j / 1.0F);
            //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F);
            float f7 = 255F;

            f8 = ((float)par1EntityXPOrb.XpColor + par9) / 2.0F;
            j  = (int)((MathHelper2.Sin(f8 + 0.0F) + 1.0F) * 0.5F * f7);
            int k  = (int)f7;
            int l  = (int)((MathHelper2.Sin(f8 + 4.18879F) + 1.0F) * 0.1F * f7);
            int i1 = j << 16 | k << 8 | l;
            //GL.Rotate(180F - RenderManager.PlayerViewY, 0.0F, 1.0F, 0.0F);
            //GL.Rotate(-RenderManager.PlayerViewX, 1.0F, 0.0F, 0.0F);
            float f9 = 0.3F;

            //GL.Scale(f9, f9, f9);
            tessellator.StartDrawingQuads();
            tessellator.SetColorRGBA_I(i1, 128);
            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.Disable(EnableCap.Blend);
            //GL.Disable(EnableCap.RescaleNormal);
            //GL.PopMatrix();
        }
Ejemplo n.º 26
0
        /// <summary>
        /// Renders a white box with the bounds of the AABB translated by the offset. Args: aabb, x, y, z
        /// </summary>
        public static void RenderOffsetAABB(AxisAlignedBB par0AxisAlignedBB, double par1, double par3, double par5)
        {
            //GL.Disable(EnableCap.Texture2D);
            Tessellator tessellator = Tessellator.Instance;

            //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F);
            tessellator.StartDrawingQuads();
            tessellator.SetTranslation(par1, par3, par5);
            tessellator.SetNormal(0.0F, 0.0F, -1F);
            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.SetNormal(0.0F, 0.0F, 1.0F);
            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.SetNormal(0.0F, -1F, 0.0F);
            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.SetNormal(0.0F, 1.0F, 0.0F);
            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.SetNormal(-1F, 0.0F, 0.0F);
            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.SetNormal(1.0F, 0.0F, 0.0F);
            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.SetTranslation(0.0F, 0.0F, 0.0F);
            tessellator.Draw();
            //GL.Enable(EnableCap.Texture2D);
        }
        private void Func_40265_a(Tessellator par1Tessellator, int par2)
        {
            float f  = (float)((par2 % 16) * 16 + 0) / 256F;
            float f1 = (float)((par2 % 16) * 16 + 16) / 256F;
            float f2 = (float)((par2 / 16) * 16 + 0) / 256F;
            float f3 = (float)((par2 / 16) * 16 + 16) / 256F;
            float f4 = 1.0F;
            float f5 = 0.5F;
            float f6 = 0.25F;

            //GL.Rotate(180F - RenderManager.PlayerViewY, 0.0F, 1.0F, 0.0F);
            //GL.Rotate(-RenderManager.PlayerViewX, 1.0F, 0.0F, 0.0F);
            par1Tessellator.StartDrawingQuads();
            par1Tessellator.SetNormal(0.0F, 1.0F, 0.0F);
            par1Tessellator.AddVertexWithUV(0.0F - f5, 0.0F - f6, 0.0F, f, f3);
            par1Tessellator.AddVertexWithUV(f4 - f5, 0.0F - f6, 0.0F, f1, f3);
            par1Tessellator.AddVertexWithUV(f4 - f5, f4 - f6, 0.0F, f1, f2);
            par1Tessellator.AddVertexWithUV(0.0F - f5, f4 - f6, 0.0F, f, f2);
            par1Tessellator.Draw();
        }
Ejemplo n.º 28
0
        private void RenderPumpkinBlur(int par1, int par2)
        {
            //GL.Disable(EnableCap.DepthTest);
            //GL.DepthMask(false);
            //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
            //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F);
            //GL.Disable(EnableCap.AlphaTest);
            //GL.BindTexture(TextureTarget.Texture2D, mc.RenderEngineOld.GetTexture("%blur%/misc/pumpkinblur.png"));
            Tessellator tessellator = Tessellator.Instance;

            tessellator.StartDrawingQuads();
            tessellator.AddVertexWithUV(0.0F, par2, -90D, 0.0F, 1.0D);
            tessellator.AddVertexWithUV(par1, par2, -90D, 1.0D, 1.0D);
            tessellator.AddVertexWithUV(par1, 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.Enable(EnableCap.AlphaTest);
            //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F);
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Renders the fire on the screen for first person mode. Arg: partialTickTime
        /// </summary>
        private void RenderFireInFirstPerson(float par1)
        {
            Tessellator tessellator = Tessellator.Instance;
            //GL.Color4(1.0F, 1.0F, 1.0F, 0.9F);
            //GL.Enable(EnableCap.Blend);
            //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
            float f = 1.0F;

            for (int i = 0; i < 2; i++)
            {
                //GL.PushMatrix();
                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;
                //GL.Translate((float)(-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F);
                //GL.Rotate((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();
                //GL.PopMatrix();
            }

            //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F);
            //GL.Disable(EnableCap.Blend);
        }
        public override void RenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
        {
            int i = (int)((((float)Field_35130_a + par2) * 15F) / (float)Field_35129_ay);

            if (i > 15)
            {
                return;
            }
            else
            {
                Field_35128_az.BindTexture("misc.explosion.png");
                float f  = (float)(i % 4) / 4F;
                float f1 = f + 0.24975F;
                float f2 = (float)(i / 4) / 4F;
                float f3 = f2 + 0.24975F;
                float f4 = 2.0F * Field_35131_aA;
                float f5 = (float)((PrevPosX + (PosX - PrevPosX) * (double)par2) - InterpPosX);
                float f6 = (float)((PrevPosY + (PosY - PrevPosY) * (double)par2) - InterpPosY);
                float f7 = (float)((PrevPosZ + (PosZ - PrevPosZ) * (double)par2) - InterpPosZ);
                //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F);
                //GL.Disable(EnableCap.Lighting);
                RenderHelper.DisableStandardItemLighting();
                par1Tessellator.StartDrawingQuads();
                par1Tessellator.SetColorRGBA_F(ParticleRed, ParticleGreen, ParticleBlue, 1.0F);
                par1Tessellator.SetNormal(0.0F, 1.0F, 0.0F);
                par1Tessellator.SetBrightness(240);
                par1Tessellator.AddVertexWithUV(f5 - par3 * f4 - par6 * f4, f6 - par4 * f4, f7 - par5 * f4 - par7 * f4, f1, f3);
                par1Tessellator.AddVertexWithUV((f5 - par3 * f4) + par6 * f4, f6 + par4 * f4, (f7 - par5 * f4) + par7 * f4, f1, f2);
                par1Tessellator.AddVertexWithUV(f5 + par3 * f4 + par6 * f4, f6 + par4 * f4, f7 + par5 * f4 + par7 * f4, f, f2);
                par1Tessellator.AddVertexWithUV((f5 + par3 * f4) - par6 * f4, f6 - par4 * f4, (f7 + par5 * f4) - par7 * f4, f, f3);
                par1Tessellator.Draw();
                //GL.PolygonOffset(0.0F, 0.0F);
                //GL.Enable(EnableCap.Lighting);
                return;
            }
        }