public static void ExportLevelDataToXML(NitroOverlay overlay, int levelID, LevelSettings levelSettings,
                                                Dictionary <uint, LevelObject> levelObjects, List <LevelTexAnim>[] texAnims, string filename = "level.xml")
        {
            m_Overlay       = overlay;
            m_LevelID       = levelID;
            m_LevelSettings = levelSettings;
            m_LevelObjects  = levelObjects;
            m_TexAnims      = texAnims;
            m_NumAreas      = m_Overlay.Read8(0x74);
            m_FileName      = filename;
            m_Path          = Path.GetDirectoryName(m_FileName);

            ExportXML();

            System.IO.File.WriteAllBytes(m_Path + "/OVL_" + (m_LevelID + 103) + ".bin", m_Overlay.m_Data);
        }
        public static void ExportLevelDataToXML(NitroOverlay overlay, int levelID, LevelSettings levelSettings, 
            Dictionary<uint, LevelObject> levelObjects, List<LevelTexAnim>[] texAnims, string filename = "level.xml")
        {
            m_Overlay = overlay;
            m_LevelID = levelID;
            m_LevelSettings = levelSettings;
            m_LevelObjects = levelObjects;
            m_TexAnims = texAnims;
            m_NumAreas = m_Overlay.Read8(0x74);
            m_FileName = filename;
            m_Path = Path.GetDirectoryName(m_FileName);

            ExportXML();

            System.IO.File.WriteAllBytes(m_Path + "/OVL_" + (m_LevelID + 103) + ".bin", m_Overlay.m_Data);
        }
        private static void WriteCLPSToXML(XmlWriter writer)
        {
            writer.WriteStartElement("CLPS");

            uint clps_addr = m_Overlay.ReadPointer(0x60);
            uint clps_num  = m_Overlay.Read16(clps_addr + 0x06);
            uint clps_size = (uint)(8 + (clps_num * 8));

            byte[][] entries = new byte[clps_num][];
            uint     entry   = clps_addr + 0x08;

            for (int i = 0; i < clps_num; i++)
            {
                entries[i] = new byte[8];

                for (int j = 0; j < 8; j++)
                {
                    entries[i][j] = m_Overlay.Read8((uint)(entry + (j)));
                }

                entry += 8;
            }

            for (int i = 0; i < entries.Length; i++)
            {
                writer.WriteStartElement("Entry");
                writer.WriteStartElement("Value");
                for (int j = 0; j < entries[i].Length; j++)
                {
                    writer.WriteElementString("Byte", entries[i][j].ToString());
                }

                writer.WriteEndElement();
                writer.WriteEndElement();
            }

            writer.WriteEndElement();
        }