示例#1
0
		public static TextureInfo readTextureInfo(BinaryReader r) {
			TextureInfo t = new TextureInfo();
			t.texturePresent = r.ReadByte();
			
			if (t.texturePresent != 0) {
				t.unk1 = r.ReadByte();
				t.shaderNameIDX = r.ReadInt32();

				t.texturesCount = r.ReadByte();
				t.texturesArray = new TextureImageInfo[t.texturesCount];

				for (int i = 0; i < t.texturesCount; ++i) {
					t.texturesArray[i] = new TextureImageInfo();
					t.texturesArray[i].textureIDX = r.ReadUInt32();//String Dictionary Offset
					t.texturesArray[i].unk4 = r.ReadByte();
					t.texturesArray[i].repetition = r.ReadSingle();//Float
					t.texturesArray[i].unk6 = r.ReadInt32();
					t.texturesArray[i].unk7 = r.ReadInt32();
				}
				t.count2 = r.ReadUInt32();
				t.unk8 = new int[t.count2];
				for (int i = 0; i < t.count2; ++i) {
					t.unk8[i] = r.ReadInt32();
				}
				t.count3 = r.ReadUInt32();
				t.unk9 = new float[t.count3];
				for (int i = 0; i < t.count3; ++i) {
					t.unk9[i] = r.ReadSingle();
				}
			}
			return t;
		}
示例#2
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);
        }