コード例 #1
0
ファイル: LoadSave.cs プロジェクト: DJuttmann/SM3E
        public void Close()
        {
            if (!ProjectLoaded)
            {
                return;
            }

            Rooms.Clear();
            DoorSets.Clear();
            Doors.Clear();
            ScrollSets.Clear();
            PlmSets.Clear();
            ScrollPlmDatas.Clear();
            Backgrounds.Clear();
            Fxs.Clear();
            SaveStations.Clear();
            LevelDatas.Clear();
            EnemySets.Clear();
            EnemyGfxs.Clear();
            ScrollAsms.Clear();
            DoorAsms.Clear();
            SetupAsms.Clear();
            MainAsms.Clear();
            TileSets.Clear();
            TileTables.Clear();
            TileSheets.Clear();
            Palettes.Clear();
            AreaMaps.Clear();
            PlmTypes.Clear();
            EnemyTypes.Clear();

            CurrentRom      = null;
            ProjectPath     = String.Empty;
            RomFileName     = String.Empty;
            ProjectFileName = String.Empty;

            RoomTiles.Clear();
            MapTiles.Clear();
            BackgroundImage = null;

            ChangesMade   = false;
            ProjectLoaded = false;
            ProjectClosed?.Invoke(this, null);
        }
コード例 #2
0
ファイル: LoadSave.cs プロジェクト: DJuttmann/SM3E
        // Read all tile sheets from ROM.
        private void ReadTileSheets(Rom rom)
        {
            List <int> addressesPC = new List <int> ();

            foreach (TileSet t in TileSets)
            {
                int address = Tools.LRtoPC(t.SceSheetPtr);
                if (address != 0) // Skip invalid addresses
                {
                    addressesPC.Add(address);
                }
            }
            Tools.RemoveDuplicates(addressesPC);
            TileSheets.Clear();
            TileSheets.Add(new CompressedTileSheet());
            TileSheets [0].ReadFromROM(rom, TileSheet.CreAddressPC);
            for (int n = 0; n < addressesPC.Count; n++)
            {
                TileSheets.Add(new CompressedTileSheet());
                TileSheets [n + 1].ReadFromROM(rom, addressesPC [n]);
            }
        }