Exemple #1
0
        public GCAttach()
        {
            Name = "gcattach_" + Extensions.GenerateIdentifier();

            VertexData   = new VertexData();
            GeometryData = new GeometryData();
            Bounds       = new BoundingSphere();
        }
Exemple #2
0
        public GCAttach(byte[] file, int address, uint imageBase, Dictionary <int, string> labels)
        {
            if (labels.ContainsKey(address))
            {
                Name = labels[address];
            }
            else
            {
                Name = "attach_" + address.ToString("X8");
            }

            // The struct is 36/0x24 bytes long.

            VertexData   = new VertexData();
            GeometryData = new GeometryData();

            uint vertex_attribute_offset = ByteConverter.ToUInt32(file, address) - imageBase;
            int  unknown_1 = ByteConverter.ToInt32(file, address + 4);
            int  opaque_geometry_data_offset      = (int)(ByteConverter.ToInt32(file, address + 8) - imageBase);
            int  translucent_geometry_data_offset = (int)(ByteConverter.ToInt32(file, address + 12) - imageBase);

            int opaque_geometry_count      = ByteConverter.ToInt16(file, address + 16);
            int translucent_geometry_count = ByteConverter.ToInt16(file, address + 18);


            Bounds = new BoundingSphere(file, address + 20);
            VertexData.Load(file, vertex_attribute_offset, imageBase);

            if (opaque_geometry_count > 0)
            {
                GeometryData.Load(file, opaque_geometry_data_offset, imageBase, opaque_geometry_count, GeometryType.Opaque);
            }

            if (translucent_geometry_count > 0)
            {
                GeometryData.Load(file, translucent_geometry_data_offset, imageBase, translucent_geometry_count, GeometryType.Translucent);
            }
        }