Пример #1
0
        public CELFile(byte[] fileData, bool isCL2 = false)
        {
            this.fileData = fileData;
            this.isCL2    = isCL2;
            //this.isTileCel = !isCL2;

            var r     = new BinaryReader(fileData);
            var first = r.ReadU32();

            if (first == 32)
            {
                if (isCL2)
                {
                    r.Seek(0);
                    ReadCL2ArchiveOffsets(r);
                }
                else
                {
                    r.Seek(32);
                    for (int i = 0; i < 8; ++i)
                    {
                        ReadNormalOffsets(r);
                    }
                }
            }
            else
            {
                r.Seek(0);
                ReadNormalOffsets(r);
            }

            Debug.WriteLine("NumFrames: " + NumFrames);
        }
Пример #2
0
 private void ReadCL2ArchiveOffsets(BinaryReader r)
 {
     var headerOffsets = new uint[8];
     for (int i = 0; i < 8; ++i)
         headerOffsets[i] = r.ReadU32();
     for (int i = 0; i < 8; ++i) {
         r.Seek((int)headerOffsets[i]);
         ReadNormalOffsets(r, headerOffsets[i]);
     }
 }
Пример #3
0
        private void ReadCL2ArchiveOffsets(BinaryReader r)
        {
            var headerOffsets = new uint[8];

            for (int i = 0; i < 8; ++i)
            {
                headerOffsets[i] = r.ReadU32();
            }
            for (int i = 0; i < 8; ++i)
            {
                r.Seek((int)headerOffsets[i]);
                ReadNormalOffsets(r, headerOffsets[i]);
            }
        }
Пример #4
0
        public CELFile(byte[] fileData, bool isCL2 = false)
        {
            this.fileData = fileData;
            this.isCL2 = isCL2;
            //this.isTileCel = !isCL2;

            var r = new BinaryReader(fileData);
            var first = r.ReadU32();
            if (first == 32) {
                if (isCL2) {
                    r.Seek(0);
                    ReadCL2ArchiveOffsets(r);
                } else {
                    r.Seek(32);
                    for (int i = 0; i < 8; ++i)
                        ReadNormalOffsets(r);
                }
            } else {
                r.Seek(0);
                ReadNormalOffsets(r);
            }

            Debug.WriteLine("NumFrames: " + NumFrames);
        }