예제 #1
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);
 }
예제 #2
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 <IREDChunkPtr>();
            AbReferences = new List <IREDChunkPtr>();
        }
예제 #3
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, ICR2WExport parentchunk, bool cooked = false)
        {
            _export = new CR2WExport
            {
                objectFlags = (ushort)(cooked ? 8192 : 0),
            };
            AdReferences = new List <IREDChunkPtr>();
            AbReferences = new List <IREDChunkPtr>();

            this.cr2w    = file;
            this.REDType = redtype;
            ParentChunk  = parentchunk;
        }