コード例 #1
0
ファイル: CameraCommandEntry.cs プロジェクト: Ecksters/OcaLib
        public void Save(BinaryWriter bw)
        {
            CameraCommandEntry last = null;

            if (RootCommand != null)
            {
                CameraCommand c = (CameraCommand)RootCommand;
                if (c.Entries.Count > 0)
                {
                    last = c.Entries[c.Entries.Count - 1];
                }
            }
            byte terminator = (this == last) ? (byte)0xFF : (byte)0x00;

            //0x00
            bw.Write(terminator);
            bw.Write(Rotation);
            bw.WriteBig(Frames);
            //0x04
            bw.WriteBig(AngleOfView);
            //0x08
            bw.WriteBig(Coordinates.x);
            bw.WriteBig(Coordinates.y);
            //0x0C
            bw.WriteBig(Coordinates.z);
            bw.WriteBig(d);
        }
コード例 #2
0
        private void Load(BinaryReader br)
        {
            CameraCommandEntry entry;
            short startFrame;

            UnknownA   = br.ReadBigUInt16();
            StartFrame = br.ReadBigInt16();
            EndFrame   = br.ReadBigInt16();
            zero       = br.ReadBigUInt16();

            startFrame = StartFrame;

            do
            {
                entry = new CameraCommandEntry();
                entry.Load(this, startFrame, br);
                startFrame += (short)entry.Frames;

                Entries.Add(entry);
            }while (!entry.IsLastEntry);
        }
コード例 #3
0
        public void RemoveEntry(IFrameData i)
        {
            CameraCommandEntry entry = (CameraCommandEntry)i;

            Entries.Remove(entry);
        }