Exemplo n.º 1
0
 public void UpdateTileset()
 {
     Tilemap.ParseTilemap();
     Tilemap = new Mode7Tilemap(Model.M7TilemapA, Tileset, Model.M7PaletteSet);
     LoadMinecart();
 }
Exemplo n.º 2
0
        public void LoadMinecart()
        {
            // if mode7 map
            if (Index < 2)
            {
                labelStartXY.Visible = true;
                startX.Visible       = true;
                startY.Visible       = true;
                startX.Value         = Bits.GetShort(Model.ROM, 0x039670);
                startY.Value         = Bits.GetShort(Model.ROM, 0x039679);

                // Create map elements
                PaletteSet = Model.M7PaletteSet;
                Tileset    = new Tileset(Model.M7PaletteSet, TilesetType.Mode7);
                if (Index == 0)
                {
                    Tilemap = new Mode7Tilemap(Model.M7TilemapA, Tileset, PaletteSet);
                }
                else
                {
                    Tilemap = new Mode7Tilemap(Model.M7TilemapB, Tileset, PaletteSet);
                }

                // Load the screens
                toggleScreens.Enabled = false;
                ScreensForm.Hide();
                ObjectsForm.Hide();
            }
            // if side-scrolling map
            else
            {
                labelStartXY.Visible = false;
                startX.Visible       = false;
                startY.Visible       = false;

                // Create map elements
                PaletteSet            = Model.SSPaletteSet;
                Tileset               = new Tileset(Model.SSTileset, Model.SSGraphics, PaletteSet, 16, 16, TilesetType.SideScrolling);
                Tilemap               = new SideTilemap(Model.SSTilemap, null, Tileset, PaletteSet);
                toggleScreens.Enabled = true;
                ScreensForm.LoadScreens();

                // ObjectsForm
                toggleScreens.Enabled = true;
                ScreensForm.Show(dockPanel, DockState.DockTop);
                ObjectsForm.Left = this.Right + 10;
                ObjectsForm.Top  = this.Top;
                ObjectsForm.Show(ScreensForm.Pane, DockAlignment.Right, 0.25);
                ObjectsForm.InitializeObjects();
            }

            // (Re)load editors and forms
            ReloadPaletteEditor();
            ReloadGraphicEditor();
            ReloadSpritePaletteEditor();
            ReloadSpriteGraphicEditor();
            LoadTilesetEditor();
            LoadTilemapEditor();

            // Rails properties
            TilesetForm.Rails = state.Rails && Index < 2;
        }