Пример #1
0
 void ReadRelic(CRioArchive arc)
 {
     Version = arc.ReadInt32();
     if (Version >= 0x24)
     {
         field_24 = arc.ReadRioReference("CDatabaseBase"); // UnivUI
         field_28 = arc.ReadRioReference("CDatabaseBase");
         field_10 = arc.ReadRioReference("CBoxOcean");     // rvmm
         field_14 = arc.ReadRioReference("CObjectOcean");  // UnivUI
         field_18 = arc.ReadRioReference("CObjectOcean");  // UnivUI
         field_0C = arc.ReadRioReference("CProcessOcean"); // Vm60
         if (Version >= 0x25)
         {
             field_30 = arc.ReadRioReference("CStdb");  // UnivUI
         }
         if (Version >= 0x26)
         {
             field_2C = arc.ReadRioReference("CRio");  // UnivUI
         }
         if (Version >= 0x27)
         {
             field_1C = arc.ReadRioReference("CRio");
         }
         if (Version >= 0x29)
         {
             field_38 = arc.ReadRioReference("CRio");
         }
         field_34.Deserialize(arc);
         if (Version >= 0x28)
         {
             field_08 = arc.ReadRioReference("CRio");
         }
     }
     else if (Version >= 0x20)
     {
         field_0C = arc.ReadRioReference("CProcessOcean");
         field_10 = arc.ReadRioReference("CBoxOcean");
         field_14 = arc.ReadRioReference("CObjectOcean");
         field_18 = arc.ReadRioReference("CObjectOcean");
         field_1C = arc.ReadRioReference("CSoundManEx");
         if (Version >= 0x23)
         {
             field_24 = arc.ReadRioReference("CDatabaseBase");
         }
         if (Version >= 0x22)
         {
             field_28 = arc.ReadRioReference("CDatabaseBase");
         }
         if (Version >= 0x21)
         {
             field_34.Deserialize(arc);
         }
     }
     else
     {
         throw new NotSupportedException(string.Format("rUGP schema {0} not supported", Version));
     }
 }
Пример #2
0
        const int MaxRecursionDepth = 40; // arbitrary

        void DeserializeClassList(CObject root)
        {
            if (IsEncrypted && 0 != (root.Flags & 0x200))
            {
                return;
            }
            try
            {
                if (++m_depth > MaxRecursionDepth)
                {
                    throw new InvalidFormatException("[RIO] deserialization recursion limit exceeded");
                }
                int count = ReadCount();
                for (int i = 0; i < count; ++i)
                {
                    if (IsEncrypted)
                    {
                        var node = CreateOceanEntry1("unrefix");
                        DeserializeNode(node, node != null);
                        if (node != null)
                        {
                            node.Parent = root;
                        }
                    }
                    else
                    {
                        m_field_50 = ReadString();
                        m_field_54 = 0;
                        var node = CreateOceanEntry2(m_field_50);
                        if (node != null)
                        {
                            MapObjectEntry(node);
                            DeserializeNode(node);
                            node.Parent = root;
                        }
                        else
                        {
                            node = FindObject(m_field_50) as COceanNode;
                            MapObjectEntry(node);
                            DeserializeNode(node, false);
                        }
                    }
                }
            }
            finally
            {
                --m_depth;
            }
        }
Пример #3
0
        COceanNode ReadEncryptedObject(CObject rio, string class_ref, int flags, int id1, int id2)
        {
            COceanNode node;

            if (!m_OceanMap.TryGetValue(id1, out node))
            {
                throw new InvalidFormatException();
            }
            if (node != null)
            {
                node.Offset = DecodeOffset(id1);
                node.Size   = DecodeSize(id2);
            }
            return(node);
        }
Пример #4
0
        public override void Deserialize(CRioArchive arc)
        {
            Version      = arc.ReadInt32();
            m_width      = arc.ReadUInt16();
            m_height     = arc.ReadUInt16();
            m_x          = arc.ReadUInt16();
            m_y          = arc.ReadUInt16();
            m_w          = arc.ReadUInt16();
            m_h          = arc.ReadUInt16();
            m_flags      = arc.ReadInt32();
            CompressInfo = arc.ReadBytes(7);
            if (arc.GetObjectSchema() >= 2)
            {
                field_4C = arc.ReadRioReference("CSbm");
            }
            int size = arc.ReadInt32();

            arc.ReadInt32(); // field_3C
            var data = arc.ReadBytes(size);

            m_pixels = Uncompress(data);
            Format   = HasAlpha ? PixelFormats.Bgra32 : PixelFormats.Bgr32;
        }
Пример #5
0
 void MapObjectEntry(CObject node)  // CArchive::MapObject
 {
     m_LoadArray.Add(node);
 }
Пример #6
0
 public override void Deserialize(CRioArchive arc)
 {
     field_10 = arc.ReadRioReference("CFrameBuffer");
 }