void Core_LoadTileset()
        {
            try
            {
                CurrentTileset = new MapTileset(
                    Core.ReadData(Palette_PointerBox.Value, Map.PALETTES * Palette.LENGTH),
                    Core.ReadData(Tileset1_PointerBox.Value, 0),
                    Core.ReadData(Tileset2_PointerBox.Value, 0),
                    Core.ReadData(TilesetTSA_PointerBox.Value, 0));

                Tileset_GridBox.SelectionChanged -= Tileset_GridBox_SelectionChanged;
                Tileset_GridBox.Load(CurrentTileset);
                Tileset_GridBox.SelectionChanged += Tileset_GridBox_SelectionChanged;
            }
            catch (Exception ex)
            {
                Program.ShowError("Could not load the map tileset.", ex);
            }
        }
Example #2
0
        void Core_LoadTileset()
        {
            try
            {
                byte[] palette_data = Core.ReadData(Palette_PointerBox.Value, Map.PALETTES * GBA.Palette.LENGTH);

                CurrentTileset = new MapTileset(palette_data,
                                                Core.ReadData(Tileset1_PointerBox.Value, 0),
                                                Core.ReadData(Tileset2_PointerBox.Value, 0),
                                                Core.ReadData(TilesetTSA_PointerBox.Value, 0));

                Tileset_GridBox.Load(CurrentTileset);
                Palette_PaletteBox.Load(new GBA.Palette(palette_data, Map.PALETTES * GBA.Palette.MAX));
            }
            catch (Exception ex)
            {
                CurrentTileset = null;
                Program.ShowError("Could not load the the tileset for this chapter.", ex);
            }
        }