예제 #1
0
        /// <summary>
        /// Loads the file from the specified stream.
        /// </summary>
        /// <param name="stream">The stream to read from.</param>
        public override void Load(Stream stream)
        {
            BinaryReader reader = new BinaryReader(stream, CodePagesEncodingProvider.Instance.GetEncoding("EUC-KR"));

            int objectCount = reader.ReadInt32();

            for (int i = 0; i < objectCount; i++)
            {
                int partCount = reader.ReadInt32();

                LightmapObject @object = new LightmapObject();
                @object.ID = reader.ReadInt32() - 1;

                for (int j = 0; j < partCount; j++)
                {
                    LightmapPart part = new LightmapPart();
                    part.Name            = reader.ReadString();
                    part.ID              = reader.ReadInt32() - 1;
                    part.FileName        = reader.ReadString();
                    part.LightmapIndex   = reader.ReadInt32();
                    part.PixelsPerObject = reader.ReadInt32();
                    part.ObjectsPerWidth = reader.ReadInt32();
                    part.ObjectPosition  = reader.ReadInt32();

                    @object.Parts.Add(@part);
                }

                Objects.Add(@object);
            }

            int fileCount = reader.ReadInt32();

            for (int i = 0; i < fileCount; i++)
            {
                Files.Add(reader.ReadString());
            }
        }
예제 #2
0
        /// <summary>
        /// Loads the file from the specified stream.
        /// </summary>
        /// <param name="stream">The stream to read from.</param>
        public override void Load(Stream stream)
        {
            BinaryReader reader = new BinaryReader(stream, Encoding.GetEncoding("EUC-KR"));

            int objectCount = reader.ReadInt32();

            for (int i = 0; i < objectCount; i++) {
                int partCount = reader.ReadInt32();

                LightmapObject @object = new LightmapObject();
                @object.ID = reader.ReadInt32() - 1;

                for (int j = 0; j < partCount; j++) {
                    LightmapPart part = new LightmapPart();
                    part.Name = reader.ReadString();
                    part.ID = reader.ReadInt32() - 1;
                    part.FileName = reader.ReadString();
                    part.LightmapIndex = reader.ReadInt32();
                    part.PixelsPerObject = reader.ReadInt32();
                    part.ObjectsPerWidth = reader.ReadInt32();
                    part.ObjectPosition = reader.ReadInt32();

                    @object.Parts.Add(@part);
                }

                Objects.Add(@object);
            }

            int fileCount = reader.ReadInt32();

            for (int i = 0; i < fileCount; i++) {
                Files.Add(reader.ReadString());
            }
        }