Пример #1
0
        /// <summary>
        /// Returns an array containing the pixels of all tiles.
        /// </summary>
        /// <returns></returns>
        public Bgr555[] GetPixels()
        {
            var pixels = new Bgr555[Tileset.Length * 64];

            for (int i = 0; i < Tileset.Length; i++)
            {
                var tile = Tileset[i];
                for (int j = 0; j < 64; j++)
                {
                    pixels[i * 64 + j] = Palette[tile[j]];
                }
            }

            return(pixels);
        }
Пример #2
0
 /// <summary>
 /// Converts this <see cref="Color"/> instance to the equivalent <see cref="Bgr555"/> instance.
 /// </summary>
 /// <param name="color"></param>
 /// <returns></returns>
 public static Bgr555 ToBgr555(this Color color)
 {
     return(Bgr555.FromRgb(color.R, color.G, color.B));
 }
Пример #3
0
 /// <summary>
 /// Converts this <see cref="Bgr555"/> instance to the equivalent <see cref="Color"/> instance.
 /// </summary>
 /// <param name="color"></param>
 /// <returns></returns>
 public static Color ToColor(this Bgr555 color)
 {
     return(Color.FromArgb(color.R << 3, color.G << 3, color.B << 3));
 }