// Token: 0x060003D3 RID: 979 RVA: 0x00033F70 File Offset: 0x00032170
        private static void Add(int formatNum, int uncompressedFormatNum, int runtimeFormatNum, float bitsPerPixel, bool hasAlphaChannel, bool mustBeSquare, bool mustBePot, bool mustBePotForMipMaps, int minimumSize, int multipleOf, int blockSize, bool canUseCompressionQuality, bool canUseCrunchCompression, bool canBeReadable, string prettyName)
        {
            TextureImporterFormat format             = (TextureImporterFormat)formatNum;
            TextureImporterFormat uncompressedFormat = (TextureImporterFormat)uncompressedFormatNum;
            TextureFormat         runtimeFormat      = (TextureFormat)runtimeFormatNum;

            TextureImporterFormatDatabase.Entry entry = new TextureImporterFormatDatabase.Entry();
            entry.Name                     = format.ToString();
            entry.LongName                 = prettyName;
            entry.BitsPerPixel             = bitsPerPixel;
            entry.HasAlphaChannel          = hasAlphaChannel;
            entry.Format                   = format;
            entry.UncompressedFormat       = uncompressedFormat;
            entry.MinimumSize              = minimumSize;
            entry.MustBeMultipleOf         = multipleOf;
            entry.BlockSize                = blockSize;
            entry.MustBePot                = mustBePot;
            entry.MustBePotForMipMaps      = mustBePotForMipMaps;
            entry.MustBeSquare             = mustBeSquare;
            entry.CanUseCompressionQuality = canUseCompressionQuality;
            entry.CanUseCrunchCompression  = canUseCrunchCompression;
            entry.CanBeReadable            = canBeReadable;
            entry.RuntimeFormat            = runtimeFormat;
            TextureImporterFormatDatabase._List[(int)format] = entry;
        }
Esempio n. 2
0
 // Token: 0x060003E8 RID: 1000 RVA: 0x00034C54 File Offset: 0x00032E54
 public static TextureImporterFormat GetTextureImporterFormatFromTextureFormat(TextureFormat value)
 {
     TextureImporterFormatDatabase.Entry entry = TextureImporterFormatDatabase.Find(value);
     if (entry != null)
     {
         return(entry.Format);
     }
     return(TextureImporterFormat.RGBA32);
 }
Esempio n. 3
0
 // Token: 0x060003EA RID: 1002 RVA: 0x00034CA8 File Offset: 0x00032EA8
 public static string GetTextureImporterFormatLongString(TextureImporterFormat value)
 {
     if (value < 0)
     {
         return("Auto");
     }
     TextureImporterFormatDatabase.Entry entry = TextureImporterFormatDatabase.Find(value);
     if (entry != null)
     {
         return(entry.LongName);
     }
     return(value.ToString());
 }
 // Token: 0x060003D1 RID: 977 RVA: 0x00033EF0 File Offset: 0x000320F0
 public static TextureImporterFormatDatabase.Entry Find(TextureImporterFormat format)
 {
     if (format < 0)
     {
         return(new TextureImporterFormatDatabase.Entry());
     }
     if ((int)format >= TextureImporterFormatDatabase._List.Length)
     {
         return(new TextureImporterFormatDatabase.Entry());
     }
     TextureImporterFormatDatabase.Entry entry = TextureImporterFormatDatabase._List[(int)format];
     if (entry == null)
     {
         return(new TextureImporterFormatDatabase.Entry());
     }
     return(entry);
 }
Esempio n. 5
0
        // Token: 0x060003D8 RID: 984 RVA: 0x0003466C File Offset: 0x0003286C
        public static TextureUtil2.RuntimeMemoryUsage GetRuntimeMemorySize(TextureImporterFormat format, int width, int height, bool hasmips, bool isreadable, TextureImporterShape shape)
        {
            TextureImporterFormatDatabase.Entry entry = TextureImporterFormatDatabase.Find(format);
            float num = entry.BitsPerPixel;

            switch ((int)format)
            {
            case 48:
            case 49:
            case 50:
            case 51:
            case 52:
            case 53:
            case 54:
            case 55:
            case 56:
            case 57:
            case 58:
            case 59:
                width  = Mathf.CeilToInt((float)width / (float)entry.BlockSize) * entry.BlockSize;
                height = Mathf.CeilToInt((float)height / (float)entry.BlockSize) * entry.BlockSize;
                num    = 1f / (float)(entry.BlockSize * entry.BlockSize) * 128f;
                break;
            }
            float num2 = (float)(width * height) * num / 8f;

            if (hasmips)
            {
                num2 *= 1.33333337f;
            }
            bool flag = (int)shape == 2;

            if (flag)
            {
                num2 *= 6f;
            }
            TextureUtil2.RuntimeMemoryUsage result = default(TextureUtil2.RuntimeMemoryUsage);
            result.Gpu = Mathf.RoundToInt(num2);
            if (isreadable && !flag && entry.CanBeReadable)
            {
                result.Cpu = Mathf.RoundToInt(num2);
            }
            return(result);
        }
Esempio n. 6
0
 // Token: 0x060003E7 RID: 999 RVA: 0x00034C28 File Offset: 0x00032E28
 public static bool IsCompressedFormat(TextureImporterFormat value)
 {
     TextureImporterFormatDatabase.Entry entry = TextureImporterFormatDatabase.Find(value);
     return(entry != null && entry.Format != entry.UncompressedFormat);
 }
Esempio n. 7
0
 // Token: 0x060003E6 RID: 998 RVA: 0x00034C08 File Offset: 0x00032E08
 public static bool CanUseCompressionQuality(TextureImporterFormat value)
 {
     TextureImporterFormatDatabase.Entry entry = TextureImporterFormatDatabase.Find(value);
     return(entry != null && entry.CanUseCompressionQuality);
 }
Esempio n. 8
0
 // Token: 0x060003E2 RID: 994 RVA: 0x00034B38 File Offset: 0x00032D38
 public static bool HasAlphaChannel(TextureImporterFormat value)
 {
     TextureImporterFormatDatabase.Entry entry = TextureImporterFormatDatabase.Find(value);
     return(entry != null && entry.HasAlphaChannel);
 }