Beispiel #1
0
        protected virtual void RebuildPalette()
        {
            int numberOfPalettes = PaletteData.Length / 2;

            Palette = new Color[numberOfPalettes];

            for (int i = 0; i < numberOfPalettes; i++)
            {
                Palette[i] = SpriteUtilities.GetColorFromBytes(PaletteData[i * 2], PaletteData[i * 2 + 1]);
            }
        }
Beispiel #2
0
        void UpdatePaletteFromRaw()
        {
            int startIndex = 0;
            int length     = rawPalette.Length == 30 ? 16 : rawPalette.Length / 2;

            this.palette = new Color[length];

            if (rawPalette.Length == 30)
            {
                this.palette[0] = Color.FromArgb(0, 0, 0);
                startIndex      = 1;
            }

            for (int i = startIndex; i < this.palette.Length; i++)
            {
                this.palette[i] = SpriteUtilities.GetColorFromBytes(this.rawPalette[(i - startIndex) * 2], this.rawPalette[(i - startIndex) * 2 + 1]);
            }
        }