Exemplo n.º 1
0
        public override void Draw()
        {
            float num1   = 22f;
            float num2   = 0.0f;
            float num3   = 13f;
            Vec2  vec2_1 = Vec2.Zero;
            Vec2  vec2_2 = Vec2.Zero;
            bool  flag1  = false;
            bool  flag2  = false;
            Vec2  t1     = new Vec2(0.0f, 0.0f);
            Vec2  t2     = new Vec2(1f, 0.0f);
            Vec2  t3     = new Vec2(0.0f, 1f);
            Vec2  t4     = new Vec2(1f, 1f);

            if (this._capeTexture == null)
            {
                return;
            }
            float depth = DuckGame.Graphics.AdjustDepth(this.depth);

            for (int index = this.capePeices.Count - 1; index >= 0; --index)
            {
                TrailPiece capePeice = this.capePeices[index];
                Vec2       vec2_3    = vec2_2;
                if (index > 0)
                {
                    Vec2 vec2_4 = capePeice.p1 - this.capePeices[index - 1].p1;
                    vec2_4.Normalize();
                    vec2_3 = vec2_4.Rotate(Maths.DegToRad(90f), Vec2.Zero);
                }
                Vec2 vec2_5 = capePeice.p1;
                if (flag1)
                {
                    Vec2  vec2_4 = vec2_5 - vec2_1;
                    float length = vec2_4.length;
                    num2 += length;
                    vec2_4.Normalize();
                    if ((double)num2 > (double)num1)
                    {
                        vec2_5 = vec2_1 + vec2_4 * (length - (num2 - num1));
                        flag2  = true;
                    }
                    DuckGame.Graphics.screen.DrawQuad(vec2_5 - vec2_3 * (float)((double)num3 * (double)capePeice.wide / 2.0), vec2_5 + vec2_3 * (float)((double)num3 * (double)capePeice.wide / 2.0), vec2_1 - vec2_2 * (float)((double)num3 * (double)capePeice.wide / 2.0), vec2_1 + vec2_2 * (float)((double)num3 * (double)capePeice.wide / 2.0), t1, t2, t3, t4, depth, this._capeTexture, Color.White);
                    if (flag2)
                    {
                        break;
                    }
                }
                flag1  = true;
                vec2_1 = vec2_5;
                vec2_2 = vec2_3;
            }
        }
Exemplo n.º 2
0
        public override void Draw()
        {
            float num1   = 13f;
            Vec2  vec2_1 = Vec2.Zero;
            Vec2  vec2_2 = Vec2.Zero;
            bool  flag1  = false;
            bool  flag2  = false;

            if (this._capeTexture == null)
            {
                return;
            }
            float depth = DuckGame.Graphics.AdjustDepth(this.depth);
            float num2  = 1f / (float)this.capePeices.Count;
            float val1  = 0.0f;

            for (int index = this.capePeices.Count - 1; index >= 0; --index)
            {
                Vec2      t1        = new Vec2(0.0f, Math.Min(val1 + num2, 1f));
                Vec2      t2        = new Vec2(1f, Math.Min(val1 + num2, 1f));
                Vec2      t3        = new Vec2(0.0f, Math.Min(val1, 1f));
                Vec2      t4        = new Vec2(1f, Math.Min(val1, 1f));
                CapePeice capePeice = this.capePeices[index];
                Vec2      vec2_3    = vec2_2;
                if (index > 0)
                {
                    Vec2 vec2_4 = capePeice.p1 - this.capePeices[index - 1].p1;
                    vec2_4.Normalize();
                    vec2_3 = vec2_4.Rotate(Maths.DegToRad(90f), Vec2.Zero);
                }
                Vec2 vec2_5 = capePeice.p1;
                if (flag1)
                {
                    Vec2  vec2_4 = vec2_5 - vec2_1;
                    float length = vec2_4.length;
                    vec2_4.Normalize();
                    if ((double)length > 2.0)
                    {
                        vec2_5 = vec2_1 + vec2_4 * 2f;
                    }
                    DuckGame.Graphics.screen.DrawQuad(vec2_5 - vec2_3 * (float)((double)num1 * (double)capePeice.wide / 2.0), vec2_5 + vec2_3 * (float)((double)num1 * (double)capePeice.wide / 2.0), vec2_1 - vec2_2 * (float)((double)num1 * (double)capePeice.wide / 2.0), vec2_1 + vec2_2 * (float)((double)num1 * (double)capePeice.wide / 2.0), t1, t2, t3, t4, depth, this._capeTexture, new Color((int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue, this._trail ? (int)(byte)((double)index / (double)this.capePeices.Count * (double)byte.MaxValue) : (int)byte.MaxValue));
                    if (flag2)
                    {
                        break;
                    }
                }
                flag1  = true;
                vec2_1 = vec2_5;
                vec2_2 = vec2_3;
                val1  += num2;
            }
        }