Пример #1
0
 public void GenerateChunk(ref byte[] chunkData)
 {
     filesize           = Read.DWORD(ref chunkData);
     magic_number       = Read.WORD(ref chunkData);
     frames             = Read.WORD(ref chunkData);
     width_in_pixels    = Read.WORD(ref chunkData);
     height_in_pixels   = Read.WORD(ref chunkData);
     color_depth        = Read.WORD(ref chunkData);
     flags              = Read.DWORD(ref chunkData);
     speed              = Read.WORD(ref chunkData);
     _empty1            = Read.DWORD(ref chunkData);
     _empty2            = Read.DWORD(ref chunkData);
     palette_index      = Read.BYTE(ref chunkData);
     ignore_these_bytes = Read.BYTEARRAY(ref chunkData, 3);
     number_of_colors   = Read.WORD(ref chunkData);
     pixel_width        = Read.BYTE(ref chunkData);
     pixel_height       = Read.BYTE(ref chunkData);
     x_position_on_grid = Read.SHORT(ref chunkData);
     y_position_on_grid = Read.SHORT(ref chunkData);
     grid_width         = Read.WORD(ref chunkData);
     grid_height        = Read.WORD(ref chunkData);
     for_future         = Read.BYTEARRAY(ref chunkData, 84);
     headerHex          = magic_number.ToString("x");
     pixels             = new Color32[width_in_pixels * height_in_pixels];
 }
Пример #2
0
        public void GenerateChunk(ref byte[] chunkData)
        {
            new_palette_size = Read.DWORD(ref chunkData);
            start            = Read.DWORD(ref chunkData);
            end        = Read.DWORD(ref chunkData);
            for_future = Read.BYTEARRAY(ref chunkData, 8);

            palette_entries = new List <PaletteEntry>();
            for (int i = 0; i < end - start + 1; i++)
            {
                PaletteEntry paletteEntry = new PaletteEntry()
                {
                    entry_flags = Read.WORD(ref chunkData),
                    r           = Read.BYTE(ref chunkData),
                    g           = Read.BYTE(ref chunkData),
                    b           = Read.BYTE(ref chunkData),
                    a           = Read.BYTE(ref chunkData)
                };
                if (paletteEntry.entry_flags == 1)
                {
                    paletteEntry.name = Read.STRING(ref chunkData);
                }
                palette_entries.Add(paletteEntry);
            }
        }
Пример #3
0
 private void BuildChunkVariables(ref byte[] chunkData)
 {
     layer_index = Read.WORD(ref chunkData);
     x_position  = Read.SHORT(ref chunkData);
     y_position  = Read.SHORT(ref chunkData);
     opacity     = Read.BYTE(ref chunkData);
     cel_type    = Read.WORD(ref chunkData);
     for_future  = Read.BYTEARRAY(ref chunkData, 7);
 }
Пример #4
0
 public void GenerateChunk(ref byte[] chunkData)
 {
     flags                          = Read.WORD(ref chunkData);
     layer_type                     = Read.WORD(ref chunkData);
     layer_child_level              = Read.WORD(ref chunkData);
     default_layer_width_in_pixels  = Read.WORD(ref chunkData);
     default_layer_height_in_pixels = Read.WORD(ref chunkData);
     blend_mode                     = Read.WORD(ref chunkData);
     opacity                        = Read.BYTE(ref chunkData);
     for_future                     = Read.BYTEARRAY(ref chunkData, 3);
     layer_name                     = Read.STRING(ref chunkData);
 }
Пример #5
0
 public void GenerateChunk(ref byte[] chunkData)
 {
     number_of_packets         = Read.WORD(ref chunkData);
     old_palette_chunk_packets = new List <OldPaletteChunkPacket>();
     for (int i = 0; i < number_of_packets; i++)
     {
         OldPaletteChunkPacket oldPaletteChunkPacket = new OldPaletteChunkPacket()
         {
             number_of_palette_entries = Read.BYTE(ref chunkData),
             number_of_colors          = Read.BYTE(ref chunkData),
             colors = new List <Color32>()
         };
         Color32 color = new Color32(Read.BYTE(ref chunkData), Read.BYTE(ref chunkData), Read.BYTE(ref chunkData), 1);
         oldPaletteChunkPacket.colors.Add(color);
     }
 }
Пример #6
0
 public void GenerateChunk(ref byte[] chunkData)
 {
     number_of_tags = Read.WORD(ref chunkData);
     for_future     = Read.BYTEARRAY(ref chunkData, 8);
     tags           = new List <Tag>();
     for (int i = 0; i < number_of_tags; i++)
     {
         Tag tag = new Tag()
         {
             from_frame = Read.WORD(ref chunkData),
             to_frame   = Read.WORD(ref chunkData),
             loop_animation_direction = Read.BYTE(ref chunkData),
             for_future    = Read.BYTEARRAY(ref chunkData, 8),
             RBG_tag_color = Read.BYTEARRAY(ref chunkData, 3),
             extra_byte    = Read.BYTE(ref chunkData),
             tag_name      = Read.STRING(ref chunkData)
         };
         tags.Add(tag);
     }
 }