Ejemplo n.º 1
0
        static Model convertAndInsertModel(GeoSet tgt, Model32 v)
        {
            Model z = new Model();

            z.flags             = (ModelFlags)v.flg1;
            z.visibility_radius = v.radius;
            z.num_textures      = v.num_textures;
            z.m_id            = v.id;
            z.boneinfo_offset = v.boneinfo;

            z.BlendMode       = (CoHBlendMode)v.blend_mode;
            z.vertex_count    = v.vertex_count;
            z.model_tri_count = v.model_tri_count;
            z.scale           = v.m_scale;
            z.box.SetMinMax(v.m_min, v.m_max);
            for (byte i = 0; i < 7; ++i)
            {
                DeltaPack dp_blk = z.packed_data.get(i);
                PackInfo  pi     = v.pack_data[i];
                dp_blk.compressed_size = pi.compressed_size;
                dp_blk.uncomp_size     = pi.uncomp_size;
                dp_blk.compressed_data = null;
                dp_blk.buffer_offset   = pi.compressed_data_off;
            }

            tgt.subs.Add(z);
            return(z);
        }
Ejemplo n.º 2
0
        private void fixupDataPtr(DeltaPack a, byte[] b)
        {
            if (a.uncomp_size != 0)
            {
                MemoryStream ms = new MemoryStream(b, a.buffer_offset, a.compressed_size == 0 ? a.uncomp_size : a.compressed_size);

                a.compressed_data = ms;
            }
        }