Ejemplo n.º 1
0
        public void SetPixel(int x, int y, int colorIndex)
        {
            if (Multicolor)
            {
                int paletteIndex;
                switch (colorIndex)
                {
                case 1:
                    paletteIndex         = ForegroundColorIndex;
                    SpriteData[x, y]     = false;
                    SpriteData[x + 1, y] = true;
                    break;

                case 2:
                    paletteIndex         = ExtraColor1Index;
                    SpriteData[x, y]     = true;
                    SpriteData[x + 1, y] = false;
                    break;

                case 3:
                    paletteIndex         = ExtraColor2Index;
                    SpriteData[x, y]     = true;
                    SpriteData[x + 1, y] = true;
                    break;

                default:
                    paletteIndex         = BackgroundColorIndex;
                    SpriteData[x, y]     = false;
                    SpriteData[x + 1, y] = false;
                    break;
                }
                SpritePreviewData.SetPixel(x, y, Palette.GetColor(paletteIndex));
                SpritePreviewData.SetPixel(x + 1, y, Palette.GetColor(paletteIndex));
            }
            else
            {
                SpriteData[x, y] = colorIndex > 0;
                SpritePreviewData.SetPixel(x, y, Palette.GetColor(colorIndex == 0 ? BackgroundColorIndex : ForegroundColorIndex));
            }
        }
Ejemplo n.º 2
0
 public Brush GetBrush(C64Color color) =>
 _brushes[(int)color] ?? (_brushes[(int)color] = new SolidBrush(_palette.GetColor(color)));