Beispiel #1
0
        public void GenerateChunk(ref byte[] chunkData)
        {
            number_of_slice_keys = Read.DWORD(ref chunkData);
            flags      = Read.DWORD(ref chunkData);
            reserved   = Read.DWORD(ref chunkData);
            name       = Read.STRING(ref chunkData);
            slice_keys = new List <SliceKey>();
            for (int i = 0; i < number_of_slice_keys; i++)
            {
                SliceKey sliceKey = new SliceKey()
                {
                    frame_number   = Read.DWORD(ref chunkData),
                    slice_x_origin = Read.LONG(ref chunkData),
                    slice_y_origin = Read.LONG(ref chunkData),
                    slice_width    = Read.DWORD(ref chunkData),
                    slice_height   = Read.DWORD(ref chunkData)
                };
                if (flags == 1)
                {
                    sliceKey.center_x_position = Read.LONG(ref chunkData);
                    sliceKey.center_y_position = Read.LONG(ref chunkData);
                    sliceKey.center_width      = Read.DWORD(ref chunkData);
                    sliceKey.center_height     = Read.DWORD(ref chunkData);
                }
                else if (flags == 2)
                {
                    sliceKey.pivot_x_position = Read.LONG(ref chunkData);
                    sliceKey.pivot_y_position = Read.LONG(ref chunkData);
                }

                slice_keys.Add(sliceKey);
            }
        }
Beispiel #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);
            }
        }
Beispiel #3
0
 public void GenerateChunk(ref byte[] chunkData)
 {
     x_position   = Read.SHORT(ref chunkData);
     y_position   = Read.SHORT(ref chunkData);
     width        = Read.WORD(ref chunkData);
     height       = Read.WORD(ref chunkData);
     for_future   = Read.BYTEARRAY(ref chunkData, 8);
     mask_name    = Read.STRING(ref chunkData);
     bit_map_data = Read.BYTEARRAY(ref chunkData, height * ((width + 7) / 8));
 }
Beispiel #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);
 }
Beispiel #5
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);
     }
 }