public static AnimationAppearanceItem ReadAnimationAppearance(BinaryReader r) {
			AnimationAppearanceItem aa = new AnimationAppearanceItem();

			aa.count4 = r.ReadInt32();

			aa.sub = new AnimationAppearanceItemSub[aa.count4];
			for (int i = 0; i < aa.count4; ++i) {
				aa.sub[i] = new AnimationAppearanceItemSub();
				aa.sub[i].subval = r.ReadByte();
				
				if (aa.sub[i].subval != 0) {
					if (aa.sub[i].subval == 1) {
						aa.sub[i].sub1 = new AnimationAppearanceItemSub1();
						aa.sub[i].sub1.unk1 = r.ReadByte();
						aa.sub[i].sub1.unk2 = r.ReadInt32();
					}
				} else {
					uint subcount1 = r.ReadUInt32();
					aa.sub[i].sub2 = new AnimationAppearanceItemSub2[subcount1];

					for (int j = 0; j < aa.sub[i].sub2.Length; ++j) {
						aa.sub[i].sub2[j] = new AnimationAppearanceItemSub2();
						aa.sub[i].sub2[j].unk1 = r.ReadInt32();
						aa.sub[i].sub2[j].unk2 = r.ReadInt32();
					}
				}
			}
			return aa;
		}
        public static string PrintAnimationAppearance(AnimationAppearanceItem aa)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("C4\t" + aa.count4);
            for (int i = 0; i < aa.count4; ++i)
            {
                sb.AppendLine("val\t" + aa.sub[i].subval + " animation appearance filter");
                if (aa.sub[i].subval != 0)
                {
                    if (aa.sub[i].subval == 1)
                    {
                        sb.AppendLine("\t\t" + aa.sub[i].sub1.unk1 + " " + aa.sub[i].sub1.unk2);
                    }
                }
                else
                {
                    sb.AppendLine("\tSubC\t" + aa.sub[i].sub2.Length);
                    for (int j = 0; j < aa.sub[i].sub2.Length; ++j)
                    {
                        sb.AppendLine("\t\t" + aa.sub[i].sub2[j].unk1 + " " + aa.sub[i].sub2[j].unk2);
                    }
                }
            }

            return(sb.ToString());
        }
		public static string PrintAnimationAppearance(AnimationAppearanceItem aa) {
			StringBuilder sb = new StringBuilder();

			sb.AppendLine("C4\t" + aa.count4);
			for (int i = 0; i < aa.count4; ++i) {
				sb.AppendLine("val\t" + aa.sub[i].subval + " animation appearance filter");
				if (aa.sub[i].subval != 0) {
					if (aa.sub[i].subval == 1) {
						sb.AppendLine("\t\t" + aa.sub[i].sub1.unk1 + " " + aa.sub[i].sub1.unk2);
					}
				} else {
					sb.AppendLine("\tSubC\t" + aa.sub[i].sub2.Length);
					for (int j = 0; j < aa.sub[i].sub2.Length; ++j) {
						sb.AppendLine("\t\t" + aa.sub[i].sub2[j].unk1 + " " + aa.sub[i].sub2[j].unk2);
					}
				}
			}

			return sb.ToString();
		}
        public static AnimationAppearanceItem ReadAnimationAppearance(BinaryReader r)
        {
            AnimationAppearanceItem aa = new AnimationAppearanceItem();

            aa.count4 = r.ReadInt32();

            aa.sub = new AnimationAppearanceItemSub[aa.count4];
            for (int i = 0; i < aa.count4; ++i)
            {
                aa.sub[i]        = new AnimationAppearanceItemSub();
                aa.sub[i].subval = r.ReadByte();

                if (aa.sub[i].subval != 0)
                {
                    if (aa.sub[i].subval == 1)
                    {
                        aa.sub[i].sub1      = new AnimationAppearanceItemSub1();
                        aa.sub[i].sub1.unk1 = r.ReadByte();
                        aa.sub[i].sub1.unk2 = r.ReadInt32();
                    }
                }
                else
                {
                    uint subcount1 = r.ReadUInt32();
                    aa.sub[i].sub2 = new AnimationAppearanceItemSub2[subcount1];

                    for (int j = 0; j < aa.sub[i].sub2.Length; ++j)
                    {
                        aa.sub[i].sub2[j]      = new AnimationAppearanceItemSub2();
                        aa.sub[i].sub2[j].unk1 = r.ReadInt32();
                        aa.sub[i].sub2[j].unk2 = r.ReadInt32();
                    }
                }
            }
            return(aa);
        }
Beispiel #5
0
        public static Tileart readTileart(BinaryReader r)
        {
            Tileart t = new Tileart();

            t.header    = r.ReadUInt16();         //fixed 03
            t.nameIndex = r.ReadUInt32();         //t.group = Enum.Parse(typeof(TileGroup), r.ReadUInt32().ToString());
            t.id        = r.ReadUInt32();

            t.unk       = r.ReadByte();
            t.unk7      = r.ReadByte();
            t.unk2      = r.ReadSingle();
            t.unk3      = r.ReadSingle();
            t.fixedZero = r.ReadInt32();
            t.oldID     = r.ReadInt32();
            t.unk6      = r.ReadInt32();
            t.unk_type  = r.ReadInt32();

            t.unk8  = r.ReadByte();
            t.unk9  = r.ReadInt32();
            t.unk10 = r.ReadInt32();
            t.unk11 = r.ReadSingle();
            t.unk12 = r.ReadSingle();
            t.unk13 = r.ReadInt32();

            t.int_flags      = r.ReadInt64();
            t.int_flags_full = r.ReadInt64();

            t.flags  = (TileFlag)Enum.Parse(typeof(TileFlag), t.int_flags.ToString());
            t.flags2 = (TileFlag)Enum.Parse(typeof(TileFlag), t.int_flags_full.ToString());

            t.unk16 = r.ReadInt32();

            //IMAGE OFFSET
            for (int i = 0; i < 6; ++i)
            {
                t.imgoffEC[i] = r.ReadInt32();
            }
            for (int i = 0; i < 6; ++i)
            {
                t.imgoff2D[i] = r.ReadInt32();
            }

            t.offsetEC = new TileartImageOffset(t.imgoffEC);
            t.offset2D = new TileartImageOffset(t.imgoff2D);

            try {
                //PROPERTIES
                t.props  = ReadProps(t, r);
                t.props2 = ReadProps(t, r);                     //Repetition (?)
                //9_3
                ReadStackAliases(t, r);
                //9_4
                t.appearance = AnimationAppearanceItem.ReadAnimationAppearance(r);
                //9_5
                t.sittingAnimation = SittingAnimationItem.ReadSittingAnimation(r);
                //Radarcol
                t.radarCol = RadarColItem.ReadRadarCol(r);

                t.textures[0] = TextureInfo.readTextureInfo(r);
                t.textures[1] = TextureInfo.readTextureInfo(r);
                t.textures[2] = TextureInfo.readTextureInfo(r);
                t.textures[3] = TextureInfo.readTextureInfo(r);                //New Format
                //9_8
                ReadEffects(t, r);
            } catch {
            }
            return(t);
        }