示例#1
0
        // temp stuff
        public static Dictionary <string, SkelAnimation> LoadAJ(string fname, VBN vbn)
        {
            // a note, I know that the main player file has the offsets for
            // animations, this is just for viewing
            FileData f = new FileData(fname);

            f.endian = System.IO.Endianness.Big;

            int pos = 0;

            Dictionary <string, SkelAnimation> animations = new Dictionary <string, SkelAnimation>();
            AnimationGroupNode group = new AnimationGroupNode()
            {
                Text = fname
            };

            MainForm.Instance.animList.treeView1.Nodes.Add(group);
            while (pos < f.Size())
            {
                Console.WriteLine(pos.ToString("x"));
                int           len  = f.ReadInt();
                DAT_Animation anim = new DAT_Animation();
                anim.Read(new FileData(f.GetSection(pos, len)));
                AnimTrack track = new AnimTrack(anim);

                if (pos == 0)
                {
                    //track.Show();
                }
                group.Nodes.Add(track.ToAnimation(vbn));
                SkelAnimation sa = track.BakeToSkel(vbn);
                //sa.Tag = track;
                //Runtime.Animations.Add(anim.Name, sa);
                // MainForm.Instance.animList.treeView1.Nodes.Add(anim.Name);
                animations.Add(anim.Name, sa);

                if (pos != 0)
                {
                    track.Dispose();
                    track.Close();
                }

                f.Skip(len - 4);
                f.Align(32);
                pos = f.Pos();
            }

            return(animations);
        }