예제 #1
0
        private static BodyPart ReadBodyPart(BinaryReader br, int offset)
        {
            // Read bodypart struct
            br.BaseStream.Seek(offset, SeekOrigin.Begin);
            MDLBodyPart mdlbp = new MDLBodyPart();
            mdlbp.mdl_name_index = br.ReadInt32();
            mdlbp.num_models = br.ReadInt32();
            mdlbp.body_part_base = br.ReadInt32();
            mdlbp.model_offset = br.ReadInt32();

            BodyPart bodypart = new BodyPart(mdlbp);
            // Process bodyparts the models
            if (mdlbp.num_models > 1)
            {
                int test = 2;
            }
            for (int i = 0; i < mdlbp.num_models; i++)
            {
                Model model = ReadModel(br, offset + mdlbp.model_offset + (i * 120)); // 120 bytes for MDLModel
                bodypart.Models.Add(model);
            }

            return bodypart;
        }
예제 #2
0
 public BodyPart(MDLBodyPart mdlBodyPart)
 {
     this.MDLBodyPart = mdlBodyPart;
     Models = new List<Model>();
 }