public override byte[] GetAsBytes() { byte[] decompressedData = new byte[0x100 * 0x200]; for (int j = 0; j < 0x200; j++) { for (int i = 0; i < 0x100; i++) { decompressedData[(0xFF - i) + j * 0x100] = (byte)SurfaceMap[i, j]; } } //compress the data return(MarioGolf64Compression.CompressGolfHalfword(decompressedData)); }
public SurfaceCourseBlock(byte[] data, int offset, int length) : base(data, offset, length) { //Need to decompress the data byte[] decompressedData = MarioGolf64Compression.DecompressGolfHalfword(data, 0, 0); SurfaceMap = new SurfaceType[0x100, 0x200]; for (int j = 0; j < 0x200; j++) { for (int i = 0; i < 0x100; i++) { SurfaceMap[i, j] = (SurfaceType)decompressedData[(0xFF - i) + j * 0x100]; } } }