Beispiel #1
0
 public Tile128()
 {
     Mapping = new Tile16[8 * 8];
     for (int i = 0; i < Mapping.Length; i++)
     {
         Mapping[i] = new Tile16();
     }
 }
            public Tile128()
            {
                Mapping = new Tile16[8][];
                for (int i = 0; i < 8; i++)
                {
                    Mapping[i] = new Tile16[8];
                }

                for (int y = 0; y < 8; y++)
                {
                    for (int x = 0; x < 8; x++)
                    {
                        Mapping[y][x] = new Tile16();
                    }
                }
            }
Beispiel #3
0
        /// <summary>
        /// Called when the tile 16 window is clicked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void pictureboxTile16_MouseDown(object sender, MouseEventArgs e)
        {
            int offset = 0;
            int yp     = e.Y;

            if (e.X < 256)
            {
                offset = 0;
            }
            else
            {
                offset = 1992;
            }

            int t16 = offset + (e.X / 32) + ((e.Y / 32) * 8);
            int t8x = (e.X / 16) & 0x01;
            int t8y = (e.Y / 16) & 0x01;
            int t8i = 0;

            //when left clicked, draw the tile 8 selected in the corrisponding quadrant of the tile 16
            if (e.Button == MouseButtons.Left)
            {
                TileInfo t = new TileInfo(tile8selected, (byte)paletteUpDown.Value, (ushort)(mirrorYCheckbox.Checked ? 1 : 0), (ushort)(mirrorXCheckbox.Checked ? 1 : 0), (ushort)(inFrontCheckbox.Checked ? 1 : 0));
                if (t8x == 0 && t8y == 0)
                {
                    allTiles[t16] = new Tile16(t, allTiles[t16].tile1, allTiles[t16].tile2, allTiles[t16].tile3);
                }
                else if (t8x == 1 && t8y == 0)
                {
                    allTiles[t16] = new Tile16(allTiles[t16].tile0, t, allTiles[t16].tile2, allTiles[t16].tile3);
                }
                else if (t8x == 0 && t8y == 1)
                {
                    allTiles[t16] = new Tile16(allTiles[t16].tile0, allTiles[t16].tile1, t, allTiles[t16].tile3);
                }
                else if (t8x == 1 && t8y == 1)
                {
                    allTiles[t16] = new Tile16(allTiles[t16].tile0, allTiles[t16].tile1, allTiles[t16].tile2, t);
                }

                BuildTiles16Gfx();
                pictureboxTile16.Refresh();
            }
            //when right clicked, get the select the tile 8 from the corrisponding quadrant of the tile 16
            else
            {
                if (t8x == 0 && t8y == 0)
                {
                    updateTileInfoFrom16(allTiles[t16].tile0);
                }
                else if (t8x == 1 && t8y == 0)
                {
                    updateTileInfoFrom16(allTiles[t16].tile1);
                }
                else if (t8x == 0 && t8y == 1)
                {
                    updateTileInfoFrom16(allTiles[t16].tile2);
                }
                else if (t8x == 1 && t8y == 1)
                {
                    updateTileInfoFrom16(allTiles[t16].tile3);
                }
            }
        }