Esempio n. 1
0
        public Level(int levelID, NitroOverlay overlay)
        {
            m_LevelID = levelID;
            m_Overlay = overlay;

            m_LevelSettings = new LevelSettings(m_Overlay);
            if (m_LevelSettings.LevelFormatVersion > k_LevelFormatVersion)
            {
                throw new InvalidDataException("This level was added by a later version of SM64DSe and cannot be read");
            }

            LoadCLPS(m_Overlay);

            // read object lists

            m_NumAreas = m_Overlay.Read8(0x74);
            uint objlistptr = m_Overlay.ReadPointer(0x70);

            m_LevelObjects = new Dictionary <uint, LevelObject>();
            m_TexAnims     = new List <LevelTexAnim>(8);
            for (int i = 0; i < 8; ++i)
            {
                m_TexAnims.Add(new LevelTexAnim(m_Overlay, i, m_NumAreas, m_LevelSettings.LevelFormatVersion));
            }

            m_DynLibIDs = new List <ushort>();
            if (DoesLevelUseDynamicLibs())
            {
                uint dlDataOffset = m_Overlay.Read32(0x30);
                uint numDLs       = m_Overlay.Read16(dlDataOffset);
                m_DynLibIDs = new List <ushort>((int)numDLs);
                for (uint i = 0; i < numDLs; ++i)
                {
                    m_DynLibIDs.Add(m_Overlay.Read16(dlDataOffset + 2 * i + 2));
                }
            }

            ReadObjectTable(m_Overlay, m_Overlay.ReadPointer(0x64), 0);
            m_MinimapIndices = new byte[k_MaxNumAreas];
            for (byte a = 0; a < m_NumAreas; a++)
            {
                // read object tables
                uint addr = (uint)(objlistptr + (a * 12));
                if (m_Overlay.Read32(addr) != 0)
                {
                    ReadObjectTable(m_Overlay, m_Overlay.ReadPointer(addr), a);
                }

                // texture animations, have already been read
                addr += 4;

                addr += 4;
                m_MinimapIndices[a] = m_Overlay.Read8(addr);
            }

            m_ObjAvailable = new Dictionary <ushort, bool>();
            DetermineAvailableObjects();
        }
Esempio n. 2
0
 public LevelSettingsForm(Level level)
 {
     InitializeComponent();
     m_Level         = level;
     m_LevelSettings = level.m_LevelSettings;
 }
Esempio n. 3
0
 private void ModelImporter_Load(object sender, EventArgs e)
 {
     m_LevelSettings = ((LevelEditorForm)Owner).m_LevelSettings;
 }
Esempio n. 4
0
 public LevelSettingsForm(LevelSettings settings)
 {
     InitializeComponent();
     m_LevelSettings = settings;
 }
Esempio n. 5
0
 public LevelSettingsForm(LevelSettings settings)
 {
     InitializeComponent();
     m_LevelSettings = settings;
 }