void Core_LoadPaletteAndSmallTileset()
 {
     try
     {
         MapTileFrame frame   = CurrentTileAnim.Frames[TileAnim_Frame_ByteBox.Value];
         byte[]       tileset = Core.ReadData(Tileset1_PointerBox.Value, 0);
         byte[]       palette = Core.ReadData(Palette_PointerBox.Value, Map.PALETTES * Palette.LENGTH);
         if (ViewAnimation_CheckBox.Checked)
         {
             byte[] change;
             if (frame.IsPaletteAnimation())
             {
                 change = TileAnim_PaletteBox.Colors.ToBytes(false);
                 Array.Copy(change, 0, palette, TileAnim_Offset_ByteBox.Value * 2, change.Length);
             }
             else
             {
                 change = Core.ReadData(frame.FrameData, frame.Length * 8 * Tile.LENGTH);
                 Array.Copy(change, 0, tileset, 32 * 8 * Tile.LENGTH, change.Length);
             }
         }
         Tileset_PaletteBox.Load(new GBA.Palette(palette, Map.PALETTES * Palette.MAX));
         Tileset_ImageBox.Load(new Tileset(tileset).ToImage(32, 32,
                                                            palette.GetBytes((uint)(ViewPalette_ByteBox.Value * Palette.LENGTH), Palette.LENGTH)));
     }
     catch (Exception ex)
     {
         Program.ShowError("Could not load the palette.", ex);
         CurrentTileAnim = null;
     }
 }
示例#2
0
        public void Core_UpdateDisplay(IDisplayable display)
        {
            OAM_ImageBox.Load(display);

            Tileset_ImageBox.Load(Tiles.ToImage(32, 8, Colors.ToBytes(false)));
        }