FSO.Client.UI.Framework.UIElement.StoreTexture C# (CSharp) Method

StoreTexture() public static method

public static StoreTexture ( ulong id, ContentResource assetData, bool mask, bool cacheOnDisk ) : Microsoft.Xna.Framework.Graphics.Texture2D
id ulong
assetData FSO.Client.GameContent.ContentResource
mask bool
cacheOnDisk bool
return Microsoft.Xna.Framework.Graphics.Texture2D
        public static Texture2D StoreTexture(ulong id, ContentResource assetData, bool mask, bool cacheOnDisk)
        {
            /**
             * This may not be the right way to get the texture to load as ARGB but it works :S
             */
            Texture2D texture = null;
            using (var stream = new MemoryStream(assetData.Data, false))
            {
                var isCached = assetData.FromCache;

                if (mask && !isCached)
                {
                    //var textureParams = Texture2D.GetCreationParameters(GameFacade.GraphicsDevice, stream);
                    //textureParams.Format = SurfaceFormat.Color;

                    stream.Seek(0, SeekOrigin.Begin);
                    texture = ImageLoader.FromStream(GameFacade.GraphicsDevice, stream); //, textureParams);

                    //TextureUtils.ManualTextureMaskSingleThreaded(ref texture, MASK_COLORS);
                }
                else
                {
                    texture = ImageLoader.FromStream(GameFacade.GraphicsDevice, stream);
                }
                UI_TEXTURE_CACHE.Add(id, texture);

                return texture;
            }
        }

Same methods

UIElement::StoreTexture ( ulong id, ContentResource assetData ) : Microsoft.Xna.Framework.Graphics.Texture2D