public CourseTableEntry(string courseName, int index, CourseBlock p1, CourseBlock p2, ObjectCourseBlock p3, CourseBlock p4, CourseBlock p5, CourseBlock p6, SurfaceCourseBlock p7) { CourseName = courseName; Index = index; HeightData1 = p1; HeightData2 = p2; ObjectList = p3; Pointer4 = p4; Pointer5 = p5; Pointer6 = p6; SurfaceMap = p7; HeightMapData = _HeightDataEncoding.DecodeHeightMap(p1.GetAsBytes(), p2.GetAsBytes()); }
private void SerializeData(MG64RomFile file, CourseBlock block) { byte[] blockData = block.GetAsBytes(); if (blockData.Length != block.BlockLength) //size has changed { if (blockData.Length < block.BlockLength) //shrunk in size { block.Update(block.RomOffset, blockData.Length); } else //grown in size, needs to be appended to the rom { block.Update(file.NewDataOffset, blockData.Length); file.AdvanceNewData(block.BlockLength); } } Array.Copy(blockData, 0, file.RomData, block.RomOffset + MG64RomFile.COURSE_TABLE_OFFSET, block.BlockLength); }