public static void InputAniDate(AniInfo aniInfo, List<AniFrame> arrFrames)
		{
			AniData aniData = new AniData();
			aniData.aniInfo = aniInfo;
			aniData.arrFrames = arrFrames;
			arrDatas.Add(aniData);
			curId++;
		}
Exemplo n.º 2
0
        public static void InputAniDate(AniInfo aniInfo, List <AniFrame> arrFrames)
        {
            AniData aniData = new AniData();

            aniData.aniInfo   = aniInfo;
            aniData.arrFrames = arrFrames;
            arrDatas.Add(aniData);
            curId++;
        }
Exemplo n.º 3
0
        public static void EndInputAndSave()
        {
            FileStream fs          = new FileStream(filename, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None);
            long       startOffset = 0;

            fs.Write(BitConverter.GetBytes(curId), 0, 4);
            startOffset += 4 + arrDatas.Count * Marshal.SizeOf(arrDatas[0].aniInfo);
            for (int i = 0; i < arrDatas.Count; i++)
            {
                AniData data = arrDatas[i];
                data.aniInfo.offset = startOffset;
                startOffset        += data.arrFrames.Count * Marshal.SizeOf(data.arrFrames[0]);
                byte[] bys = Common.StructToBytes(data.aniInfo);
                for (int j = 0; j < bys.Length; j++)
                {
                    fs.WriteByte(bys[j]);
                }
            }

            for (int i = 0; i < arrDatas.Count; i++)
            {
                AniData data = arrDatas[i];

                for (int j = 0; j < data.arrFrames.Count; j++)
                {
                    AniFrame frame = data.arrFrames[j];
                    byte[]   bys   = Common.StructToBytes(frame);
                    for (int k = 0; k < bys.Length; k++)
                    {
                        fs.WriteByte(bys[k]);
                    }
                }
            }


            fs.Close();
        }