Beispiel #1
0
        public byte[] GetRGBAArray()
        {
            if (m_RGBAArray == null)
            {
                m_RGBAArray = new byte[m_IndicesArray.Length * 4];

                for (int i = 0; i < m_IndicesArray.Length; i++)
                {
                    PaletteColor rgba = Palette.aoe2_palette[m_IndicesArray[i]];
                    if (m_IndicesArray[i] == 255)
                    {
                        rgba = new PaletteColor(0, 0, 0, 0);
                    }

                    m_RGBAArray[i * 4 + 0] = rgba.R;
                    m_RGBAArray[i * 4 + 1] = rgba.G;
                    m_RGBAArray[i * 4 + 2] = rgba.B;
                    m_RGBAArray[i * 4 + 3] = rgba.A;
                }
            }

            return(m_RGBAArray);
        }
Beispiel #2
0
        public byte[] GetRGBAArray()
        {
            if (m_RGBAArray == null)
            {
                m_RGBAArray = new byte[m_IndicesArray.Length * 4];

                for (int i = 0; i < m_IndicesArray.Length; i++)
                {
                    PaletteColor rgba = Palette.aoe2_palette[m_IndicesArray[i]];
                    if (m_IndicesArray[i] == 255)
                        rgba = new PaletteColor(0, 0, 0, 0);

                    m_RGBAArray[i * 4 + 0] = rgba.R;
                    m_RGBAArray[i * 4 + 1] = rgba.G;
                    m_RGBAArray[i * 4 + 2] = rgba.B;
                    m_RGBAArray[i * 4 + 3] = rgba.A;
                }
            }

            return m_RGBAArray;
        }