Exemple #1
0
        public CR2WExportWrapper(CR2WExport export, CR2WFile file)
        {
            this.cr2w = file;
            _export   = export;

            Type = cr2w.names[export.className].Str;
        }
Exemple #2
0
 private void FixExportCRC32(ref CR2WExport export)
 {
     m_stream.Seek(export.dataOffset, SeekOrigin.Begin);
     m_temp = new byte[export.dataSize];
     m_stream.Read(m_temp, 0, m_temp.Length);
     export.crc32 = Crc32Algorithm.Compute(m_temp);
 }
Exemple #3
0
 public CR2WExportWrapper(CR2WFile file)
 {
     this.cr2w = file;
     _export   = new CR2WExport
     {
         objectFlags = 8192,
     };
 }
Exemple #4
0
        /// <summary>
        /// This constructor is only used in cr2w parsing = deserialization
        /// </summary>
        /// <param name="export"></param>
        /// <param name="file"></param>
        public CR2WExportWrapper(CR2WExport export, CR2WFile file)
        {
            this.cr2w = file;
            _export   = export;

            REDType      = cr2w.Names[export.className].Str;
            AdReferences = new List <IChunkPtrAccessor>();
            AbReferences = new List <IChunkPtrAccessor>();
        }
Exemple #5
0
        /// <summary>
        /// This constructor should be used when manually creating chunks
        /// </summary>
        /// <param name="file"></param>
        /// <param name="redtype"></param>
        /// <param name="parentchunk"></param>
        /// <param name="cooked"></param>
        public CR2WExportWrapper(CR2WFile file, string redtype, CR2WExportWrapper parentchunk, bool cooked = false)
        {
            _export = new CR2WExport
            {
                objectFlags = (ushort)(cooked ? 8192 : 0),
            };
            AdReferences = new List <IChunkPtrAccessor>();
            AbReferences = new List <IChunkPtrAccessor>();

            this.cr2w    = file;
            this.REDType = redtype;
            ParentChunk  = parentchunk;
        }
Exemple #6
0
        public CR2WExportWrapper(CR2WFile file, CR2WExport export)
        {
            this.cr2w = file;
            _export   = export;

            parentPtr = new CPtr(file)
            {
                Name = "Parent"
            };
            ParentChunkId = export.parentID;

            flags = new CUInt16(file)
            {
                Name = "Flags",
                val  = export.objectFlags
            };

            typeName = new CName(file)
            {
                Name = "Type",
                val  = export.className
            };
        }