Пример #1
0
        public void PrepForSaving(MG64RomFile file)
        {
            //Convert height map data back to encoded formats
            byte[] heightMap1, heightMap2;

            HeightDataEncoding.EncodeHeightMap(HeightMapData, out heightMap1, out heightMap2);

            if (heightMap1.Length <= HeightData1.BlockLength)
            {
                HeightData1 = new BasicCourseBlock(heightMap1, HeightData1.RomOffset, heightMap1.Length);
            }
            else
            {
                HeightData1 = new BasicCourseBlock(heightMap1, file.NewDataOffset, heightMap1.Length);
                file.AdvanceNewData(heightMap1.Length);
            }

            if (heightMap2.Length <= HeightData2.BlockLength)
            {
                HeightData2 = new BasicCourseBlock(heightMap2, HeightData2.RomOffset, heightMap2.Length);
            }
            else
            {
                HeightData2 = new BasicCourseBlock(heightMap2, file.NewDataOffset, heightMap2.Length);
                file.AdvanceNewData(heightMap2.Length);
            }
        }
Пример #2
0
        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());
        }