EanAnimation.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.IO;
  3. namespace Xft
  4. {
  5. public class EanAnimation
  6. {
  7. public void Load(BinaryReader br, FileStream fs)
  8. {
  9. this.Offset = br.ReadInt32();
  10. this.Offset += 16;
  11. this.FrameCount = br.ReadInt32();
  12. this.MipWidth = br.ReadInt32();
  13. this.MipHeight = br.ReadInt32();
  14. this.StartX = br.ReadInt32();
  15. this.StartY = br.ReadInt32();
  16. this.TileCount = br.ReadUInt16();
  17. this.TotalCount = br.ReadUInt16();
  18. this.CellWidth = br.ReadUInt16();
  19. this.CellHeight = br.ReadUInt16();
  20. this.Frames = new EanFrame[(int)this.TotalCount];
  21. long position = fs.Position;
  22. fs.Seek((long)this.Offset, SeekOrigin.Begin);
  23. for (int i = 0; i < (int)this.TotalCount; i++)
  24. {
  25. this.Frames[i].X = br.ReadUInt16();
  26. this.Frames[i].Y = br.ReadUInt16();
  27. this.Frames[i].Width = br.ReadUInt16();
  28. this.Frames[i].Height = br.ReadUInt16();
  29. }
  30. fs.Seek(position, SeekOrigin.Begin);
  31. }
  32. public int Offset;
  33. public int FrameCount;
  34. public int MipWidth;
  35. public int MipHeight;
  36. public int StartX;
  37. public int StartY;
  38. public ushort TileCount;
  39. public ushort TotalCount;
  40. public ushort CellWidth;
  41. public ushort CellHeight;
  42. public EanFrame[] Frames;
  43. }
  44. }