コード例 #1
0
        static GBTexture GetTexture(BitmapTexture bitmapTexture, GBPalette palette)
        {
            if (bitmapTexture == null)
            {
                return(GBTexture.Default);
            }

            var tex = new GBTexture();

            for (int y = 0; y < GBTexture.WidthPx; y++)
            {
                for (int x = 0; x < GBTexture.WidthPx; x++)
                {
                    var color   = bitmapTexture.Get(x, y);
                    var bgColor = palette.GetGBColor(color);
                    tex.Set(x, y, bgColor);
                }
            }

            return(tex);
        }