Ejemplo n.º 1
0
        public static TerrainDefinition readTerrainDefinition(BinaryReader r)
        {
            TerrainDefinition td = new TerrainDefinition();

            td.nameIDX = r.ReadUInt32();
            td.index   = r.ReadUInt32();
            td._unk3   = r.ReadUInt32();
            td._unk4   = r.ReadUInt32();
            td._unk5   = r.ReadUInt32();

            td.aliasCount = r.ReadUInt32();

            if (td.aliasCount > 0)
            {
                td.aliases = new terrainDefinitionAlias[td.aliasCount];
                for (uint i = 0; i < td.aliasCount; ++i)
                {
                    td.aliases[i].countIndex = r.ReadUInt32();
                    td.aliases[i].oldAlias   = r.ReadUInt32();
                    td.aliases[i].flags      = r.ReadUInt64();
                }
            }

            td.textures = TextureInfo.readTextureInfo(r);

            return(td);
        }
Ejemplo n.º 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);
        }