Example #1
0
 protected override void OnCompile()
 {
     this.Apply();
     if (this.hasRotate)
     {
         this.hasScale = true;
     }
     this.Append(new UB(1, Convert.ToInt32(this.hasScale)));
     if (this.hasScale)
     {
         double num = Math.Cos(this._angle);
         BitCounter.Init();
         BitCounter.Push(FB.NumBits(this._scX));
         BitCounter.Push(FB.NumBits(this._scY));
         int maxim = BitCounter.Maxim;
         this.Append(new UB(5, maxim));
         this.Append(new FB(maxim, this._scX));
         this.Append(new FB(maxim, this._scY));
     }
     this.Append(new UB(1, Convert.ToInt32(this.hasRotate)));
     if (this.hasRotate)
     {
         double num3 = Math.Sin(this._angle);
         BitCounter.Init();
         BitCounter.Push(FB.NumBits(this._rt0));
         BitCounter.Push(FB.NumBits(this._rt1));
         int val = BitCounter.Maxim;
         this.Append(new UB(5, val));
         this.Append(new FB(val, this._rt0));
         this.Append(new FB(val, this._rt1));
     }
     if (this.hasTranslation)
     {
         int num5 = this._tranX - this._objX;
         int num6 = this._tranY - this._objY;
         if (this.hasRotate)
         {
             double num7 = Math.Cos(this._angle);
             double num8 = this._scaleX * num7;
             double num9 = this._scaleY * num7;
             num5 = (this._tranX - ((int)(this._objX * num8))) + ((int)(this._objY * Math.Sin(this._angle)));
             num6 = (this._tranY - ((int)(this._objX * Math.Sin(this._angle)))) - ((int)(this._objY * num9));
         }
         BitCounter.Init();
         BitCounter.Push(SB.NumBits(this._trX));
         BitCounter.Push(SB.NumBits(this._trY));
         int num10 = BitCounter.Maxim;
         this.Append(new UB(5, num10));
         this.Append(new SB(num10, this._trX));
         this.Append(new SB(num10, this._trY));
     }
     else
     {
         this.Append(new UB(5, 0));
     }
 }
Example #2
0
        public static int NumBits(double val)
        {
            int num = (int)(val * 65536.0);

            return(SB.NumBits(num));
        }