Ejemplo n.º 1
0
 public override void vmethod_14(Stream26 stream26_0)
 {
     if (this.vmethod_8())
     {
         byte[] array = new byte[4];
         array[1] = 1;
         array[2] = (byte)(this.vmethod_15() - 128);
         stream26_0.WriteByteArray(array, false);
     }
     else
     {
         byte[] array2 = new byte[4];
         array2[1] = this.vmethod_15();
         stream26_0.WriteByteArray(array2, false);
     }
     stream26_0.WriteInt(this.int_0);
     stream26_0.WriteInt((base.Nodes.Count != 0) ? ((int)stream26_0.Position + 8) : 0);
     int int_ = (int)stream26_0.Position;
     stream26_0.WriteInt(0);
     foreach (AbstractTreeNode1 @class in base.Nodes)
     {
         @class.vmethod_14(stream26_0);
     }
     int num = (int)stream26_0.Position;
     if (base.method_1().Nodes.IndexOf(this) < base.method_1().Nodes.Count - 1)
     {
         stream26_0.WriteIntAt(int_, num);
     }
     else
     {
         stream26_0.WriteIntAt(int_, 0);
     }
     stream26_0.Position = (long)num;
 }
Ejemplo n.º 2
0
        public Stream26 ToStream()
        {
            Stream26 stream = new Stream26(true);
            int textureCount = this.TextureCount();
            int textureMetaDataOffset = 0;
            if (!this._unkFlag0)
            {
                stream.WriteUInt(0xFACECAA7); //meow
                stream.WriteShort(284);
                stream.WriteShort((short)textureCount);
                stream.WriteInt(0);
                stream.WriteInt(0);
                stream.WriteInt(-1);

                int num3 = 2;
                while ((double)textureCount / Math.Pow(2.0, (double)(num3 - 2)) > 1.0)
                {
                    num3++;
                }
                num3--;
                stream.WriteInt(num3); //logarithm of textureCount?..
                stream.WriteInt(28);
                stream.WriteNBytes(0xEF, (int)(Math.Pow(2.0, (double)num3) * 12.0 + 28.0));

                textureMetaDataOffset = (int)stream.Position;
                stream.WriteIntAt(8, textureMetaDataOffset);
                stream.WriteInt(textureMetaDataOffset + textureCount * 44);
                stream.Position = (long)textureMetaDataOffset;
            }
            stream.WriteNBytes(0, 40 * textureCount);
            for (int i = 0; i < textureCount; i++)
            {
                TextureMetadata tex = this.textureList[i];
                byte[] array = this.method_2(i);
                stream.WriteShortAt(textureMetaDataOffset + 40 * i, 2600);
                stream.WriteShort(tex.unkShort0);
                stream.WriteInt(tex.unkInt);
                stream.WriteShort(tex.Width);
                stream.WriteShort(tex.Height);
                stream.WriteShort(tex.unkShort3);
                stream.WriteShort(tex.Width);
                stream.WriteShort(tex.Height);
                stream.WriteShort(tex.unkShort3);
                stream.WriteByte2(tex.MipMapCount);
                stream.WriteShort(tex.unkShort4);
                stream.WriteNBytes(0, 5);
                stream.WriteInt((int)stream.Length);
                stream.WriteInt(array.Length);
                stream.WriteInt(0);
                stream.WriteByteArrayAt((int)stream.Length, array, false);
            }
            return stream;
        }
Ejemplo n.º 3
0
 public void method_10(Stream26 stream26_0)
 {
     stream26_0.WriteByteArray(this.byte_0, false);
     this.vmethod_14(stream26_0);
     stream26_0.WriteIntAt(4, (int)stream26_0.Length);
     stream26_0.Position = stream26_0.Length;
 }
Ejemplo n.º 4
0
 public override void vmethod_14(Stream26 stream26_0)
 {
     if (this.vmethod_8())
     {
         byte[] array = new byte[4];
         array[1] = 1;
         array[2] = 3;
         stream26_0.WriteByteArray(array, false);
     }
     else
     {
         byte[] array2 = new byte[4];
         array2[1] = (byte)(this.vmethod_7() ? 131 : 7);
         stream26_0.WriteByteArray(array2, false);
     }
     stream26_0.WriteInt(this.int_0);
     int int_ = (int)stream26_0.Position + 4;
     if (base.Nodes.Count != 0)
     {
         stream26_0.WriteInt((int)stream26_0.Position + 8);
         stream26_0.WriteInt(0);
         stream26_0.WriteString(this.method_8());
         stream26_0.WriteByte2(0);
         stream26_0.WriteNBytes(0, AbstractTreeNode1.smethod_0(stream26_0.Position));
     }
     else
     {
         stream26_0.WriteInt(0);
     }
     int num = (int)stream26_0.Position;
     if (base.method_1().Nodes.IndexOf(this) < base.method_1().Nodes.Count - 1)
     {
         stream26_0.WriteIntAt(int_, num);
     }
     else
     {
         stream26_0.WriteIntAt(int_, 0);
     }
     stream26_0.Position = (long)num;
 }