Exemplo n.º 1
0
 // drawing
 public int[] MoldPixels(E_Animation animation, E_Tileset tileset)
 {
     int[] pixels = new int[(animation.Width * 16) * (animation.Height * 16)];
     for (int y = 0; y < animation.Height; y++)
     {
         for (int x = 0; x < animation.Width; x++)
         {
             if (y * animation.Width + x >= mold.Length)
             {
                 continue;
             }
             if (mold[y * animation.Width + x] == 0xFF)
             {
                 continue;
             }
             int[] tile = new int[16 * 16];
             ((Tile)tileset.Tileset[mold[y * animation.Width + x] & 0x3F]).Pixels.CopyTo(tile, 0);
             if ((mold[y * animation.Width + x] & 0x40) == 0x40)
             {
                 Do.FlipHorizontal(tile, 16, 16);
             }
             if ((mold[y * animation.Width + x] & 0x80) == 0x80)
             {
                 Do.FlipVertical(tile, 16, 16);
             }
             Do.PixelsToPixels(tile, pixels, animation.Width * 16, new Rectangle(x * 16, y * 16, 16, 16));
         }
     }
     return(pixels);
 }
Exemplo n.º 2
0
 private void reset_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("You're about to undo all changes to the current effect and animation index. Go ahead with reset?",
                         "LAZY SHELL", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
     {
         return;
     }
     animation = new E_Animation(effect.AnimationPacket);
     effect    = new Effect(index);
     number_ValueChanged(null, null);
 }
Exemplo n.º 3
0
 // constructor
 public E_Tileset(E_Animation animation, int index)
 {
     this.animation = animation;
     this.graphics  = animation.GraphicSet;
     this.palette   = animation.PaletteSet.Palettes[index];
     tileset        = new Tile[16 * 16];
     for (int i = 0; i < tileset.Length; i++)
     {
         tileset[i] = new Tile(i);
     }
     DrawTileset(tileset, animation.Tileset_bytes);
 }
Exemplo n.º 4
0
 // class functions
 public void RedrawTileset(E_Animation animation, int length)
 {
     this.graphics = animation.GraphicSet;
     for (int i = 0; i < length / 8; i++)
     {
         for (int z = 0; z < 4; z++)
         {
             Subtile source;
             if (animation.Codec == 1)
             {
                 source = Do.DrawSubtile((byte)tileset[i].Subtiles[z].Index, 0, graphics, palette, 0x10);
             }
             else
             {
                 source = Do.DrawSubtile((byte)tileset[i].Subtiles[z].Index, 0, graphics, palette, 0x20);
             }
             tileset[i].Subtiles[z] = source;
         }
     }
 }