FetchCacheTexture() public static method

public static FetchCacheTexture ( TexInfo Texture, bool compress, bool mipmaps ) : TextureInfoWrapper
Texture TexInfo
compress bool
mipmaps bool
return TextureInfoWrapper
        static public TextureInfoWrapper UpdateTexture(TexInfo texture)
        {
            string     overrideName    = overridesList.Find(n => texture.name.Length == Regex.Match(texture.name, n).Length);
            bool       mipmaps         = true;
            bool       compress        = texture.isNormalMap ? false : true;
            int        scale           = 1;
            int        maxSize         = 0;
            int        minSize         = 64;
            FilterMode filterMode      = FilterMode.Bilinear;
            bool       makeNotReadable = false;

            if (foldersList.Exists(n => texture.name.StartsWith(n)))
            {
                if (texture.isNormalMap)
                {
                    mipmaps  = DatabaseLoaderTexture_ATM.config_mipmaps_normals;
                    compress = DatabaseLoaderTexture_ATM.config_compress_normals;
                    scale    = DatabaseLoaderTexture_ATM.config_scale_normals;
                    maxSize  = DatabaseLoaderTexture_ATM.config_max_size_normals;
                    minSize  = DatabaseLoaderTexture_ATM.config_min_size_normals;
                }
                else
                {
                    mipmaps  = DatabaseLoaderTexture_ATM.config_mipmaps;
                    compress = DatabaseLoaderTexture_ATM.config_compress;
                    scale    = DatabaseLoaderTexture_ATM.config_scale;
                    maxSize  = DatabaseLoaderTexture_ATM.config_max_size;
                    minSize  = DatabaseLoaderTexture_ATM.config_min_size;
                }
                filterMode      = config_filter_mode;
                makeNotReadable = config_make_not_readable;

                if (overrideName != null)
                {
                    ConfigNode overrideNode            = overrides.GetNode(overrideName);
                    String     normalString            = texture.isNormalMap ? "_normals" : "";
                    String     mipmapsString           = overrideNode.GetValue("mipmaps" + normalString);
                    String     compressString          = overrideNode.GetValue("compress" + normalString);
                    String     scaleString             = overrideNode.GetValue("scale" + normalString);
                    String     max_sizeString          = overrideNode.GetValue("max_size" + normalString);
                    String     min_sizeString          = overrideNode.GetValue("min_size" + normalString);
                    String     filter_modeString       = overrideNode.GetValue("filter_mode");
                    String     make_not_readableString = overrideNode.GetValue("make_not_readable");

                    if (mipmapsString != null)
                    {
                        bool.TryParse(mipmapsString, out mipmaps);
                    }
                    if (compressString != null)
                    {
                        bool.TryParse(compressString, out compress);
                    }
                    if (scaleString != null)
                    {
                        int.TryParse(scaleString, out scale);
                    }
                    if (filter_modeString != null)
                    {
                        try
                        {
                            filterMode = (FilterMode)Enum.Parse(typeof(FilterMode), filter_modeString);
                        }
                        catch
                        {
                            filterMode = config_filter_mode;
                        }
                    }
                    if (make_not_readableString != null)
                    {
                        bool.TryParse(make_not_readableString, out makeNotReadable);
                    }
                    if (max_sizeString != null)
                    {
                        int.TryParse(max_sizeString, out maxSize);
                    }
                    if (min_sizeString != null)
                    {
                        int.TryParse(min_sizeString, out minSize);
                    }
                }
            }
            texture.SetScalingParams(scale, maxSize, minSize);
            texture.makeNotReadable = makeNotReadable && !readableList.Contains(texture.name);
            TextureInfoWrapper ret = CacheController.FetchCacheTexture(texture, compress, mipmaps);

            ret.texture.filterMode = filterMode;
            return(ret);
        }
        static public GameDatabase.TextureInfo UpdateTexture(TexInfo texture)
        {
            string overrideName = overridesList.Find(n => texture.name.Length == Regex.Match(texture.name, n).Length);
            bool   mipmaps      = ActiveTextureManagement.config_mipmaps;
            bool   compress     = ActiveTextureManagement.config_compress;
            int    scale        = ActiveTextureManagement.config_scale;
            int    maxSize      = ActiveTextureManagement.config_max_size;

            if (texture.isNormalMap)
            {
                mipmaps  = ActiveTextureManagement.config_mipmaps_normals;
                compress = ActiveTextureManagement.config_compress_normals;
                scale    = ActiveTextureManagement.config_scale_normals;
                maxSize  = ActiveTextureManagement.config_max_size_normals;
            }
            FilterMode filterMode      = config_filter_mode;
            bool       makeNotReadable = config_make_not_readable;

            if (overrideName != null)
            {
                ConfigNode overrideNode            = overrides.GetNode(overrideName);
                String     normalString            = texture.isNormalMap ? "_normals" : "";
                String     mipmapsString           = overrideNode.GetValue("mipmaps" + normalString);
                String     compressString          = overrideNode.GetValue("compress" + normalString);
                String     scaleString             = overrideNode.GetValue("scale" + normalString);
                String     max_sizeString          = overrideNode.GetValue("max_size" + normalString);
                String     filter_modeString       = overrideNode.GetValue("filter_mode");
                String     make_not_readableString = overrideNode.GetValue("make_not_readable");
                if (mipmapsString != null)
                {
                    bool.TryParse(mipmapsString, out mipmaps);
                }
                if (compressString != null)
                {
                    bool.TryParse(compressString, out compress);
                }
                if (scaleString != null)
                {
                    int.TryParse(scaleString, out scale);
                }
                if (filter_modeString != null)
                {
                    try
                    {
                        filterMode = (FilterMode)Enum.Parse(typeof(FilterMode), filter_modeString);
                    }
                    catch
                    {
                        filterMode = config_filter_mode;
                    }
                }
                if (make_not_readableString != null)
                {
                    bool.TryParse(make_not_readableString, out makeNotReadable);
                }
                if (max_sizeString != null)
                {
                    int.TryParse(max_sizeString, out maxSize);
                }
            }

            texture.SetScalingParams(scale, maxSize);

            GameDatabase.TextureInfo ret = CacheController.FetchCacheTexture(texture, compress, mipmaps, makeNotReadable && !readableList.Contains(texture.name));
            ret.texture.filterMode = filterMode;
            return(ret);
        }