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();
        }
예제 #2
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);
        }
예제 #3
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();
            }
        }
예제 #4
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();
            }
        }
예제 #5
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);
        }
        /// <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);
        }
예제 #7
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();
        }
예제 #8
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);
        }
예제 #9
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);
        }
예제 #10
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);
        }
예제 #11
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();
        }
예제 #12
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();
        }
예제 #13
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);
        }
예제 #14
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);
        }
        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();
        }
        /// <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();
                    }
                }
            }
        }
예제 #17
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();
 }
예제 #18
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();
            }
        }
예제 #20
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();
        }
예제 #21
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();
        }
예제 #22
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();
            }
        }
        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();
        }
예제 #24
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();
        }
예제 #26
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);
        }
예제 #27
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;
            }
        }
예제 #29
0
        /// <summary>
        /// Renders fire on top of the entity. Args: entity, x, y, z, partialTickTime
        /// </summary>
        private void RenderEntityOnFire(Entity par1Entity, double par2, double par4, double par6, float par8)
        {
            //GL.Disable(EnableCap.Lighting);
            int   i  = Block.Fire.BlockIndexInTexture;
            int   j  = (i & 0xf) << 4;
            int   k  = i & 0xf0;
            float f  = (float)j / 256F;
            float f2 = ((float)j + 15.99F) / 256F;
            float f4 = (float)k / 256F;
            float f6 = ((float)k + 15.99F) / 256F;
            //GL.PushMatrix();
            //GL.Translate((float)par2, (float)par4, (float)par6);
            float f8 = par1Entity.Width * 1.4F;

            //GL.Scale(f8, f8, f8);
            LoadTexture("terrain.png");
            Tessellator tessellator = Tessellator.Instance;
            float       f9          = 0.5F;
            float       f10         = 0.0F;
            float       f11         = par1Entity.Height / f8;
            float       f12         = (float)(par1Entity.PosY - par1Entity.BoundingBox.MinY);
            //GL.Rotate(-RenderManager.PlayerViewY, 0.0F, 1.0F, 0.0F);
            //GL.Translate(0.0F, 0.0F, -0.3F + (float)(int)f11 * 0.02F);
            //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F);
            float f13 = 0.0F;
            int   l   = 0;

            tessellator.StartDrawingQuads();

            while (f11 > 0.0F)
            {
                float f1;
                float f3;
                float f5;
                float f7;

                if (l % 2 == 0)
                {
                    f1 = (float)j / 256F;
                    f3 = ((float)j + 15.99F) / 256F;
                    f5 = (float)k / 256F;
                    f7 = ((float)k + 15.99F) / 256F;
                }
                else
                {
                    f1 = (float)j / 256F;
                    f3 = ((float)j + 15.99F) / 256F;
                    f5 = (float)(k + 16) / 256F;
                    f7 = ((float)(k + 16) + 15.99F) / 256F;
                }

                if ((l / 2) % 2 == 0)
                {
                    float f14 = f3;
                    f3 = f1;
                    f1 = f14;
                }

                tessellator.AddVertexWithUV(f9 - f10, 0.0F - f12, f13, f3, f7);
                tessellator.AddVertexWithUV(-f9 - f10, 0.0F - f12, f13, f1, f7);
                tessellator.AddVertexWithUV(-f9 - f10, 1.4F - f12, f13, f1, f5);
                tessellator.AddVertexWithUV(f9 - f10, 1.4F - f12, f13, f3, f5);
                f11 -= 0.45F;
                f12 -= 0.45F;
                f9  *= 0.9F;
                f13 += 0.03F;
                l++;
            }

            tessellator.Draw();
            //GL.PopMatrix();
            //GL.Enable(EnableCap.Lighting);
        }
예제 #30
0
        /// <summary>
        /// Renders the entity shadows at the position, shadow alpha and partialTickTime. Args: entity, x, y, z, shadowAlpha,
        /// partialTickTime
        /// </summary>
        private void RenderShadow(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
        {
            //GL.Enable(EnableCap.Blend);
            //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
            RenderEngine renderengine = RenderManager.RenderEngine;

            renderengine.BindTexture("misc.shadow.png", TextureMode.Clamp);
            World world = GetWorldFromRenderManager();
            //GL.DepthMask(false);
            float f = ShadowSize;

            if (par1Entity is EntityLiving)
            {
                EntityLiving entityliving = (EntityLiving)par1Entity;
                f *= entityliving.GetRenderSizeModifier();

                if (entityliving is EntityAnimal)
                {
                    EntityAnimal entityanimal = (EntityAnimal)entityliving;

                    if (entityanimal.IsChild())
                    {
                        f *= 0.5F;
                    }
                }
            }

            double      d           = par1Entity.LastTickPosX + (par1Entity.PosX - par1Entity.LastTickPosX) * (double)par9;
            double      d1          = par1Entity.LastTickPosY + (par1Entity.PosY - par1Entity.LastTickPosY) * (double)par9 + (double)par1Entity.GetShadowSize();
            double      d2          = par1Entity.LastTickPosZ + (par1Entity.PosZ - par1Entity.LastTickPosZ) * (double)par9;
            int         i           = MathHelper2.Floor_double(d - (double)f);
            int         j           = MathHelper2.Floor_double(d + (double)f);
            int         k           = MathHelper2.Floor_double(d1 - (double)f);
            int         l           = MathHelper2.Floor_double(d1);
            int         i1          = MathHelper2.Floor_double(d2 - (double)f);
            int         j1          = MathHelper2.Floor_double(d2 + (double)f);
            double      d3          = par2 - d;
            double      d4          = par4 - d1;
            double      d5          = par6 - d2;
            Tessellator tessellator = Tessellator.Instance;

            tessellator.StartDrawingQuads();

            for (int k1 = i; k1 <= j; k1++)
            {
                for (int l1 = k; l1 <= l; l1++)
                {
                    for (int i2 = i1; i2 <= j1; i2++)
                    {
                        int j2 = world.GetBlockId(k1, l1 - 1, i2);

                        if (j2 > 0 && world.GetBlockLightValue(k1, l1, i2) > 3)
                        {
                            RenderShadowOnBlock(Block.BlocksList[j2], par2, par4 + (double)par1Entity.GetShadowSize(), par6, k1, l1, i2, par8, f, d3, d4 + (double)par1Entity.GetShadowSize(), d5);
                        }
                    }
                }
            }

            tessellator.Draw();
            //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F);
            //GL.Disable(EnableCap.Blend);
            //GL.DepthMask(true);
        }